summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour_ui.cc52
-rw-r--r--gtk2_ardour/ardour_ui.h15
-rw-r--r--gtk2_ardour/ardour_ui2.cc33
-rw-r--r--gtk2_ardour/keyboard.cc6
-rw-r--r--gtk2_ardour/option_editor.cc36
-rw-r--r--gtk2_ardour/option_editor.h5
-rw-r--r--libs/ardour/ardour/configuration_vars.h1
-rw-r--r--libs/ardour/ardour/session.h5
-rw-r--r--libs/ardour/session_midi.cc18
-rw-r--r--libs/ardour/session_state.cc12
-rw-r--r--libs/midi++2/midi++/mmc.h2
-rw-r--r--libs/midi++2/midiparser.cc6
-rw-r--r--libs/midi++2/mmc.cc4
-rw-r--r--libs/pbd/controllable.cc55
-rw-r--r--libs/pbd/pbd/controllable.h11
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc20
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc2
17 files changed, 154 insertions, 129 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 71ef0387cf..bd2b7fced0 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -707,40 +707,6 @@ ARDOUR_UI::update_wall_clock ()
return TRUE;
}
-void
-ARDOUR_UI::control_methods_adjusted ()
-
-{
- int which_method;
-
- which_method = (int) online_control_button->adjustment.get_value();
- switch (which_method) {
- case 0:
- allow_mmc_and_local ();
- break;
- case 1:
- allow_mmc_only ();
- break;
- case 2:
- allow_local_only ();
- break;
- default:
- fatal << _("programming error: impossible control method") << endmsg;
- }
-}
-
-
-void
-ARDOUR_UI::mmc_device_id_adjusted ()
-
-{
-#if 0
- if (mmc) {
- int dev_id = (int) mmc_id_button->adjustment.get_value();
- mmc->set_device_id (dev_id);
- }
-#endif
-}
gint
ARDOUR_UI::session_menu (GdkEventButton *ev)
@@ -1310,24 +1276,6 @@ ARDOUR_UI::map_transport_state ()
}
void
-ARDOUR_UI::allow_local_only ()
-{
-
-}
-
-void
-ARDOUR_UI::allow_mmc_only ()
-{
-
-}
-
-void
-ARDOUR_UI::allow_mmc_and_local ()
-{
-
-}
-
-void
ARDOUR_UI::GlobalClickBox::printer (char buf[32], Adjustment &adj, void *arg)
{
snprintf (buf, sizeof(buf), "%s", ((GlobalClickBox *) arg)->strings[
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index dfef964c67..00d8deacbf 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -273,9 +273,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
GlobalClickBox *crossfade_time_button;
vector<string> crossfade_time_strings;
- GlobalClickBox *mmc_id_button;
- vector<string> mmc_id_strings;
-
Gtk::ToggleButton preroll_button;
Gtk::ToggleButton postroll_button;
@@ -285,7 +282,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
int setup_windows ();
void setup_transport ();
void setup_clock ();
- void setup_adjustables ();
static ARDOUR_UI *theArdourUI;
@@ -313,9 +309,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void start_blinking ();
void stop_blinking ();
- void control_methods_adjusted ();
- void mmc_device_id_adjusted ();
-
void about_signal_response(int response);
private:
@@ -467,14 +460,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void transport_rec_enable_blink (bool onoff);
- /* These change where we accept control from:
- MMC, X (local) or both.
- */
-
- void allow_mmc_only ();
- void allow_mmc_and_local ();
- void allow_local_only ();
-
Gtk::Menu* session_popup_menu;
struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index 5f1f0e3b7b..bb7e306c8d 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -73,7 +73,6 @@ ARDOUR_UI::setup_windows ()
setup_clock ();
setup_transport();
- setup_adjustables ();
build_menu_bar ();
top_packer.pack_start (menu_bar_base, false, false);
@@ -85,38 +84,6 @@ ARDOUR_UI::setup_windows ()
}
void
-ARDOUR_UI::setup_adjustables ()
-{
- adjuster_table.set_homogeneous (true);
-
- online_control_strings.push_back (_("MMC + Local"));
- online_control_strings.push_back (_("MMC"));
- online_control_strings.push_back (_("Local"));
-
- online_control_button = new GlobalClickBox ("CONTROL",
- online_control_strings);
-
- online_control_button->adjustment.signal_value_changed().connect(mem_fun(*this,&ARDOUR_UI::control_methods_adjusted));
-
- mmc_id_strings.push_back ("1");
- mmc_id_strings.push_back ("2");
- mmc_id_strings.push_back ("3");
- mmc_id_strings.push_back ("4");
- mmc_id_strings.push_back ("5");
- mmc_id_strings.push_back ("6");
- mmc_id_strings.push_back ("7");
- mmc_id_strings.push_back ("8");
- mmc_id_strings.push_back ("9");
-
- mmc_id_button = new GlobalClickBox (_("MMC ID"), mmc_id_strings);
-
- mmc_id_button->adjustment.signal_value_changed().connect (mem_fun(*this,&ARDOUR_UI::mmc_device_id_adjusted));
-
- adjuster_table.attach (*online_control_button, 0, 2, 1, 2, FILL|EXPAND, FILL, 5, 5);
- adjuster_table.attach (*mmc_id_button, 2, 3, 1, 2, FILL, FILL, 5, 5);
-}
-
-void
ARDOUR_UI::transport_stopped ()
{
stop_button.set_visual_state (1);
diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc
index 517ef973d4..e7a537716e 100644
--- a/gtk2_ardour/keyboard.cc
+++ b/gtk2_ardour/keyboard.cc
@@ -76,12 +76,6 @@ Keyboard::Keyboard ()
}
Meta = possible_meta[i];
- if (Meta) {
- cerr << "Using " << possible_meta[i] << " for Meta\n";
- } else {
- cerr << "NO Meta\n";
- }
-
snooper_id = gtk_key_snooper_install (_snooper, (gpointer) this);
XMLNode* node = ARDOUR_UI::instance()->keyboard_settings();
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc
index 13acfbf5ab..79fe5dd2e3 100644
--- a/gtk2_ardour/option_editor.cc
+++ b/gtk2_ardour/option_editor.cc
@@ -75,6 +75,9 @@ OptionEditor::OptionEditor (ARDOUR_UI& uip, PublicEditor& ed, Mixer_UI& mixui)
/* MIDI */
+ mmc_device_id_adjustment (0.0, 0.0, (double) 0x7f, 1.0, 16.0),
+ mmc_device_id_spinner (mmc_device_id_adjustment),
+
/* Click */
click_table (2, 3),
@@ -368,23 +371,28 @@ OptionEditor::setup_midi_options ()
ToggleButton* tb;
RadioButton* rb;
- Gtk::Table* table = manage (new Table (ports.size() + 4, 9));
+ Gtk::Table* table = manage (new Table (ports.size() + 4, 10));
table->set_row_spacings (6);
table->set_col_spacings (10);
- table->attach (*(manage (new Label (X_("Port")))), 0, 1, 0, 1);
- table->attach (*(manage (new Label (X_("Offline")))), 1, 2, 0, 1);
- table->attach (*(manage (new Label (X_("Trace\nInput")))), 2, 3, 0, 1);
- table->attach (*(manage (new Label (X_("Trace\nOutput")))), 3, 4, 0, 1);
- table->attach (*(manage (new Label (X_("MTC")))), 4, 5, 0, 1);
- table->attach (*(manage (new Label (X_("MMC")))), 6, 7, 0, 1);
- table->attach (*(manage (new Label (X_("MIDI Parameter\nControl")))), 8, 9, 0, 1);
+ table->attach (*(manage (new Label (_("Port")))), 0, 1, 0, 1);
+ table->attach (*(manage (new Label (_("Offline")))), 1, 2, 0, 1);
+ table->attach (*(manage (new Label (_("Trace\nInput")))), 2, 3, 0, 1);
+ table->attach (*(manage (new Label (_("Trace\nOutput")))), 3, 4, 0, 1);
+ table->attach (*(manage (new Label (_("MTC")))), 4, 5, 0, 1);
+ table->attach (*(manage (new Label (_("MMC")))), 6, 7, 0, 1);
+ table->attach (*(manage (new Label (_("MIDI Parameter\nControl")))), 8, 9, 0, 1);
table->attach (*(manage (new HSeparator())), 0, 9, 1, 2);
table->attach (*(manage (new VSeparator())), 5, 6, 0, 8);
table->attach (*(manage (new VSeparator())), 7, 8, 0, 8);
+ table->attach (*(manage (new Label (_("MMC Device ID")))), 9, 10, 0, 1);
+ table->attach (mmc_device_id_spinner, 9, 10, 1, 2);
+
+ mmc_device_id_adjustment.signal_value_changed().connect (mem_fun (*this, &OptionEditor::mmc_device_id_adjusted));
+
for (n = 0, i = ports.begin(); i != ports.end(); ++n, ++i) {
pair<MIDI::Port*,vector<RadioButton*> > newpair;
@@ -554,12 +562,22 @@ OptionEditor::map_port_online (MIDI::Port* port, ToggleButton* tb)
}
void
+OptionEditor::mmc_device_id_adjusted ()
+{
+ uint8_t id = (uint8_t) mmc_device_id_spinner.get_value();
+
+ if (id != Config->get_mmc_device_id()) {
+ Config->set_mmc_device_id (id);
+ }
+}
+
+void
OptionEditor::port_trace_in_toggled (MIDI::Port* port, ToggleButton* tb)
{
bool trace = tb->get_active();
if (port->input()->tracing() != trace) {
- port->output()->trace (trace, &cerr, string (port->name()) + string (" input: "));
+ port->input()->trace (trace, &cerr, string (port->name()) + string (" input: "));
}
}
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h
index cc28a74e60..009ac90de4 100644
--- a/gtk2_ardour/option_editor.h
+++ b/gtk2_ardour/option_editor.h
@@ -111,6 +111,9 @@ class OptionEditor : public Gtk::Dialog
Gtk::RadioButton::Group mmc_button_group;
Gtk::RadioButton::Group midi_button_group;
+ Gtk::Adjustment mmc_device_id_adjustment;
+ Gtk::SpinButton mmc_device_id_spinner;
+
void port_online_toggled (MIDI::Port*,Gtk::ToggleButton*);
void port_trace_in_toggled (MIDI::Port*,Gtk::ToggleButton*);
void port_trace_out_toggled (MIDI::Port*,Gtk::ToggleButton*);
@@ -119,6 +122,8 @@ class OptionEditor : public Gtk::Dialog
void mtc_port_chosen (MIDI::Port*,Gtk::RadioButton*);
void midi_port_chosen (MIDI::Port*,Gtk::RadioButton*);
+ void mmc_device_id_adjusted ();
+
void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
void setup_midi_options();
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index c1e59baf35..1296ab0dad 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -18,6 +18,7 @@ CONFIG_VARIABLE (bool, send_mmc, "send-mmc", false)
CONFIG_VARIABLE (bool, mmc_control, "mmc-control", false)
CONFIG_VARIABLE (bool, midi_feedback, "midi-feedback", false)
CONFIG_VARIABLE (bool, midi_control, "midi-control", false)
+CONFIG_VARIABLE (uint8_t, mmc_device_id, "mmc-device-id", 0)
/* control surfaces */
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index f03a067edf..39bb9c3e68 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -724,6 +724,8 @@ class Session : public PBD::StatefulDestructible
void deliver_midi (MIDI::Port*, MIDI::byte*, int32_t size);
+ void set_mmc_device_id (uint32_t id);
+
/* Scrubbing */
void start_scrub (nframes_t where);
@@ -1267,8 +1269,7 @@ class Session : public PBD::StatefulDestructible
void mmc_record_pause (MIDI::MachineControl &);
void mmc_record_strobe (MIDI::MachineControl &);
void mmc_record_exit (MIDI::MachineControl &);
- void mmc_track_record_status (MIDI::MachineControl &,
- uint32_t track, bool enabled);
+ void mmc_track_record_status (MIDI::MachineControl &, uint32_t track, bool enabled);
void mmc_fast_forward (MIDI::MachineControl &);
void mmc_rewind (MIDI::MachineControl &);
void mmc_locate (MIDI::MachineControl &, const MIDI::byte *);
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index 8a553fb12d..24ba406087 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -126,9 +126,20 @@ Session::set_mtc_port (string port_tag)
return 0;
}
+void
+Session::set_mmc_device_id (uint32_t device_id)
+{
+ if (mmc) {
+ mmc->set_device_id (device_id);
+ }
+}
+
int
Session::set_mmc_port (string port_tag)
{
+ MIDI::byte old_device_id;
+ bool reset_id = false;
+
if (port_tag.length() == 0) {
if (_mmc_port == 0) {
return 0;
@@ -146,6 +157,8 @@ Session::set_mmc_port (string port_tag)
_mmc_port = port;
if (mmc) {
+ old_device_id = mmc->device_id();
+ reset_id = true;
delete mmc;
}
@@ -153,6 +166,9 @@ Session::set_mmc_port (string port_tag)
MMC_CommandSignature,
MMC_ResponseSignature);
+ if (reset_id) {
+ mmc->set_device_id (old_device_id);
+ }
mmc->Play.connect
(mem_fun (*this, &Session::mmc_deferred_play));
@@ -181,6 +197,7 @@ Session::set_mmc_port (string port_tag)
mmc->TrackRecordStatusChange.connect
(mem_fun (*this, &Session::mmc_record_enable));
+
/* also handle MIDI SPP because its so common */
_mmc_port->input()->start.connect (mem_fun (*this, &Session::spp_start));
@@ -543,7 +560,6 @@ Session::mmc_pause (MIDI::MachineControl &mmc)
static bool step_queued = false;
void
-
Session::mmc_step (MIDI::MachineControl &mmc, int steps)
{
if (!Config->get_mmc_control()) {
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 861e03302f..3c58a448c2 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -2832,6 +2832,12 @@ Session::set_deletion_in_progress ()
void
Session::add_controllable (Controllable* c)
{
+ /* this adds a controllable to the list managed by the Session.
+ this is a subset of those managed by the Controllable class
+ itself, and represents the only ones whose state will be saved
+ as part of the session.
+ */
+
Glib::Mutex::Lock lm (controllables_lock);
controllables.insert (c);
}
@@ -3065,6 +3071,12 @@ Session::config_changed (const char* parameter_name)
poke_midi_thread ();
+ } else if (PARAM_IS ("mmc-device-id")) {
+
+ if (mmc) {
+ mmc->set_device_id (Config->get_mmc_device_id());
+ }
+
} else if (PARAM_IS ("midi-control")) {
poke_midi_thread ();
diff --git a/libs/midi++2/midi++/mmc.h b/libs/midi++2/midi++/mmc.h
index 2d569f122c..23e07f5151 100644
--- a/libs/midi++2/midi++/mmc.h
+++ b/libs/midi++2/midi++/mmc.h
@@ -93,6 +93,8 @@ class MachineControl : public sigc::trackable
Port &port() { return _port; }
void set_device_id (byte id);
+ byte device_id () const { return _device_id; }
+
static bool is_mmc (byte *sysex_buf, size_t len);
/* Signals to connect to if you want to run "callbacks"
diff --git a/libs/midi++2/midiparser.cc b/libs/midi++2/midiparser.cc
index 424bfa04f8..782c3a8239 100644
--- a/libs/midi++2/midiparser.cc
+++ b/libs/midi++2/midiparser.cc
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <string>
#include <iostream>
+#include <iterator>
#include <midi++/types.h>
#include <midi++/parser.h>
@@ -138,7 +139,6 @@ Parser::~Parser ()
void
Parser::trace_event (Parser &p, byte *msg, size_t len)
-
{
eventType type;
ostream *o;
@@ -309,15 +309,13 @@ Parser::trace_event (Parser &p, byte *msg, size_t len)
void
Parser::trace (bool onoff, ostream *o, const string &prefix)
-
{
trace_connection.disconnect ();
if (onoff) {
trace_stream = o;
trace_prefix = prefix;
- trace_connection = any.connect
- (mem_fun (*this, &Parser::trace_event));
+ trace_connection = any.connect (mem_fun (*this, &Parser::trace_event));
} else {
trace_prefix = "";
trace_stream = 0;
diff --git a/libs/midi++2/mmc.cc b/libs/midi++2/mmc.cc
index 61c47e856f..28d6393fb4 100644
--- a/libs/midi++2/mmc.cc
+++ b/libs/midi++2/mmc.cc
@@ -202,7 +202,7 @@ MachineControl::MachineControl (Port &p, float version,
build_mmc_cmd_map ();
- _device_id = 1;
+ _device_id = 0;
if ((parser = _port.input()) != 0) {
parser->mmc.connect
@@ -258,7 +258,7 @@ MachineControl::process_mmc_message (Parser &p, byte *msg, size_t len)
*/
#if 0
- cerr << "*** MMC message: len = " << len << "\n\t";
+ cerr << "*** me = " << (int) _device_id << " MMC message: len = " << len << "\n\t";
for (size_t i = 0; i < len; i++) {
cerr << hex << (int) msg[i] << dec << ' ';
}
diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc
index 049ad0aa21..00638e6c06 100644
--- a/libs/pbd/controllable.cc
+++ b/libs/pbd/controllable.cc
@@ -10,9 +10,64 @@ sigc::signal<void,Controllable*> Controllable::Destroyed;
sigc::signal<bool,Controllable*> Controllable::StartLearning;
sigc::signal<void,Controllable*> Controllable::StopLearning;
+Glib::Mutex* Controllable::registry_lock = 0;
+Controllable::Controllables Controllable::registry;
+
Controllable::Controllable (std::string name)
: _name (name)
{
+ if (registry_lock == 0) {
+ registry_lock = new Glib::Mutex;
+ }
+
+ add ();
+}
+
+void
+Controllable::add ()
+{
+ Glib::Mutex::Lock lm (*registry_lock);
+ registry.insert (this);
+ this->GoingAway.connect (mem_fun (this, &Controllable::remove));
+}
+
+void
+Controllable::remove ()
+{
+ Glib::Mutex::Lock lm (*registry_lock);
+ for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
+ if ((*i) == this) {
+ registry.erase (i);
+ break;
+ }
+ }
+}
+
+Controllable*
+Controllable::by_id (const ID& id)
+{
+ Glib::Mutex::Lock lm (*registry_lock);
+
+ for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
+ if ((*i)->id() == id) {
+ return (*i);
+ }
+ }
+ return 0;
+}
+
+
+Controllable*
+Controllable::by_name (const std::string& str)
+{
+ Glib::Mutex::Lock lm (*registry_lock);
+
+ for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
+ if ((*i)->_name == str) {
+ return (*i);
+ }
+ }
+ return 0;
}
XMLNode&
diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h
index c88eb298bc..c152013c66 100644
--- a/libs/pbd/pbd/controllable.h
+++ b/libs/pbd/pbd/controllable.h
@@ -2,6 +2,7 @@
#define __pbd_controllable_h__
#include <string>
+#include <set>
#include <sigc++/trackable.h>
#include <sigc++/signal.h>
@@ -36,8 +37,18 @@ class Controllable : public PBD::StatefulDestructible {
std::string name() const { return _name; }
+ static Controllable* by_id (const PBD::ID&);
+ static Controllable* by_name (const std::string&);
+
private:
std::string _name;
+
+ void add ();
+ void remove ();
+
+ typedef std::set<PBD::Controllable*> Controllables;
+ static Glib::Mutex* registry_lock;
+ static Controllables registry;
};
}
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index e81a45b47a..2289bc0726 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -171,6 +171,8 @@ void
GenericMidiControlProtocol::stop_learning (Controllable* c)
{
Glib::Mutex::Lock lm (pending_lock);
+ Glib::Mutex::Lock lm2 (controllables_lock);
+ MIDIControllable* dptr = 0;
/* learning timed out, and we've been told to consider this attempt to learn to be cancelled. find the
relevant MIDIControllable and remove it from the pending list.
@@ -179,11 +181,22 @@ GenericMidiControlProtocol::stop_learning (Controllable* c)
for (MIDIControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) {
if (&(*i)->get_controllable() == c) {
(*i)->stop_learning ();
- delete (*i);
+ dptr = *i;
pending_controllables.erase (i);
break;
}
}
+
+ for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ++i) {
+ if (&(*i)->get_controllable() == c) {
+ controllables.erase (i);
+ break;
+ }
+ }
+
+ if (dptr) {
+ delete dptr;
+ }
}
XMLNode&
@@ -255,7 +268,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node)
ID id = prop->value ();
- c = session->controllable_by_id (id);
+ c = Controllable::by_id (id);
if (c) {
MIDIControllable* mc = new MIDIControllable (*_port, *c);
@@ -264,8 +277,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node)
}
} else {
- warning << string_compose (_("Generic MIDI control: controllable %1 not found in session (ignored)"),
- id)
+ warning << string_compose (_("Generic MIDI control: controllable %1 not found (ignored)"), id)
<< endmsg;
}
}
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index 4763915854..2535c19044 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -1160,7 +1160,7 @@ void MackieControlProtocol::notify_remote_id_changed()
if ( sorted.size() - _current_initial_bank < route_signals.size() )
{
// but don't shift backwards past the zeroth channel
- switch_banks( max( (unsigned int)0, sorted.size() - route_signals.size() ) );
+ switch_banks( max(0UL, sorted.size() - route_signals.size() ) );
}
// Otherwise just refresh the current bank
else