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/instrument_info.h | |
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/instrument_info.h')
-rw-r--r-- | libs/ardour/ardour/instrument_info.h | 59 |
1 files changed, 33 insertions, 26 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__ */ |