export_config_dir = user_config_directory();
export_config_dir /= "export";
- search_path += export_config_dir;
-
- search_path += ardour_search_path().add_subdirectory_to_paths("export");
- sys::path sys_export = ardour_module_directory();
- sys_export /= "export";
-
- search_path += sys_export;
+ search_path += export_config_dir;
+ search_path += system_data_search_path().add_subdirectory_to_paths("export");
info << string_compose (_("Searching for export formats in %1"), search_path.to_string()) << endmsg;
- cerr << string_compose (_("Searching for export formats in %1"), search_path.to_string()) << endl;
/* create export config directory if necessary */
}
}
+std::string
+ExportProfileManager::preset_filename (std::string const & preset_name)
+{
+ string safe_name = legalize_for_path (preset_name);
+ return export_config_dir.to_string() + "/" + safe_name + export_preset_suffix;
+}
+
+ExportProfileManager::PresetPtr
+ExportProfileManager::new_preset (string const & name)
+{
+ // Generate new ID and do regular save
+ string filename = preset_filename (name);
+ current_preset.reset (new ExportPreset (filename, session));
+ preset_list.push_back (current_preset);
+ return save_preset (name);
+}
+
ExportProfileManager::PresetPtr
ExportProfileManager::save_preset (string const & name)
{
- string filename = export_config_dir.to_string() + "/" + name + export_preset_suffix;
+ string filename = preset_filename (name);
if (!current_preset) {
current_preset.reset (new ExportPreset (filename, session));
string new_name = format->name();
new_name += export_format_suffix;
+ /* make sure its legal for the filesystem */
+
+ new_name = legalize_for_path (new_name);
+
sys::path new_path (export_config_dir);
new_path /= new_name;
{
boost::shared_ptr<Warnings> warnings (new Warnings ());
+ assert (!channel_configs.empty ());
+
ChannelConfigStatePtr channel_config_state = channel_configs.front();
TimespanStatePtr timespan_state = timespans.front();