summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-04-08 16:49:47 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:40 -0400
commit653ae4acd639fef149314fe6f8c7a0d862afae40 (patch)
treeba32ff0efd9b105c207ad7e3b2e89d73e76b4355 /libs/surfaces
parentc107f1ab56270f4485ca2a787d575c2b5b53cfcf (diff)
universal change in the design of the way Route/Track controls are designed and used. The controls now own their own state, rather than proxy for state in their owners.
Massive changes all over the code to accomodate this. Many things are not finished. Consider this a backup safety commit
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/control_protocol/control_protocol.cc12
-rw-r--r--libs/surfaces/faderport/faderport.cc8
-rw-r--r--libs/surfaces/faderport/operations.cc20
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc14
-rw-r--r--libs/surfaces/mackie/strip.cc8
-rw-r--r--libs/surfaces/osc/osc.cc13
6 files changed, 38 insertions, 37 deletions
diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc
index 5470232ad7..f413ad82d6 100644
--- a/libs/surfaces/control_protocol/control_protocol.cc
+++ b/libs/surfaces/control_protocol/control_protocol.cc
@@ -199,7 +199,7 @@ ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack>(r);
if (at) {
- at->set_record_enabled (yn, Controllable::NoGroup);
+ at->rec_enable_control()->set_value (1.0, Controllable::UseGroup);
}
}
@@ -215,7 +215,7 @@ ControlProtocol::route_get_rec_enable (uint32_t table_index)
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack>(r);
if (at) {
- return at->record_enabled ();
+ return at->rec_enable_control()->get_value();
}
return false;
@@ -248,7 +248,7 @@ ControlProtocol::route_set_gain (uint32_t table_index, float gain)
boost::shared_ptr<Route> r = route_table[table_index];
if (r != 0) {
- r->set_gain (gain, Controllable::UseGroup);
+ r->gain_control()->set_value (gain, Controllable::UseGroup);
}
}
@@ -298,7 +298,7 @@ ControlProtocol::route_get_muted (uint32_t table_index)
return false;
}
- return r->muted ();
+ return r->mute_control()->muted ();
}
void
@@ -311,7 +311,7 @@ ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
boost::shared_ptr<Route> r = route_table[table_index];
if (r != 0) {
- r->set_mute (yn, Controllable::UseGroup);
+ r->mute_control()->set_value (yn ? 1.0 : 0.0, Controllable::UseGroup);
}
}
@@ -342,7 +342,7 @@ ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
boost::shared_ptr<Route> r = route_table[table_index];
if (r != 0) {
- r->set_solo (yn, Controllable::UseGroup);
+ r->solo_control()->set_value (yn ? 1.0 : 0.0, Controllable::UseGroup);
}
}
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index d08264a42d..1df2fc4865 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -507,7 +507,7 @@ FaderPort::fader_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
single route at a time, allow the fader to
modify the group, if appropriate.
*/
- _current_route->set_gain (val, Controllable::UseGroup);
+ _current_route->gain_control()->set_value (val, Controllable::UseGroup);
}
}
}
@@ -1147,7 +1147,7 @@ FaderPort::set_current_route (boost::shared_ptr<Route> r)
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (_current_route);
if (t) {
- t->RecordEnableChanged.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_recenable, this), this);
+ t->rec_enable_control()->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_recenable, this), this);
}
boost::shared_ptr<AutomationControl> control = _current_route->gain_control ();
@@ -1227,7 +1227,7 @@ FaderPort::map_mute ()
if (_current_route->muted()) {
stop_blinking (Mute);
get_button (Mute).set_led_state (_output_port, true);
- } else if (_current_route->muted_by_others()) {
+ } else if (_current_route->mute_control()->muted_by_others()) {
start_blinking (Mute);
} else {
stop_blinking (Mute);
@@ -1252,7 +1252,7 @@ FaderPort::map_recenable ()
{
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (_current_route);
if (t) {
- get_button (Rec).set_led_state (_output_port, t->record_enabled());
+ get_button (Rec).set_led_state (_output_port, t->rec_enable_control()->get_value());
} else {
get_button (Rec).set_led_state (_output_port, false);
}
diff --git a/libs/surfaces/faderport/operations.cc b/libs/surfaces/faderport/operations.cc
index bb72794504..592b26da23 100644
--- a/libs/surfaces/faderport/operations.cc
+++ b/libs/surfaces/faderport/operations.cc
@@ -129,9 +129,9 @@ FaderPort::mute ()
return;
}
- boost::shared_ptr<RouteList> rl (new RouteList);
- rl->push_back (_current_route);
- session->set_mute (rl, !_current_route->muted());
+ boost::shared_ptr<ControlList> cl (new ControlList);
+ cl->push_back (_current_route->mute_control());
+ session->set_controls (cl, !_current_route->muted(), PBD::Controllable::UseGroup);
}
void
@@ -141,14 +141,15 @@ FaderPort::solo ()
return;
}
- boost::shared_ptr<RouteList> rl (new RouteList);
- rl->push_back (_current_route);
+ bool yn;
if (Config->get_solo_control_is_listen_control()) {
- session->set_listen (rl, !_current_route->listening_via_monitor());
+ yn = !_current_route->listening_via_monitor();
} else {
- session->set_solo (rl, !_current_route->soloed());
+ yn = !_current_route->soloed();
}
+
+ _current_route->solo_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::UseGroup);
}
void
@@ -164,10 +165,7 @@ FaderPort::rec_enable ()
return;
}
- boost::shared_ptr<RouteList> rl (new RouteList);
- rl->push_back (_current_route);
-
- session->set_record_enabled (rl, !t->record_enabled());
+ t->rec_enable_control()->set_value (!t->rec_enable_control()->get_value(), Controllable::UseGroup);
}
void
diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc
index 1869d5e231..025d56d25a 100644
--- a/libs/surfaces/mackie/mcp_buttons.cc
+++ b/libs/surfaces/mackie/mcp_buttons.cc
@@ -383,7 +383,7 @@ MackieControlProtocol::save_press (Button &)
} else {
save_state ();
}
-
+
return none;
}
@@ -886,15 +886,9 @@ MackieControlProtocol::clearsolo_press (Mackie::Button&)
access_action ("Editor/set-session-from-edit-range");
return none;
}
-
- if (session) {
- if (session->soloing()) {
- session->set_solo (session->get_routes(), false);
- } else if (session->listening()) {
- session->set_listen (session->get_routes(), false);
- }
- session->clear_all_solo_state (session->get_routes()); // safeguard, ideally this won't do anything, check the log-window
+ if (session) {
+ session->clear_all_solo_state (session->get_routes());
}
return none;
}
@@ -1063,7 +1057,7 @@ MackieControlProtocol::nudge_release (Mackie::Button&)
_modifier_state &= ~MODIFIER_NUDGE;
/* XXX these action names are stupid, because the action can affect
- * regions, markers or the playhead depending on selection state.
+ * regions, markers or the playhead depending on selection state.
*/
if (main_modifier_state() & MODIFIER_SHIFT) {
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index caa3a3bc66..0062c3b4fb 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -37,14 +37,17 @@
#include "ardour/debug.h"
#include "ardour/midi_ui.h"
#include "ardour/meter.h"
+#include "ardour/monitor_control.h"
#include "ardour/plugin_insert.h"
#include "ardour/pannable.h"
#include "ardour/panner.h"
#include "ardour/panner_shell.h"
+#include "ardour/phase_control.h"
#include "ardour/rc_configuration.h"
#include "ardour/route.h"
#include "ardour/session.h"
#include "ardour/send.h"
+#include "ardour/solo_isolate_control.h"
#include "ardour/track.h"
#include "ardour/midi_track.h"
#include "ardour/user_bundle.h"
@@ -302,7 +305,10 @@ void
Strip::notify_record_enable_changed ()
{
if (_route && _recenable) {
- _surface->write (_recenable->set_state (_route->record_enabled() ? on : off));
+ boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<Track> (_route);
+ if (trk) {
+ _surface->write (_recenable->set_state (trk->rec_enable_control()->get_value() ? on : off));
+ }
}
}
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index b26c2d8597..d758e29f03 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -974,7 +974,7 @@ OSC::routes_list (lo_message msg)
|| boost::dynamic_pointer_cast<MidiTrack>(r)) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(r);
- lo_message_add_int32 (reply, t->record_enabled());
+ lo_message_add_int32 (reply, (int32_t) t->rec_enable_control()->get_value());
}
//Automatically listen to routes listed
@@ -1054,7 +1054,7 @@ OSC::route_mute (int rid, int yn)
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
if (r) {
- r->set_mute (yn, PBD::Controllable::NoGroup);
+ r->mute_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
}
return 0;
@@ -1068,7 +1068,7 @@ OSC::route_solo (int rid, int yn)
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
if (r) {
- r->solo_control()->set_value(yn, PBD::Controllable::NoGroup);
+ r->solo_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
}
return 0;
@@ -1082,7 +1082,10 @@ OSC::route_recenable (int rid, int yn)
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
if (r) {
- r->set_record_enabled (yn, PBD::Controllable::NoGroup);
+ boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<Track> (r);
+ if (trk) {
+ trk->rec_enable_control()->set_value (yn, PBD::Controllable::UseGroup);
+ }
}
return 0;
@@ -1096,7 +1099,7 @@ OSC::route_set_gain_abs (int rid, float level)
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
if (r) {
- r->set_gain (level, PBD::Controllable::NoGroup);
+ r->gain_control()->set_value (level, PBD::Controllable::NoGroup);
}
return 0;