summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-02-01 10:27:13 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-02-01 10:27:34 +0100
commitbb74bba1c7eb6679b910840cd73746feefbbdad1 (patch)
tree3781db6072d485ad5201edfc23dafdd2a798faf0 /libs/surfaces
parent6e09e72f1112bbd49a174223b82513b78d4093b6 (diff)
mackie: catch data on what presentation info aspects changed; don't change banks on a PI change
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc31
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h2
2 files changed, 13 insertions, 20 deletions
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 ();