2 Copyright (C) 2015 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "ardour/async_midi_port.h"
21 #include "ardour/monitor_processor.h"
22 #include "ardour/rc_configuration.h"
23 #include "ardour/session.h"
24 #include "ardour/track.h"
25 #include "ardour/types.h"
27 #include "faderport.h"
29 using namespace ARDOUR;
30 using namespace ArdourSurface;
35 access_action ("Editor/select-prev-route");
38 //if ( (button_state & ShiftDown) == ShiftDown )
45 access_action ("Editor/select-next-route");
48 //if ( (button_state & ShiftDown) == ShiftDown )
56 boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
58 gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Play );
67 boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
69 gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Write );
78 boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
80 gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Touch );
89 boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
91 gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Off );
102 ControlProtocol::Undo (); /* EMIT SIGNAL */
108 ControlProtocol::Redo (); /* EMIT SIGNAL */
114 if (!_current_route) {
118 if (_current_route == session->monitor_out()) {
119 boost::shared_ptr<MonitorProcessor> mp = _current_route->monitor_control();
120 mp->set_cut_all (!mp->cut_all());
124 boost::shared_ptr<RouteList> rl (new RouteList);
125 rl->push_back (_current_route);
126 session->set_mute (rl, !_current_route->muted());
132 if (!_current_route) {
136 boost::shared_ptr<RouteList> rl (new RouteList);
137 rl->push_back (_current_route);
139 if (Config->get_solo_control_is_listen_control()) {
140 session->set_listen (rl, !_current_route->listening_via_monitor());
142 session->set_solo (rl, !_current_route->soloed());
147 FaderPort::rec_enable ()
149 if (!_current_route) {
153 boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_current_route);
159 boost::shared_ptr<RouteList> rl (new RouteList);
160 rl->push_back (_current_route);
162 session->set_record_enabled (rl, !t->record_enabled());
166 FaderPort::use_master ()
168 boost::shared_ptr<Route> r = session->master_out();
170 if (_current_route == r) {
171 r = pre_master_route.lock();
172 set_current_route (r);
173 button_info(Output).set_led_state (_output_port, false);
174 blinkers.remove (Output);
176 if (_current_route != session->master_out() && _current_route != session->monitor_out()) {
177 pre_master_route = boost::weak_ptr<Route> (_current_route);
179 set_current_route (r);
180 button_info(Output).set_led_state (_output_port, true);
181 blinkers.remove (Output);
187 FaderPort::use_monitor ()
189 boost::shared_ptr<Route> r = session->monitor_out();
192 if (_current_route == r) {
193 r = pre_monitor_route.lock();
194 set_current_route (r);
195 button_info(Output).set_led_state (_output_port, false);
196 blinkers.remove (Output);
198 if (_current_route != session->master_out() && _current_route != session->monitor_out()) {
199 pre_monitor_route = boost::weak_ptr<Route> (_current_route);
201 set_current_route (r);
202 button_info(Output).set_led_state (_output_port, true);
203 blinkers.push_back (Output);