Add an API to reset export-handler configs.
authorRobin Gareus <robin@gareus.org>
Wed, 25 Jul 2018 16:19:19 +0000 (18:19 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 25 Jul 2018 16:19:19 +0000 (18:19 +0200)
config_map.erase() is only called in ExportHandler::finish_timespan().

When an export fails (throw) or is aborted, the export-handler's
config remains as is and the next export will run it again.

The export-handler is global, per session and
ExportHandler::add_export_config() only ever inserts or ignores insert.

This is in preparation to fix:
1) export to invalid path -> fail, error is thrown
2) correct path -> new config is inserted in the map
3) try to export again, first runs the not-completed export from (1)
  -> constant errors.

libs/ardour/ardour/export_handler.h
libs/ardour/export_handler.cc

index 352451c4a30dccb39c565267c9d600d54d2388d1..d9d268af014c96515f66c15eff862e2036381805 100644 (file)
@@ -124,6 +124,8 @@ class LIBARDOUR_API ExportHandler : public ExportElementFactory, public sigc::tr
        bool soundcloud_open_page;
        bool soundcloud_downloadable;
 
+       void reset ();
+
   private:
 
        void handle_duplicate_format_extensions();
index df74bda06532720cd16a7436264f4ff3d887ce02..3cad72c8d9905aa35c4781a3aabe88891d2339a4 100644 (file)
@@ -465,6 +465,13 @@ ExportHandler::finish_timespan ()
        start_timespan ();
 }
 
+void
+ExportHandler::reset ()
+{
+       config_map.clear ();
+       graph_builder->reset ();
+}
+
 /*** CD Marker stuff ***/
 
 struct LocationSortByStart {