13
0

New implementation for single-fader mackie devices (reverts b96d8e)

This commit is contained in:
Ben Loftis 2019-10-22 14:39:38 -05:00
parent f3e6f60242
commit 496e6f2a4c
5 changed files with 41 additions and 9 deletions

View File

@ -255,12 +255,16 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */)
if (!child->get_property ("value", _strip_cnt)) { if (!child->get_property ("value", _strip_cnt)) {
_strip_cnt = 8; _strip_cnt = 8;
} }
if (_strip_cnt==1)
_single_fader_follows_selection = true;
} else { } else {
return -1; 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 = node.child ("Extenders")) != 0) {
if (!child->get_property ("value", _extenders)) { if (!child->get_property ("value", _extenders)) {
_extenders = 0; _extenders = 0;

View File

@ -2407,6 +2407,27 @@ MackieControlProtocol::stripable_selection_changed ()
(*si)->update_strip_selection (); (*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 (); boost::shared_ptr<Stripable> s = first_selected_stripable ();
if (s) { if (s) {
check_fader_automation_state (); check_fader_automation_state ();
@ -2437,11 +2458,6 @@ MackieControlProtocol::first_selected_stripable () const
return s; 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 /* stripable is not mapped. thus, the currently selected stripable is
* not on the surfaces, and so from our perspective, there is * not on the surfaces, and so from our perspective, there is
* no currently selected stripable. * no currently selected stripable.

View File

@ -270,6 +270,11 @@ MackieControlProtocol::cursor_down_release (Button&)
LedState LedState
MackieControlProtocol::channel_left_press (Button &) MackieControlProtocol::channel_left_press (Button &)
{ {
if (_device_info.single_fader_follows_selection()) {
access_action ("Editor/select-prev-route");
return on;
}
if (_subview_mode != None) { if (_subview_mode != None) {
return none; return none;
} }
@ -291,6 +296,11 @@ MackieControlProtocol::channel_left_release (Button &)
LedState LedState
MackieControlProtocol::channel_right_press (Button &) MackieControlProtocol::channel_right_press (Button &)
{ {
if (_device_info.single_fader_follows_selection()) {
access_action ("Editor/select-next-route");
return on;
}
if (_subview_mode != None) { if (_subview_mode != None) {
return none; return none;
} }

View File

@ -2,7 +2,7 @@
<MackieProtocolDevice> <MackieProtocolDevice>
<Name value="RuCo"/> <Name value="RuCo"/>
<DeviceType value="MCU"/> <DeviceType value="MCU"/>
<Strips value="1"/> <Strips value="8"/>
<MasterFader value="no"/> <MasterFader value="no"/>
<TimecodeDisplay value="yes"/> <TimecodeDisplay value="yes"/>
<TwoCharacterDisplay value="yes"/> <TwoCharacterDisplay value="yes"/>
@ -12,4 +12,5 @@
<JogWheel value="yes"/> <JogWheel value="yes"/>
<TouchSenseFaders value="yes"/> <TouchSenseFaders value="yes"/>
<HasSeparateMeters value="yes"/> <HasSeparateMeters value="yes"/>
<SingleFaderFollowsSelection value="yes"/>
</MackieProtocolDevice> </MackieProtocolDevice>

View File

@ -2,7 +2,7 @@
<MackieProtocolDevice> <MackieProtocolDevice>
<Name value="Behringer X-Touch One"/> <Name value="Behringer X-Touch One"/>
<DeviceType value="MCU"/> <DeviceType value="MCU"/>
<Strips value="1"/> <Strips value="8"/>
<MasterFader value="no"/> <MasterFader value="no"/>
<TimecodeDisplay value="yes"/> <TimecodeDisplay value="yes"/>
<TwoCharacterDisplay value="yes"/> <TwoCharacterDisplay value="yes"/>
@ -12,4 +12,5 @@
<JogWheel value="yes"/> <JogWheel value="yes"/>
<TouchSenseFaders value="yes"/> <TouchSenseFaders value="yes"/>
<HasSeparateMeters value="yes"/> <HasSeparateMeters value="yes"/>
<SingleFaderFollowsSelection value="yes"/>
</MackieProtocolDevice> </MackieProtocolDevice>