Prepare for the day when MTAV does no longer force-override InstrumentInfo
authorRobin Gareus <robin@gareus.org>
Sat, 29 Oct 2016 17:02:33 +0000 (19:02 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 29 Oct 2016 17:57:43 +0000 (19:57 +0200)
libs/ardour/ardour/instrument_info.h
libs/ardour/instrument_info.cc

index 8e08c8b4b72397203c4ae814074ddaa0c9727f8e..07946333d98cb35db5e23b715f7ef5eccf53a5c3 100644 (file)
@@ -70,6 +70,7 @@ class LIBARDOUR_API InstrumentInfo {
 
     boost::shared_ptr<MIDI::Name::ChannelNameSet> plugin_programs_to_channel_name_set (boost::shared_ptr<Processor> p);
     std::string get_plugin_patch_name (boost::shared_ptr<ARDOUR::Processor>, uint16_t bank, uint8_t program, uint8_t channel) const;
+    std::string get_plugin_controller_name (boost::shared_ptr<ARDOUR::Processor>, Evoral::Parameter) const;
 
     std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel, bool with_extra) const;
     static MIDI::Name::PatchNameList _gm_patches;
index b8c026bd029e2ee0e79f565ea4e1cc361eba164a..2f77d980ba3a369489a5c1957eccc776091047e7 100644 (file)
@@ -124,9 +124,12 @@ string
 InstrumentInfo::get_controller_name (Evoral::Parameter param) const
 {
        boost::shared_ptr<Processor> p = internal_instrument.lock();
-       if (p || param.type() != MidiCCAutomation) {
+       if (param.type() != MidiCCAutomation) {
                return "";
        }
+       if (p) {
+               return get_plugin_controller_name (p, param);
+       }
 
        boost::shared_ptr<MIDI::Name::MasterDeviceNames> dev_names(
                MIDI::Name::MidiPatchManager::instance().master_device_by_model(
@@ -228,6 +231,12 @@ InstrumentInfo::general_midi_patches()
        return _gm_patches;
 }
 
+string
+InstrumentInfo::get_plugin_controller_name (boost::shared_ptr<ARDOUR::Processor>, Evoral::Parameter param) const
+{
+       return "";
+}
+
 string
 InstrumentInfo::get_plugin_patch_name (boost::shared_ptr<Processor> p, uint16_t bank, uint8_t program, uint8_t /*channel*/) const
 {