diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2018-06-21 13:05:37 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2018-06-21 13:05:58 -0400 |
commit | 8a18929d57ef82b1233278668a9efe78fe1c17f0 (patch) | |
tree | 41dd4f8bb487f6a570987c04c7601dae9ca3edf9 /libs/surfaces/generic_midi/midicontrollable.cc | |
parent | 637e70749cf32331df4d09b56f3c819f42f8097e (diff) |
remove Session::controllable_by_descriptor() and move code into GenericMIDI code (the only user).
This also removes enums introduced to describe well-known parameters for Mixbus. Lookup now involves string
parsing every time, but this is not likely to be a notable cost.
Diffstat (limited to 'libs/surfaces/generic_midi/midicontrollable.cc')
-rw-r--r-- | libs/surfaces/generic_midi/midicontrollable.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index fe592965ee..13b47a4d7c 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -34,7 +34,6 @@ #include "ardour/async_midi_port.h" #include "ardour/automation_control.h" -#include "ardour/controllable_descriptor.h" #include "ardour/midi_ui.h" #include "ardour/debug.h" @@ -49,7 +48,6 @@ using namespace ARDOUR; MIDIControllable::MIDIControllable (GenericMidiControlProtocol* s, MIDI::Parser& p, bool m) : _surface (s) , controllable (0) - , _descriptor (0) , _parser (p) , _momentary (m) { @@ -68,7 +66,6 @@ MIDIControllable::MIDIControllable (GenericMidiControlProtocol* s, MIDI::Parser& MIDIControllable::MIDIControllable (GenericMidiControlProtocol* s, MIDI::Parser& p, Controllable& c, bool m) : _surface (s) - , _descriptor (0) , _parser (p) , _momentary (m) { @@ -90,17 +87,13 @@ MIDIControllable::MIDIControllable (GenericMidiControlProtocol* s, MIDI::Parser& MIDIControllable::~MIDIControllable () { drop_external_control (); - delete _descriptor; - _descriptor = 0; } int MIDIControllable::init (const std::string& s) { _current_uri = s; - delete _descriptor; - _descriptor = new ControllableDescriptor; - return _descriptor->set (s); + return 0; } void @@ -250,11 +243,11 @@ MIDIControllable::midi_sense_note_off (Parser &p, EventTwoBytes *tb) int MIDIControllable::lookup_controllable() { - if (!_descriptor) { + if (_current_uri.empty()) { return -1; } - boost::shared_ptr<Controllable> c = _surface->lookup_controllable (*_descriptor); + boost::shared_ptr<Controllable> c = _surface->lookup_controllable (_current_uri); if (!c) { return -1; |