X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_rtevents.cc;h=f1f99e369373e3dda0e9380482cae287f6001d55;hb=91ab5e31751105d59386aab6a6e16ac5582904dc;hp=ca1ee319c7d93e32c7497c2a52dbf84547977148;hpb=3764eedca0d8ca8d666401c8bb8364705a64317e;p=ardour.git diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc index ca1ee319c7..f1f99e3693 100644 --- a/libs/ardour/session_rtevents.cc +++ b/libs/ardour/session_rtevents.cc @@ -21,9 +21,11 @@ #include "pbd/error.h" #include "pbd/compose.h" -#include "ardour/session.h" +#include "ardour/monitor_control.h" #include "ardour/route.h" +#include "ardour/session.h" #include "ardour/track.h" +#include "ardour/vca_manager.h" #include "i18n.h" @@ -33,157 +35,63 @@ using namespace ARDOUR; using namespace Glib; void -Session::set_monitoring (boost::shared_ptr rl, MonitorChoice mc, SessionEvent::RTeventCallback after, bool group_override) +Session::set_controls (boost::shared_ptr cl, double val, Controllable::GroupControlDisposition gcd) { - queue_event (get_rt_event (rl, mc, after, group_override, &Session::rt_set_monitoring)); -} - -void -Session::rt_set_monitoring (boost::shared_ptr rl, MonitorChoice mc, bool /* group_override */) -{ - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if (!(*i)->is_hidden()) { - boost::shared_ptr t = boost::dynamic_pointer_cast (*i); - if (t) { - t->set_monitoring (mc); - } - } + if (cl->empty()) { + return; } - set_dirty(); -} + std::cerr << "Session::set_controls called on " << cl->size() << " controls, group = " << enum_2_string (gcd) << std::endl; -void -Session::set_solo (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) -{ - queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_solo)); -} - -void -Session::rt_set_solo (boost::shared_ptr rl, bool yn, bool /* group_override */) -{ - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if (!(*i)->is_hidden()) { - (*i)->set_solo (yn, this); - } + for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) { + /* as of july 2017 this is a no-op for everything except record enable */ + (*ci)->do_pre_realtime_queue_stuff (val); } - set_dirty(); + queue_event (get_rt_event (cl, val, gcd)); } void -Session::set_just_one_solo (boost::shared_ptr r, bool yn, SessionEvent::RTeventCallback after) +Session::set_control (boost::shared_ptr ac, double val, Controllable::GroupControlDisposition gcd) { - /* its a bit silly to have to do this, but it keeps the API for this public method sane (we're - only going to solo one route) and keeps our ability to use get_rt_event() for the internal - private method. - */ - - boost::shared_ptr rl (new RouteList); - rl->push_back (r); - - queue_event (get_rt_event (rl, yn, after, false, &Session::rt_set_just_one_solo)); -} - -void -Session::rt_set_just_one_solo (boost::shared_ptr just_one, bool yn, bool /*ignored*/) -{ - boost::shared_ptr rl = routes.reader (); - boost::shared_ptr r = just_one->front(); - - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if (!(*i)->is_hidden() && r != *i) { - (*i)->set_solo (!yn, (*i)->route_group()); - } + if (!ac) { + return; } - r->set_solo (yn, r->route_group()); - - set_dirty(); -} - -void -Session::set_listen (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) -{ - queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_listen)); + boost::shared_ptr cl (new ControlList); + cl->push_back (ac); + set_controls (cl, val, gcd); } void -Session::rt_set_listen (boost::shared_ptr rl, bool yn, bool /*group_override*/ ) +Session::rt_set_controls (boost::shared_ptr cl, double val, Controllable::GroupControlDisposition gcd) { - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if (!(*i)->is_hidden()) { - (*i)->set_listen (yn, this); - } + for (ControlList::iterator c = cl->begin(); c != cl->end(); ++c) { + (*c)->set_value (val, gcd); } - - set_dirty(); } void -Session::set_mute (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) +Session::clear_all_solo_state (boost::shared_ptr rl) { - queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_mute)); + queue_event (get_rt_event (rl, false, rt_cleanup, Controllable::NoGroup, &Session::rt_clear_all_solo_state)); } void -Session::rt_set_mute (boost::shared_ptr rl, bool yn, bool /*group_override*/) +Session::rt_clear_all_solo_state (boost::shared_ptr rl, bool /* yn */, Controllable::GroupControlDisposition /* group_override */) { for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if (!(*i)->is_hidden()) { - (*i)->set_mute (yn, this); + if ((*i)->is_auditioner()) { + continue; } + (*i)->clear_all_solo_state(); } - set_dirty(); -} - -void -Session::set_solo_isolated (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) -{ - queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_solo_isolated)); -} - -void -Session::rt_set_solo_isolated (boost::shared_ptr rl, bool yn, bool /*group_override*/) -{ - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if (!(*i)->is_master() && !(*i)->is_monitor() && !(*i)->is_hidden()) { - (*i)->set_solo_isolated (yn, this); - } - } + _vca_manager->clear_all_solo_state (); set_dirty(); } -void -Session::set_record_enabled (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) -{ - if (!writable()) { - return; - } - - queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_record_enabled)); -} - -void -Session::rt_set_record_enabled (boost::shared_ptr rl, bool yn, bool group_override) -{ - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if ((*i)->is_hidden()) { - continue; - } - - boost::shared_ptr t; - - if ((t = boost::dynamic_pointer_cast(*i)) != 0) { - t->set_record_enabled (yn, (group_override ? (void*) t->route_group() : (void *) this)); - } - } - - set_dirty (); -} - void Session::process_rtop (SessionEvent* ev) {