summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_patch_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/midi_patch_manager.cc')
-rw-r--r--libs/ardour/midi_patch_manager.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/midi_patch_manager.cc b/libs/ardour/midi_patch_manager.cc
index ab66949326..e0638f035e 100644
--- a/libs/ardour/midi_patch_manager.cc
+++ b/libs/ardour/midi_patch_manager.cc
@@ -87,6 +87,12 @@ MidiPatchManager::add_session_patches ()
// build a list of all master devices from all documents
_master_devices_by_model[device->first] = device->second;
_all_models.insert(device->first);
+ const std::string& manufacturer = device->second->manufacturer();
+ if (_devices_by_manufacturer.find(manufacturer) == _devices_by_manufacturer.end()) {
+ MIDINameDocument::MasterDeviceNamesList empty;
+ _devices_by_manufacturer.insert(std::make_pair(manufacturer, empty));
+ }
+ _devices_by_manufacturer[manufacturer].insert(std::make_pair(device->first, device->second));
// make sure there are no double model names
// TODO: handle this gracefully.
@@ -102,6 +108,7 @@ MidiPatchManager::refresh()
_documents.clear();
_master_devices_by_model.clear();
_all_models.clear();
+ _devices_by_manufacturer.clear();
Searchpath search_path = midi_patch_search_path ();
vector<std::string> result;
@@ -133,6 +140,12 @@ MidiPatchManager::refresh()
_master_devices_by_model[device->first] = device->second;
_all_models.insert(device->first);
+ const std::string& manufacturer = device->second->manufacturer();
+ if (_devices_by_manufacturer.find(manufacturer) == _devices_by_manufacturer.end()) {
+ MIDINameDocument::MasterDeviceNamesList empty;
+ _devices_by_manufacturer.insert(std::make_pair(manufacturer, empty));
+ }
+ _devices_by_manufacturer[manufacturer].insert(std::make_pair(device->first, device->second));
}
}
@@ -148,4 +161,5 @@ MidiPatchManager::session_going_away ()
_documents.clear();
_master_devices_by_model.clear();
_all_models.clear();
+ _devices_by_manufacturer.clear();
}