From bb74bba1c7eb6679b910840cd73746feefbbdad1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 1 Feb 2017 10:27:13 +0100 Subject: mackie: catch data on what presentation info aspects changed; don't change banks on a PI change --- libs/surfaces/mackie/mackie_control_protocol.cc | 31 ++++++++++--------------- libs/surfaces/mackie/mackie_control_protocol.h | 2 +- 2 files changed, 13 insertions(+), 20 deletions(-) (limited to 'libs/surfaces') diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 3038685f27..2a5d710eaf 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -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(); } /////////////////////////////////////////// diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index 8d63162ffc..943ccf0850 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -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 (); -- cgit v1.2.3