21 #ifndef MIDI_PATCH_MANAGER_H_
22 #define MIDI_PATCH_MANAGER_H_
24 #include "midi++/midnam_patch.h"
64 {
return _documents[model_name]; }
67 {
return _master_devices_by_model[model_name]; }
71 std::string custom_device_mode,
75 if (master_device != 0 && custom_device_mode !=
"") {
76 return master_device->channel_name_set_by_channel(custom_device_mode, channel);
84 std::string custom_device_mode,
86 PatchPrimaryKey patch_key) {
90 if (channel_name_set) {
91 return channel_name_set->find_patch(patch_key);
99 std::string custom_device_mode,
101 PatchPrimaryKey patch_key) {
105 if (channel_name_set) {
106 return channel_name_set->previous_patch(patch_key);
114 std::string custom_device_mode,
116 PatchPrimaryKey patch_key) {
120 if (channel_name_set) {
121 return channel_name_set->next_patch(patch_key);
128 if (model_name !=
"") {
129 if (master_device_by_model(model_name)) {
130 return master_device_by_model(model_name)->custom_device_mode_names();
133 return std::list<std::string>();
136 const MasterDeviceNames::Models&
all_models()
const {
return _all_models; }
141 void session_going_away();
143 void add_session_patches();
virtual ~MidiPatchManager()
MasterDeviceNames::Models _all_models
std::list< std::string > custom_device_mode_names_by_model(std::string model_name)
boost::shared_ptr< Patch > next_patch(std::string model, std::string custom_device_mode, uint8_t channel, PatchPrimaryKey patch_key)
static MidiPatchManager * _manager
std::map< std::string, MIDINameDocument::MasterDeviceNamesList > DeviceNamesByMaker
MIDINameDocument::MasterDeviceNamesList _master_devices_by_model
boost::shared_ptr< MasterDeviceNames > master_device_by_model(std::string model_name)
DeviceNamesByMaker _devices_by_manufacturer
const MasterDeviceNames::Models & all_models() const
boost::shared_ptr< Patch > find_patch(std::string model, std::string custom_device_mode, uint8_t channel, PatchPrimaryKey patch_key)
boost::shared_ptr< ChannelNameSet > find_channel_name_set(std::string model, std::string custom_device_mode, uint8_t channel)
MidiNameDocuments _documents
std::map< std::string, boost::shared_ptr< MIDINameDocument > > MidiNameDocuments
boost::shared_ptr< MIDINameDocument > document_by_model(std::string model_name)
static MidiPatchManager & instance()
boost::shared_ptr< Patch > previous_patch(std::string model, std::string custom_device_mode, uint8_t channel, PatchPrimaryKey patch_key)
const DeviceNamesByMaker & devices_by_manufacturer() const