summaryrefslogtreecommitdiff
path: root/libs/ardour/export_profile_manager.cc
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2008-10-16 15:13:23 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2008-10-16 15:13:23 +0000
commit063ab23465759839eb723c20664cbfe388701fda (patch)
tree26f833ed6fb7f36ea6b9430cc7a244811d5d7ccb /libs/ardour/export_profile_manager.cc
parent5fa6ed1966d68b10041d7c563ef214ef33be0e88 (diff)
Handle export presets from config dirs properly. Removed some debug output.
git-svn-id: svn://localhost/ardour2/branches/3.0@3977 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_profile_manager.cc')
-rw-r--r--libs/ardour/export_profile_manager.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc
index b5d85fcfa2..600ce9e3ea 100644
--- a/libs/ardour/export_profile_manager.cc
+++ b/libs/ardour/export_profile_manager.cc
@@ -67,8 +67,6 @@ ExportProfileManager::ExportProfileManager (Session & s) :
search_path += ardour_search_path().add_subdirectory_to_paths("export");
search_path += system_config_search_path().add_subdirectory_to_paths("export");;
- std::cout << "search_path: " << search_path.to_string () << std::endl;
-
/* create export config directory if necessary */
if (!sys::exists (export_config_dir)) {
@@ -163,8 +161,9 @@ ExportProfileManager::load_presets ()
ExportProfileManager::PresetPtr
ExportProfileManager::save_preset (string const & name)
{
+ string filename = export_config_dir.to_string() + "/" + name + export_preset_suffix;
+
if (!current_preset) {
- string filename = export_config_dir.to_string() + "/" + name + export_preset_suffix;
current_preset.reset (new ExportPreset (filename, session));
preset_list.push_back (current_preset);
}
@@ -179,7 +178,7 @@ ExportProfileManager::save_preset (string const & name)
current_preset->set_global_state (*global_preset);
current_preset->set_local_state (*local_preset);
- current_preset->save();
+ current_preset->save (filename);
return current_preset;
}
@@ -210,12 +209,13 @@ void
ExportProfileManager::load_preset_from_disk (PBD::sys::path const & path)
{
PresetPtr preset (new ExportPreset (path.to_string(), session));
- preset_list.push_back (preset);
- /* Handle id to filename mapping */
+ /* Handle id to filename mapping and don't add duplicates to list */
FilePair pair (preset->id(), path);
- preset_file_map.insert (pair);
+ if (preset_file_map.insert (pair).second) {
+ preset_list.push_back (preset);
+ }
}
bool