2 * Copyright (C) 1999-2017 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2011-2014 David Robillard <d@drobilla.net>
4 * Copyright (C) 2015 Robin Gareus <robin@gareus.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <boost/bind.hpp>
23 #include "pbd/error.h"
24 #include "pbd/compose.h"
26 #include "ardour/monitor_control.h"
27 #include "ardour/route.h"
28 #include "ardour/session.h"
29 #include "ardour/track.h"
30 #include "ardour/vca_manager.h"
36 using namespace ARDOUR;
40 Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
46 for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
47 /* as of july 2017 this is a no-op for everything except record enable */
48 (*ci)->pre_realtime_queue_stuff (val, gcd);
51 queue_event (get_rt_event (cl, val, gcd));
55 Session::set_control (boost::shared_ptr<AutomationControl> ac, double val, Controllable::GroupControlDisposition gcd)
61 boost::shared_ptr<ControlList> cl (new ControlList);
63 set_controls (cl, val, gcd);
67 Session::rt_set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
69 /* Note that we require that all controls in the ControlList are of the
76 for (ControlList::iterator c = cl->begin(); c != cl->end(); ++c) {
77 (*c)->set_value (val, gcd);
80 /* some controls need global work to take place after they are set. Do
84 switch (cl->front()->parameter().type()) {
86 update_route_solo_state ();
94 Session::clear_all_solo_state (boost::shared_ptr<RouteList> rl)
96 queue_event (get_rt_event (rl, false, rt_cleanup, Controllable::NoGroup, &Session::rt_clear_all_solo_state));
100 Session::rt_clear_all_solo_state (boost::shared_ptr<RouteList> rl, bool /* yn */, Controllable::GroupControlDisposition /* group_override */)
102 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
103 if ((*i)->is_auditioner()) {
106 (*i)->clear_all_solo_state();
109 _vca_manager->clear_all_solo_state ();
111 update_route_solo_state ();
115 Session::process_rtop (SessionEvent* ev)
119 if (ev->event_loop) {
120 ev->event_loop->call_slot (MISSING_INVALIDATOR, boost::bind (ev->rt_return, ev));
122 warning << string_compose ("programming error: %1", X_("Session RT event queued from thread without a UI - cleanup in RT thread!")) << endmsg;