wip: trying to add run/cucumber.
authorCarl Hetherington <cth@carlh.net>
Sun, 5 Jul 2020 19:04:04 +0000 (21:04 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 24 Nov 2023 20:59:45 +0000 (21:59 +0100)
features/step_definitions/dcpomatic.cc
run/cucumber [new file with mode: 0755]
src/tools/dcpomatic.cc
src/wx/content_panel.cc
src/wx/film_editor.cc
src/wx/film_editor.h
wscript

index 87ff58a686b7ea58602276cd4ac447243f2cf8af..517e87a7fdf1ba2309f0ab05a45ee20d9bd4b4b6 100644 (file)
@@ -92,7 +92,7 @@ private:
 
        std::string receive ()
        {
-               return _nanomsg->receive(-1).get();
+               return _nanomsg->receive(-1).get_value_or("");
        }
 
        void general_delay ()
diff --git a/run/cucumber b/run/cucumber
new file mode 100755 (executable)
index 0000000..7b907e1
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export LD_LIBRARY_PATH=build/src/lib:build/src/wx:$LD_LIBRARY_PATH
+
+build/features/dcpomatic_cucumber &
+sleep 5
+cucumber .
+
index ade19c1bb527d2593692e0fd43a4d81aca11d311..7cc77d1fe954e647f738f3696a36e8d758345680 100644 (file)
 
 #include "wx/about_dialog.h"
 #include "wx/content_panel.h"
-#include "wx/dkdm_dialog.h"
-#include "wx/export_subtitles_dialog.h"
-#include "wx/export_video_file_dialog.h"
 #ifdef DCPOMATIC_CUCUMBER
 #include "wx/cucumber_bridge.h"
 #include "wx/cucumber_registry.h"
 #endif
-#include "wx/standard_controls.h"
-#include "wx/film_viewer.h"
+#include "wx/dkdm_dialog.h"
+#include "wx/export_subtitles_dialog.h"
+#include "wx/export_video_file_dialog.h"
 #include "wx/film_editor.h"
 #include "wx/film_name_location_dialog.h"
 #include "wx/film_viewer.h"
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;
 }
index ad51ff9303292d82e2f637fcfb2f373809ebbce3..cde6d40d3042768d813597db55e073cbccdfea61 100644 (file)
@@ -170,6 +170,8 @@ FilmEditor::first_shown ()
 }
 
 
+#ifdef DCPOMATIC_CUCUMBER
+void
 FilmEditor::cucumber_add_content_file (string filename)
 {
        _content_panel->cucumber_add_content_file (filename);
@@ -182,4 +184,4 @@ FilmEditor::cucumber_get_content_list ()
 {
        return _content_panel->cucumber_get_content_list ();
 }
-
+#endif
index 7f59d02c151b7ae0add3e07fd31eae9824303947..daaeac2ae5c308f6be881fd201fa596d0f56ee62 100644 (file)
@@ -65,6 +65,7 @@ public:
 private:
 
 #ifdef DCPOMATIC_CUCUMBER
+       friend class DOMFrame;
        void cucumber_add_content_file (std::string filename);
        std::string cucumber_get_content_list ();
 #endif
diff --git a/wscript b/wscript
index f9f79bc726828010f55f978a0e1ba08be4885dc8..fd415cfcaf5f44ad5702e62d2b4d7d6ab9348ed6 100644 (file)
--- a/wscript
+++ b/wscript
@@ -99,11 +99,9 @@ def configure(conf):
     conf.env.ENABLE_DISK = conf.options.enable_disk
     if conf.options.destdir == '':
         conf.env.INSTALL_PREFIX = conf.options.prefix
-    conf.env.ENABLE_CUCUMBER = conf.options.enable_cucumber
-    if conf.options.install_prefix is None:
-        conf.env.INSTALL_PREFIX = conf.env.PREFIX
     else:
         conf.env.INSTALL_PREFIX = conf.options.destdir
+    conf.env.ENABLE_CUCUMBER = conf.options.enable_cucumber
 
     # Common CXXFLAGS
     conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS',