13
0

gui support for changing tracks' time domain

This commit is contained in:
Paul Davis 2023-07-21 21:15:20 -06:00
parent 3d64972ca2
commit a4b43a6f69
3 changed files with 30 additions and 3 deletions

View File

@ -847,7 +847,7 @@ RouteTimeAxisView::build_display_menu ()
} else {
i->set_active (false);
}
// i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_time_domain), Temporal::AudioTime, true));
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_time_domain), Temporal::AudioTime, true));
time_domain_items.push_back (CheckMenuElem (_("Musical (beat) time")));
i = dynamic_cast<Gtk::CheckMenuItem *> (&time_domain_items.back());
if (_route->has_own_time_domain() && _route->time_domain() == Temporal::BeatTime) {
@ -855,7 +855,7 @@ RouteTimeAxisView::build_display_menu ()
} else {
i->set_active (false);
}
// i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_time_domain), Temporal::BeatTime, true));
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_time_domain), Temporal::BeatTime, true));
time_domain_items.push_back (CheckMenuElem (_("Follow Session time domain")));
i = dynamic_cast<Gtk::CheckMenuItem *> (&time_domain_items.back());
if (!_route->has_own_time_domain()) {
@ -863,7 +863,7 @@ RouteTimeAxisView::build_display_menu ()
} else {
i->set_active (false);
}
// i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::clear_route_time_domain), Temporal::BeatTime, true));
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::clear_time_domain), true));
items.push_back (MenuElem (_("Time Domain"), *time_domain_menu));
items.push_back (CheckMenuElem (_("Active")));

View File

@ -2844,3 +2844,27 @@ RouteUI::rename_current_playlist ()
}
}
}
void
RouteUI::set_time_domain (Temporal::TimeDomain td, bool apply_to_selection)
{
if (apply_to_selection) {
std::cerr << "change route TD to " << td << std::endl;
ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (boost::bind (&RouteUI::set_time_domain, _1, td, false));
} else {
route()->set_time_domain (td);
}
}
void
RouteUI::clear_time_domain (bool apply_to_selection)
{
if (apply_to_selection) {
ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (boost::bind (&RouteUI::clear_time_domain, _1, false));
} else {
route()->clear_time_domain ();
}
}

View File

@ -159,6 +159,9 @@ public:
void set_disk_io_point (ARDOUR::DiskIOPoint);
void fan_out (bool to_busses = true, bool group = true);
void set_time_domain (Temporal::TimeDomain, bool);
void clear_time_domain (bool);
/* The editor calls these when mapping an operation across multiple tracks */
void use_new_playlist (std::string name, std::string group_id, std::vector<std::shared_ptr<ARDOUR::Playlist> > const&, bool copy);
void clear_playlist ();