Allow to revert export-format from disk
[ardour.git] / libs / ardour / export_profile_manager.cc
index 14c57436ab4b51d56dd8be99cf255f1f7abe3f48..877b4343774e825555e20991b196f539019a7e98 100644 (file)
@@ -661,6 +661,23 @@ ExportProfileManager::remove_format_profile (ExportFormatSpecPtr format)
        FormatListChanged ();
 }
 
+void
+ExportProfileManager::revert_format_profile (ExportFormatSpecPtr format)
+{
+       FileMap::iterator it;
+       if ((it = format_file_map.find (format->id())) == format_file_map.end()) {
+               return;
+       }
+
+       XMLTree tree;
+       if (!tree.read (it->second.c_str())) {
+               return;
+       }
+
+       format->set_state (*tree.root());
+       FormatListChanged ();
+}
+
 ExportFormatSpecPtr
 ExportProfileManager::get_new_format (ExportFormatSpecPtr original)
 {