X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_rtevents.cc;h=00d966acaae62d4c92cc006a1c4b6d1123969127;hb=d6fd0486aef08fcccf013d889734971ed01eaedd;hp=ff452137d9a8193b32c919af2e3c948875948d3b;hpb=c685724c8067fc9308c5f66f1b91d445509159e9;p=ardour.git diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc index ff452137d9..00d966acaa 100644 --- a/libs/ardour/session_rtevents.cc +++ b/libs/ardour/session_rtevents.cc @@ -21,158 +21,73 @@ #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" +#include "pbd/i18n.h" using namespace std; using namespace PBD; using namespace ARDOUR; using namespace Glib; -SessionEvent* -Session::get_rt_event (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override, - void (Session::*method) (boost::shared_ptr, bool, bool)) -{ - SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0); - ev->rt_slot = boost::bind (method, this, rl, yn, group_override); - ev->rt_return = after; - ev->event_loop = EventLoop::get_event_loop_for_thread (); - - return ev; -} - -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 */) +Session::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_solo (yn, this); - } + if (cl->empty()) { + return; } - set_dirty(); -} - -void -Session::set_just_one_solo (boost::shared_ptr r, bool yn, SessionEvent::RTeventCallback after) -{ - /* 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()); - } + 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); } - - 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)); + queue_event (get_rt_event (cl, val, gcd)); } void -Session::rt_set_listen (boost::shared_ptr rl, bool yn, bool /*group_override*/ ) +Session::set_control (boost::shared_ptr ac, double val, Controllable::GroupControlDisposition gcd) { - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if (!(*i)->is_hidden()) { - (*i)->set_listen (yn, this); - } - } - - set_dirty(); -} - -void -Session::set_mute (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_mute)); -} - -void -Session::rt_set_mute (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_mute (yn, this); - } + if (!ac) { + return; } - - 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)); + boost::shared_ptr cl (new ControlList); + cl->push_back (ac); + set_controls (cl, val, gcd); } void -Session::rt_set_solo_isolated (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_master() && !(*i)->is_monitor() && !(*i)->is_hidden()) { - (*i)->set_solo_isolated (yn, this); - } + for (ControlList::iterator c = cl->begin(); c != cl->end(); ++c) { + (*c)->set_value (val, gcd); } - - set_dirty(); } void -Session::set_record_enabled (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) +Session::clear_all_solo_state (boost::shared_ptr rl) { - if (!writable()) { - return; - } - - queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_record_enabled)); + queue_event (get_rt_event (rl, false, rt_cleanup, Controllable::NoGroup, &Session::rt_clear_all_solo_state)); } void -Session::rt_set_record_enabled (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()) { + if ((*i)->is_auditioner()) { 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)); - } + (*i)->clear_all_solo_state(); } - set_dirty (); + _vca_manager->clear_all_solo_state (); + + set_dirty(); } void