diff options
author | Robin Gareus <robin@gareus.org> | 2018-11-21 23:14:52 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-11-21 23:14:52 +0100 |
commit | 9326ced760315986fbce617bece607d75985e027 (patch) | |
tree | 44334b59d8da0c9f90ef5507dd44c8b0bd38c848 /libs/ardour/export_profile_manager.cc | |
parent | 3d366053e2719ca0f129c16575ce481fcd214f61 (diff) |
Allow to revert export-format from disk
This allows to restore ProfileManager's ExportFormatSpec without
re-instantiating the ProfileManager.
Diffstat (limited to 'libs/ardour/export_profile_manager.cc')
-rw-r--r-- | libs/ardour/export_profile_manager.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc index 14c57436ab..877b434377 100644 --- a/libs/ardour/export_profile_manager.cc +++ b/libs/ardour/export_profile_manager.cc @@ -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) { |