mackie: catch data on what presentation info aspects changed; don't change banks on a PI change
This commit is contained in:
parent
6e09e72f11
commit
bb74bba1c7
@ -138,7 +138,7 @@ MackieControlProtocol::MackieControlProtocol (Session& session)
|
||||
_last_bank[i] = 0;
|
||||
}
|
||||
|
||||
PresentationInfo::Change.connect (gui_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_presentation_info_changed, this), this);
|
||||
PresentationInfo::Change.connect (gui_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_presentation_info_changed, this, _1), this);
|
||||
|
||||
_instance = this;
|
||||
|
||||
@ -1298,8 +1298,17 @@ MackieControlProtocol::notify_solo_active_changed (bool active)
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::notify_presentation_info_changed ()
|
||||
MackieControlProtocol::notify_presentation_info_changed (PBD::PropertyChange const & what_changed)
|
||||
{
|
||||
PBD::PropertyChange order_or_hidden;
|
||||
|
||||
order_or_hidden.add (Properties::hidden);
|
||||
order_or_hidden.add (Properties::order);
|
||||
|
||||
if (!what_changed.contains (order_or_hidden)) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
|
||||
@ -1308,23 +1317,7 @@ MackieControlProtocol::notify_presentation_info_changed ()
|
||||
}
|
||||
}
|
||||
|
||||
Sorted sorted = get_sorted_stripables();
|
||||
uint32_t sz = n_strips();
|
||||
|
||||
// if a remote id has been moved off the end, we need to shift
|
||||
// the current bank backwards.
|
||||
|
||||
if (sorted.size() - _current_initial_bank < sz) {
|
||||
// but don't shift backwards past the zeroth channel
|
||||
if (sorted.size() < sz) { // avoid unsigned math mistake below
|
||||
(void) switch_banks(0, true);
|
||||
} else {
|
||||
(void) switch_banks (max((Sorted::size_type) 0, sorted.size() - sz), true);
|
||||
}
|
||||
} else {
|
||||
// Otherwise just refresh the current bank
|
||||
refresh_current_bank();
|
||||
}
|
||||
refresh_current_bank();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////
|
||||
|
@ -190,7 +190,7 @@ class MackieControlProtocol
|
||||
void notify_routes_added (ARDOUR::RouteList &);
|
||||
void notify_vca_added (ARDOUR::VCAList &);
|
||||
|
||||
void notify_presentation_info_changed();
|
||||
void notify_presentation_info_changed(PBD::PropertyChange const &);
|
||||
|
||||
void recalibrate_faders ();
|
||||
void toggle_backlight ();
|
||||
|
Loading…
Reference in New Issue
Block a user