Remove ifstream / ofstream when accessing session template files (or creating a new...
[ardour.git] / libs / ardour / ardour / midi_patch_manager.h
index cd898aa00f7de543aabab45c49165abca31ba5f8..5ed648b3e7d52d10da48d42070ef9861d8af923d 100644 (file)
@@ -46,7 +46,8 @@ private:
        static MidiPatchManager* _manager;
 
 public:
-       typedef std::map<std::string, boost::shared_ptr<MIDINameDocument> > MidiNameDocuments;
+       typedef std::map<std::string, boost::shared_ptr<MIDINameDocument> >    MidiNameDocuments;
+       typedef std::map<std::string, MIDINameDocument::MasterDeviceNamesList> DeviceNamesByMaker;
 
        virtual ~MidiPatchManager() { _manager = 0; }
 
@@ -125,14 +126,17 @@ public:
 
        std::list<std::string> custom_device_mode_names_by_model(std::string model_name) {
                if (model_name != "") {
-                       return master_device_by_model(model_name)->custom_device_mode_names();
-               } else {
-                       return std::list<std::string>();
+                       if (master_device_by_model(model_name)) {
+                               return master_device_by_model(model_name)->custom_device_mode_names();
+                       }
                }
+               return std::list<std::string>();
        }
 
        const MasterDeviceNames::Models& all_models() const { return _all_models; }
 
+       const DeviceNamesByMaker& devices_by_manufacturer() const { return _devices_by_manufacturer; }
+
 private:
        void session_going_away();
        void refresh();
@@ -140,6 +144,7 @@ private:
 
        MidiNameDocuments                       _documents;
        MIDINameDocument::MasterDeviceNamesList _master_devices_by_model;
+       DeviceNamesByMaker                      _devices_by_manufacturer;
        MasterDeviceNames::Models               _all_models;
 };