diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-01 06:53:26 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-01 16:31:58 +0200 |
commit | 3b77472ac0634f77a938c34c60e2b66804eee94c (patch) | |
tree | 350dc179be1d089d846f5608c43c490b51cd7407 /libs/ardour/ardour | |
parent | 26c6d3c4c9d8d02aee3c58004b7b616b66630d22 (diff) |
Overhaul InstrumentInfo
* Remove unused direct calls into plugin
* Assume empty model to mean plugin-provided MIDNAM (!)
The route owned Instrument-Info is the central access point used
by the GUI for MIDI name lookups.
At this point in time, custom settings are saved/restored by the
GUI (MidiTimeAxisView). InstrumentInfo provides a volatile store
for MIDNAM mode and model.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/instrument_info.h | 59 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin.h | 20 |
2 files changed, 33 insertions, 46 deletions
diff --git a/libs/ardour/ardour/instrument_info.h b/libs/ardour/ardour/instrument_info.h index 59ff34fc3a..6799c8a0fa 100644 --- a/libs/ardour/ardour/instrument_info.h +++ b/libs/ardour/ardour/instrument_info.h @@ -19,8 +19,8 @@ #ifndef __ardour_instrument_info_h__ #define __ardour_instrument_info_h__ -#include <string> #include <stdint.h> +#include <string> #include <boost/weak_ptr.hpp> @@ -28,13 +28,16 @@ #include "evoral/Parameter.h" -#include "midi++/libmidi_visibility.h" #include "ardour/libardour_visibility.h" +#include "midi++/libmidi_visibility.h" namespace MIDI { namespace Name { class ChannelNameSet; class Patch; + class ValueNameList; + class MasterDeviceNames; + class ControlNameList; typedef std::list<boost::shared_ptr<Patch> > PatchNameList; } } @@ -43,40 +46,44 @@ namespace ARDOUR { class Processor; -class LIBARDOUR_API InstrumentInfo { - public: - InstrumentInfo(); - ~InstrumentInfo (); +class LIBARDOUR_API InstrumentInfo +{ +public: + InstrumentInfo (); + ~InstrumentInfo (); - void set_external_instrument (const std::string& model, const std::string& mode); - void set_internal_instrument (boost::shared_ptr<ARDOUR::Processor>); + void set_external_instrument (const std::string& model, const std::string& mode); + void set_internal_instrument (boost::shared_ptr<ARDOUR::Processor>); - std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel) const; - std::string get_patch_name_without (uint16_t bank, uint8_t program, uint8_t channel) const; - std::string get_controller_name (Evoral::Parameter param) const; - std::string get_instrument_name () const; + std::string get_note_name (uint16_t bank, uint8_t program, uint8_t channel, uint8_t note) const; - boost::shared_ptr<MIDI::Name::ChannelNameSet> get_patches (uint8_t channel); + std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel) const; + std::string get_patch_name_without (uint16_t bank, uint8_t program, uint8_t channel) const; + std::string get_controller_name (Evoral::Parameter param) const; - PBD::Signal0<void> Changed; + boost::shared_ptr<MIDI::Name::MasterDeviceNames> master_device_names () const; - static const MIDI::Name::PatchNameList& general_midi_patches(); + boost::shared_ptr<MIDI::Name::ChannelNameSet> get_patches (uint8_t channel); + boost::shared_ptr<MIDI::Name::ControlNameList> control_name_list (uint8_t channel); - private: - std::string external_instrument_model; - std::string external_instrument_mode; + boost::shared_ptr<const MIDI::Name::ValueNameList> value_name_list_by_control (uint8_t channel, uint8_t number) const; - boost::weak_ptr<ARDOUR::Processor> internal_instrument; + PBD::Signal0<void> Changed; - 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; + bool have_custom_plugin_info () 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; -}; +private: + std::string model () const; + std::string mode () const; -} /* namespace ARDOUR */ + std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel, bool with_extra) const; + std::string external_instrument_model; + std::string external_instrument_mode; + + boost::weak_ptr<ARDOUR::Processor> internal_instrument; +}; + +} #endif /* __ardour_instrument_info_h__ */ diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h index cdcc313578..7ffbc1fdf9 100644 --- a/libs/ardour/ardour/plugin.h +++ b/libs/ardour/ardour/plugin.h @@ -250,26 +250,6 @@ public: std::vector<PresetRecord> get_presets (); - /** @return true if this plugin will respond to MIDI program - * change messages by changing presets. - * - * This is hard to return a correct value for because most plugin APIs - * do not specify plugin behaviour. However, if you want to force - * the display of plugin built-in preset names rather than MIDI program - * numbers, return true. If you want a generic description, return - * false. - */ - virtual bool presets_are_MIDI_programs () const { return false; } - - /** @return true if this plugin is General MIDI compliant, false - * otherwise. - * - * It is important to note that it is is almost impossible for a host - * (e.g. Ardour) to determine this for just about any plugin API - * known as of June 2012 - */ - virtual bool current_preset_uses_general_midi () const { return false; } - /** @return Last preset to be requested; the settings may have * been changed since; find out with parameter_changed_since_last_preset. */ |