summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2019-10-22 14:39:38 -0500
committerBen Loftis <ben@harrisonconsoles.com>2019-10-22 14:39:38 -0500
commit496e6f2a4c5eaed7cf0e5cbed16ff63f53032462 (patch)
treea119ae63335b3d7f2326d0f63c81a366327f04f5 /libs/surfaces
parentf3e6f6024261a5279909e4b9d5c2ce96317c7b53 (diff)
New implementation for single-fader mackie devices (reverts b96d8e)
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/mackie/device_info.cc8
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc26
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc10
3 files changed, 37 insertions, 7 deletions
diff --git a/libs/surfaces/mackie/device_info.cc b/libs/surfaces/mackie/device_info.cc
index c085aea812..820b2dc4f7 100644
--- a/libs/surfaces/mackie/device_info.cc
+++ b/libs/surfaces/mackie/device_info.cc
@@ -255,12 +255,16 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */)
if (!child->get_property ("value", _strip_cnt)) {
_strip_cnt = 8;
}
- if (_strip_cnt==1)
- _single_fader_follows_selection = true;
} else {
return -1;
}
+ if ((child = node.child ("SingleFaderFollowsSelection")) != 0) {
+ child->get_property ("value", _single_fader_follows_selection);
+ } else {
+ _single_fader_follows_selection = false;
+ }
+
if ((child = node.child ("Extenders")) != 0) {
if (!child->get_property ("value", _extenders)) {
_extenders = 0;
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index 7878a795bc..adf503f550 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -2407,6 +2407,27 @@ MackieControlProtocol::stripable_selection_changed ()
(*si)->update_strip_selection ();
}
+ /* if we are following the Gui, find the selected strips and map them here */
+ if (_device_info.single_fader_follows_selection()) {
+
+ Sorted sorted = get_sorted_stripables();
+
+ Sorted::iterator r = sorted.begin();
+ for (Surfaces::iterator si = surfaces.begin(); si != surfaces.end(); ++si) {
+ vector<boost::shared_ptr<Stripable> > stripables;
+ uint32_t added = 0;
+
+ for (; r != sorted.end() && added < (*si)->n_strips (false); ++r, ++added) {
+ if ((*r)->is_selected()) {
+ stripables.push_back (*r);
+ }
+ }
+
+ (*si)->map_stripables (stripables);
+ }
+ return;
+ }
+
boost::shared_ptr<Stripable> s = first_selected_stripable ();
if (s) {
check_fader_automation_state ();
@@ -2437,11 +2458,6 @@ MackieControlProtocol::first_selected_stripable () const
return s;
}
- /* if it's a single-fader surface, it should follow the selection */
- if (_device_info.single_fader_follows_selection()) {
- return s;
- }
-
/* stripable is not mapped. thus, the currently selected stripable is
* not on the surfaces, and so from our perspective, there is
* no currently selected stripable.
diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc
index f9d6c1af8a..663ff6c017 100644
--- a/libs/surfaces/mackie/mcp_buttons.cc
+++ b/libs/surfaces/mackie/mcp_buttons.cc
@@ -270,6 +270,11 @@ MackieControlProtocol::cursor_down_release (Button&)
LedState
MackieControlProtocol::channel_left_press (Button &)
{
+ if (_device_info.single_fader_follows_selection()) {
+ access_action ("Editor/select-prev-route");
+ return on;
+ }
+
if (_subview_mode != None) {
return none;
}
@@ -291,6 +296,11 @@ MackieControlProtocol::channel_left_release (Button &)
LedState
MackieControlProtocol::channel_right_press (Button &)
{
+ if (_device_info.single_fader_follows_selection()) {
+ access_action ("Editor/select-next-route");
+ return on;
+ }
+
if (_subview_mode != None) {
return none;
}