Use a std::set for MIDI device models so the combo is sorted and the user can find...
authorDavid Robillard <d@drobilla.net>
Sat, 19 Jan 2013 19:25:06 +0000 (19:25 +0000)
committerDavid Robillard <d@drobilla.net>
Sat, 19 Jan 2013 19:25:06 +0000 (19:25 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13902 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/midi_patch_manager.cc
libs/midi++2/midi++/midnam_patch.h
libs/midi++2/midnam_patch.cc

index ac57ae93c69d799a0be53dea910e7d08b010b232..717f290944c4bcde20c6764588979acf98cae053 100644 (file)
@@ -83,7 +83,7 @@ MidiPatchManager::add_session_patches ()
                        _documents[device->first] = document;
                        // build a list of all master devices from all documents
                        _master_devices_by_model[device->first] = device->second;
-                       _all_models.push_back(device->first);
+                       _all_models.insert(device->first);
 
                        // make sure there are no double model names
                        // TODO: handle this gracefully.
@@ -119,7 +119,7 @@ MidiPatchManager::refresh()
                        _documents[device->first] = document;
                        // build a list of all master devices from all documents
                        _master_devices_by_model[device->first] = device->second;
-                       _all_models.push_back(device->first);
+                       _all_models.insert(device->first);
 
                        // make sure there are no double model names
                        // TODO: handle this gracefully.
index a759e503dd795fd5088cbacb33263a20d5fc2151..e218eeeeddbd896019db54e0b9c175ab1e408a4f 100644 (file)
@@ -333,7 +333,7 @@ private:
 class MasterDeviceNames
 {
 public:
-       typedef std::list<std::string>                                       Models;
+       typedef std::set<std::string>                                        Models;
        /// maps name to CustomDeviceMode
        typedef std::map<std::string, boost::shared_ptr<CustomDeviceMode> >  CustomDeviceModes;
        typedef std::list<std::string>                                       CustomDeviceModeNames;
index 3509d1e021ed8efd479aee15784f95cd177a8c10..82fc579d1a6026b8ed5b3a969c9b1bdd03aa6560 100644 (file)
@@ -490,7 +490,7 @@ MasterDeviceNames::set_state(const XMLTree& tree, const XMLNode&)
                assert(contents.size() == 1);
                XMLNode * content = *(contents.begin());
                assert(content->is_content());
-               _models.push_back(content->content());
+               _models.insert(content->content());
        }
 
        // CustomDeviceModes
@@ -634,7 +634,7 @@ MIDINameDocument::set_state (const XMLTree& tree, const XMLNode&)
                                std::pair<std::string, boost::shared_ptr<MasterDeviceNames> >
                                (*model,      master_device_names));
                        
-                       _all_models.push_back(*model);
+                       _all_models.insert(*model);
                }
        }