diff options
author | Robin Gareus <robin@gareus.org> | 2019-03-23 01:28:23 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-03-23 01:28:23 +0100 |
commit | 9a1c22d7e15b428868024df6883bcaf38a16b874 (patch) | |
tree | 50d7cf18b6d5bd4382eed59a4906e7eb4e4f8b54 /libs/surfaces/generic_midi | |
parent | 430e51065cbae15ec67ddf78c3b44785d4fd3a9b (diff) |
Remove unusued API Create/Delete Binding
Diffstat (limited to 'libs/surfaces/generic_midi')
-rw-r--r-- | libs/surfaces/generic_midi/generic_midi_control_protocol.cc | 61 | ||||
-rw-r--r-- | libs/surfaces/generic_midi/generic_midi_control_protocol.h | 3 |
2 files changed, 0 insertions, 64 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index 214c9fede7..931ef5aff2 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -108,8 +108,6 @@ GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s) Controllable::StartLearning.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::start_learning, this, _1)); Controllable::StopLearning.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::stop_learning, this, _1)); - Controllable::CreateBinding.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::create_binding, this, _1, _2, _3)); - Controllable::DeleteBinding.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::delete_binding, this, _1)); /* this signal is emitted by the process() callback, and if * send_feedback() is going to do anything, it should do it in the @@ -469,64 +467,6 @@ GenericMidiControlProtocol::stop_learning (Controllable* c) } void -GenericMidiControlProtocol::delete_binding (PBD::Controllable* control) -{ - if (control != 0) { - Glib::Threads::Mutex::Lock lm2 (controllables_lock); - - for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) { - MIDIControllable* existingBinding = (*iter); - - if (control == (existingBinding->get_controllable())) { - delete existingBinding; - iter = controllables.erase (iter); - } else { - ++iter; - } - - } - } -} - -// This next function seems unused -void -GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos, int control_number) -{ - if (control != NULL) { - Glib::Threads::Mutex::Lock lm2 (controllables_lock); - - MIDI::channel_t channel = (pos & 0xf); - MIDI::byte value = control_number; - - // Create a MIDIControllable - MIDIControllable* mc = new MIDIControllable (this, *_input_port->parser(), *control, false); - - // Remove any old binding for this midi channel/type/value pair - // Note: can't use delete_binding() here because we don't know the specific controllable we want to remove, only the midi information - for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) { - MIDIControllable* existingBinding = (*iter); - - if ((existingBinding->get_control_channel() & 0xf ) == channel && - existingBinding->get_control_additional() == value && - (existingBinding->get_control_type() & 0xf0 ) == MIDI::controller) { - - delete existingBinding; - iter = controllables.erase (iter); - } else { - ++iter; - } - - } - - // Update the MIDI Controllable based on the the pos param - // Here is where a table lookup for user mappings could go; for now we'll just wing it... - mc->bind_midi(channel, MIDI::controller, value); - DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Create binding: Channel: %1 Controller: %2 Value: %3 \n", channel, MIDI::controller, value)); - controllables.push_back (mc); - } -} - -void GenericMidiControlProtocol::check_used_event (int pos, int control_number) { Glib::Threads::Mutex::Lock lm2 (controllables_lock); @@ -537,7 +477,6 @@ GenericMidiControlProtocol::check_used_event (int pos, int control_number) DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("checking for used event: Channel: %1 Controller: %2 value: %3\n", (int) channel, (pos & 0xf0), (int) value)); // Remove any old binding for this midi channel/type/value pair - // Note: can't use delete_binding() here because we don't know the specific controllable we want to remove, only the midi information for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) { MIDIControllable* existingBinding = (*iter); if ( (existingBinding->get_control_type() & 0xf0 ) == (pos & 0xf0) && (existingBinding->get_control_channel() & 0xf ) == channel ) { diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h index da4bb619a3..48e7f12961 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h @@ -152,9 +152,6 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol { void learning_stopped (MIDIControllable*); - void create_binding (PBD::Controllable*, int, int); - void delete_binding (PBD::Controllable*); - MIDIControllable* create_binding (const XMLNode&); MIDIFunction* create_function (const XMLNode&); MIDIAction* create_action (const XMLNode&); |