summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-02-20 21:26:20 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-02-20 21:26:20 +0000
commit326cd24c12d8b11402ef0c10507ecbdea8f86d7f (patch)
tree315d307f6f14439651b75be5206437970ad50c0f /libs/surfaces
parent780e9d7ecb224a4f95de06d4af2d3795565bcec0 (diff)
make MMC work again, make tracing MIDI input work again, add GUI control for MMC device ID ++
git-svn-id: svn://localhost/ardour2/trunk@1480 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc20
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc2
2 files changed, 17 insertions, 5 deletions
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