From 2d9a15087bad6dfaeedd259b2fe948627d3b5ffb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 19 Jan 2013 19:25:06 +0000 Subject: [PATCH] Use a std::set for MIDI device models so the combo is sorted and the user can find things. git-svn-id: svn://localhost/ardour2/branches/3.0@13902 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/midi_patch_manager.cc | 4 ++-- libs/midi++2/midi++/midnam_patch.h | 2 +- libs/midi++2/midnam_patch.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/ardour/midi_patch_manager.cc b/libs/ardour/midi_patch_manager.cc index ac57ae93c6..717f290944 100644 --- a/libs/ardour/midi_patch_manager.cc +++ b/libs/ardour/midi_patch_manager.cc @@ -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. diff --git a/libs/midi++2/midi++/midnam_patch.h b/libs/midi++2/midi++/midnam_patch.h index a759e503dd..e218eeeedd 100644 --- a/libs/midi++2/midi++/midnam_patch.h +++ b/libs/midi++2/midi++/midnam_patch.h @@ -333,7 +333,7 @@ private: class MasterDeviceNames { public: - typedef std::list Models; + typedef std::set Models; /// maps name to CustomDeviceMode typedef std::map > CustomDeviceModes; typedef std::list CustomDeviceModeNames; diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc index 3509d1e021..82fc579d1a 100644 --- a/libs/midi++2/midnam_patch.cc +++ b/libs/midi++2/midnam_patch.cc @@ -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 > (*model, master_device_names)); - _all_models.push_back(*model); + _all_models.insert(*model); } } -- 2.30.2