wip: trying to add run/cucumber.
[dcpomatic.git] / src / wx / content_panel.cc
index 07d2e142acfe456363ef33a16643e246f6fca84a..bfbaf7fe292a8b90e393eb845e76bfbfafddbba0 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "audio_panel.h"
 #include "content_panel.h"
-#include "content_panel.h"
 #include "cucumber_bridge.h"
 #include "cucumber_registry.h"
 #include "dcpomatic_button.h"
@@ -33,8 +32,6 @@
 #include "timeline_dialog.h"
 #include "timing_panel.h"
 #include "video_panel.h"
-#include "video_panel.h"
-#include "wx_util.h"
 #include "wx_util.h"
 #include "lib/audio_content.h"
 #include "lib/case_insensitive_sorter.h"
@@ -50,6 +47,7 @@
 #include "lib/film.h"
 #include "lib/film_util.h"
 #include "lib/image_content.h"
+#include "lib/job_manager.h"
 #include "lib/log.h"
 #include "lib/playlist.h"
 #include "lib/scope_guard.h"
@@ -1023,9 +1021,13 @@ ContentPanel::window() const
 void
 ContentPanel::cucumber_add_content_file (string filename)
 {
-       list<boost::filesystem::path> path_list;
-       path_list.push_back (filename);
-       add_files (path_list);
+       add_files ({filename});
+       auto jm = JobManager::instance ();
+       while (jm->work_to_do()) {
+               while (signal_manager->ui_idle()) {}
+               dcpomatic_sleep_seconds (1);
+       }
+       while (signal_manager->ui_idle()) {}
 }
 
 
@@ -1035,9 +1037,9 @@ ContentPanel::cucumber_get_content_list ()
 {
        /* The playlist method that we end up calling has a mutex, so this should be ok */
        std::string s;
-       BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+       for (auto content: _film->content()) {
                bool alert;
-               s += wx_to_std (text_for_content(i, alert)) + "\n";
+               s += wx_to_std (text_for_content(content, alert)) + "\n";
        }
        return s;
 }