From 933187a1901a0ea7fb57ebb06928d84eb834fa0a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Jan 2022 10:50:31 +0000 Subject: [PATCH] debug. --- features/step_definitions/dcpomatic.cc | 2 +- run/cucumber | 1 + src/lib/examine_content_job.cc | 2 +- src/lib/film.cc | 8 +++++++- src/lib/job.cc | 2 +- src/tools/dcpomatic.cc | 2 ++ src/wx/content_panel.cc | 12 +++++++++++- src/wx/cucumber_bridge.cc | 6 ++++-- 8 files changed, 28 insertions(+), 7 deletions(-) diff --git a/features/step_definitions/dcpomatic.cc b/features/step_definitions/dcpomatic.cc index 517e87a7f..6fb6a858b 100644 --- a/features/step_definitions/dcpomatic.cc +++ b/features/step_definitions/dcpomatic.cc @@ -124,7 +124,7 @@ WHEN("^I add file (.+) as content$") { THEN("^the result should be only (.+) in the content list$") { REGEX_PARAM(string, entry); ScenarioScope context; - vector content = context->content_list (); + auto content = context->content_list (); BOOST_CHECK_EQUAL (content.size(), 1); BOOST_CHECK_EQUAL (content.front(), entry); } diff --git a/run/cucumber b/run/cucumber index 7b907e171..5ea67799a 100755 --- a/run/cucumber +++ b/run/cucumber @@ -1,6 +1,7 @@ #!/bin/bash export LD_LIBRARY_PATH=build/src/lib:build/src/wx:$LD_LIBRARY_PATH +export DCPOMATIC_GRAPHICS=$DIR/../graphics build/features/dcpomatic_cucumber & sleep 5 diff --git a/src/lib/examine_content_job.cc b/src/lib/examine_content_job.cc index baa11ac93..b12983f2d 100644 --- a/src/lib/examine_content_job.cc +++ b/src/lib/examine_content_job.cc @@ -38,7 +38,7 @@ ExamineContentJob::ExamineContentJob (shared_ptr film, shared_ptr content, bool disable_audio_analysis) { + std::cout << "hello mum.\n"; if (dynamic_pointer_cast (content) && _directory) { - run_ffprobe (content->path(0), file("ffprobe.log")); + // run_ffprobe (content->path(0), file("ffprobe.log")); } + std::cout << "fuck\n"; + auto x = shared_from_this(); + std::cout << "sft worked.\n"; auto j = make_shared(shared_from_this(), content); + std::cout << "shit\n"; _job_connections.push_back ( j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr(j), weak_ptr(content), disable_audio_analysis)) ); + std::cout << "muthefucka"; JobManager::instance()->add (j); } diff --git a/src/lib/job.cc b/src/lib/job.cc index 9c9530b7a..119d0ba78 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -61,7 +61,7 @@ Job::Job (shared_ptr film) , _progress (0) , _rate_limit_progress(true) { - + std::cout << "uzi lover.\n"; } diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 7cc77d1fe..d4e8bf217 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -524,11 +524,13 @@ public: #ifdef DCPOMATIC_CUCUMBER void cucumber_add_content_file (string filename) { + std::cout << ".cucumber_add_content_file\n"; _film_editor->cucumber_add_content_file (filename); } /* Could be called from any thread */ std::string cucumber_get_content_list () { + std::cout << ".cucumber_get_content_list\n"; return _film_editor->cucumber_get_content_list(); } #endif diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index bfbaf7fe2..5ba21dad0 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -973,11 +973,16 @@ ContentPanel::add_files (vector paths) try { for (auto i: paths) { + std::cout << "here I am adding " << i << "\n"; for (auto j: content_factory(i)) { + std::cout << "add " << j << "\n"; _film->examine_and_add_content (j); + std::cout << "add done.\n"; } + std::cout << "that's done.\n"; } } catch (exception& e) { + std::cout << "that threw.\n"; error_dialog (_parent, e.what()); } } @@ -1021,13 +1026,18 @@ ContentPanel::window() const void ContentPanel::cucumber_add_content_file (string filename) { + std::cout << "CP::cucumber_add_content_file\n"; add_files ({filename}); auto jm = JobManager::instance (); while (jm->work_to_do()) { + std::cout << "work to do.\n"; while (signal_manager->ui_idle()) {} dcpomatic_sleep_seconds (1); } - while (signal_manager->ui_idle()) {} + while (signal_manager->ui_idle()) { + std::cout << "ui idle.\n"; + } + std::cout << "CP::cucumber_add_content_file done\n"; } diff --git a/src/wx/cucumber_bridge.cc b/src/wx/cucumber_bridge.cc index 976181935..fd5e3f4ff 100644 --- a/src/wx/cucumber_bridge.cc +++ b/src/wx/cucumber_bridge.cc @@ -44,11 +44,13 @@ CucumberBridge::listener () nanomsg.send (CUCUMBER_BRIDGE_READY "\n", -1); while (true) { - optional message = nanomsg.receive (-1); + auto message = nanomsg.receive (-1); if (!message) { continue; } + std::cout << "CB receives " << *message << "\n"; + if (*message == CUCUMBER_BRIDGE_CLICK_BUTTON) { emit (bind(boost::ref(ClickButton), get_parameter(nanomsg))); } else if (*message == CUCUMBER_BRIDGE_SELECT_MENU) { @@ -67,7 +69,7 @@ CucumberBridge::listener () string CucumberBridge::get_parameter (Nanomsg& nanomsg) { - optional p = nanomsg.receive (100); + auto p = nanomsg.receive (100); DCPOMATIC_ASSERT (p); return *p; } -- 2.30.2