From 577f44adc98c39e7e4fe0a1d8db103ce7f15d1e5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Mar 2024 20:08:00 +0100 Subject: A couple of macOS development notes. --- DEVELOP.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/DEVELOP.md b/DEVELOP.md index be8ed61e6..51b63ff5c 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -4,6 +4,16 @@ This file collects a few notes relevant to DCP-o-matic developers. There is als [on the web site](https://dcpomatic.com/development). +## Building on macOS/arm64 + +Build `osx-environment` in `$HOME` +``` +bash platform/osx/copy_resources.sh +source platform/osx/set_paths.sh +./waf configure --target-macos-arm64 +``` + + ## Disk writer logging As we have no `film' folder to log to during disk writes, the logs end up: -- cgit v1.2.3 From db40e9a10b22085d124521763a8f12a290ba76f7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Mar 2024 20:11:21 +0100 Subject: Replace use of sprintf with snprintf. --- src/lib/digester.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/digester.cc b/src/lib/digester.cc index 8542c75a1..09214c3de 100644 --- a/src/lib/digester.cc +++ b/src/lib/digester.cc @@ -67,7 +67,7 @@ Digester::get () const char hex[MD5_DIGEST_SIZE * 2 + 1]; for (int i = 0; i < MD5_DIGEST_SIZE; ++i) { - sprintf(hex + i * 2, "%02x", digest[i]); + snprintf(hex + i * 2, MD5_DIGEST_SIZE * 2 + 1, "%02x", digest[i]); } _digest = hex; -- cgit v1.2.3 From b4488bd72fcbcc3fe393724c9f4c65697fa949b6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Mar 2024 20:36:32 +0100 Subject: Get prefs icons from the source tree on when starting from the macOS console. --- platform/osx/copy_resources.sh | 1 - src/wx/wx_util.cc | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/osx/copy_resources.sh b/platform/osx/copy_resources.sh index 82ca60de9..0b5d61283 100644 --- a/platform/osx/copy_resources.sh +++ b/platform/osx/copy_resources.sh @@ -2,6 +2,5 @@ mkdir -p build/src/Resources cp -r ../libdcp/{tags,xsd,ratings} build/src/Resources cp graphics/{link,splash}.png build/src/Resources cp graphics/{select,snap,sequence,zoom,zoom_all}.png build/src/Resources -cp graphics/osx/preferences/*.png build/src/Resources cp fonts/*.ttf build/src/Resources ln -s $(which openssl) build/src/tools/openssl diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index c0f90bd25..28ac6ab5c 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -670,6 +670,10 @@ bitmap_path (string name) } else { base = resources_path(); } + + if (!boost::filesystem::exists(base / name)) { + base = path / boost::filesystem::path("osx/preferences"); + } #else base = resources_path(); #endif -- cgit v1.2.3 From 11f046d81b9011a19d3f6299996f93782e789cb4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Mar 2024 20:38:13 +0100 Subject: Remove some more unnecessary copying for macOS command line. --- platform/osx/copy_resources.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/platform/osx/copy_resources.sh b/platform/osx/copy_resources.sh index 0b5d61283..06b6e5985 100644 --- a/platform/osx/copy_resources.sh +++ b/platform/osx/copy_resources.sh @@ -1,6 +1,4 @@ mkdir -p build/src/Resources cp -r ../libdcp/{tags,xsd,ratings} build/src/Resources -cp graphics/{link,splash}.png build/src/Resources -cp graphics/{select,snap,sequence,zoom,zoom_all}.png build/src/Resources cp fonts/*.ttf build/src/Resources ln -s $(which openssl) build/src/tools/openssl -- cgit v1.2.3 From f3c87bd59115b8d03837f98ee920cf0150a35c37 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Mar 2024 20:41:15 +0100 Subject: Fix link icon width on macOS. --- src/wx/video_panel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index b27db2547..db42a0c28 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -108,7 +108,7 @@ VideoPanel::create () int const link_height = 32; #elif defined(DCPOMATIC_OSX) int const crop_width = 56; - int const link_width = 23; + int const link_width = 8 + 15 / dpi_scale_factor(this); int const link_height = 28; #else int const crop_width = 56; -- cgit v1.2.3 From bf124d1ee666a1cef597f6e6291c931d276b831f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Mar 2024 21:00:12 +0100 Subject: Add dark-mode link icon. --- cscript | 3 +- graphics/link.png | Bin 318 -> 0 bytes graphics/link_black.png | Bin 0 -> 318 bytes graphics/link_white.png | Bin 0 -> 330 bytes graphics/src/link_black.svg | 78 ++++++++++++++++++++++++++++++++++++++++++++ graphics/src/link_white.svg | 78 ++++++++++++++++++++++++++++++++++++++++++++ graphics/update | 4 ++- graphics/wscript | 3 +- platform/osx/make_dmg.sh | 2 +- platform/windows/wscript | 3 +- src/wx/video_panel.cc | 6 ++-- 11 files changed, 170 insertions(+), 7 deletions(-) delete mode 100644 graphics/link.png create mode 100644 graphics/link_black.png create mode 100644 graphics/link_white.png create mode 100644 graphics/src/link_black.svg create mode 100644 graphics/src/link_white.svg diff --git a/cscript b/cscript index 84b6076e6..f70b55568 100644 --- a/cscript +++ b/cscript @@ -457,7 +457,8 @@ def make_spec(filename, version, target, options, requires=None): print('%{_datadir}/dcpomatic2/zoom_black.png', file=f) print('%{_datadir}/dcpomatic2/zoom_all_white.png', file=f) print('%{_datadir}/dcpomatic2/zoom_all_black.png', file=f) - print('%{_datadir}/dcpomatic2/link.png', file=f) + print('%{_datadir}/dcpomatic2/link_black.png', file=f) + print('%{_datadir}/dcpomatic2/link_white.png', file=f) print('%{_datadir}/dcpomatic2/me.jpg', file=f) print('%{_datadir}/dcpomatic2/add_black.png', file=f) print('%{_datadir}/dcpomatic2/add_white.png', file=f) diff --git a/graphics/link.png b/graphics/link.png deleted file mode 100644 index 3249d3710..000000000 Binary files a/graphics/link.png and /dev/null differ diff --git a/graphics/link_black.png b/graphics/link_black.png new file mode 100644 index 000000000..3249d3710 Binary files /dev/null and b/graphics/link_black.png differ diff --git a/graphics/link_white.png b/graphics/link_white.png new file mode 100644 index 000000000..274e47a38 Binary files /dev/null and b/graphics/link_white.png differ diff --git a/graphics/src/link_black.svg b/graphics/src/link_black.svg new file mode 100644 index 000000000..00d4f6b16 --- /dev/null +++ b/graphics/src/link_black.svg @@ -0,0 +1,78 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/graphics/src/link_white.svg b/graphics/src/link_white.svg new file mode 100644 index 000000000..e16a2a266 --- /dev/null +++ b/graphics/src/link_white.svg @@ -0,0 +1,78 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/graphics/update b/graphics/update index c63fa8835..46964470b 100755 --- a/graphics/update +++ b/graphics/update @@ -109,7 +109,9 @@ else done # Link icon - $INKSCAPE_EXPORT --export-filename=link.png src/link.svg -w 9 -h 16 + for c in black white; do + $INKSCAPE_EXPORT --export-filename=link_$c.png src/link_$c.svg -w 9 -h 16 + done # favicon mkdir -p web diff --git a/graphics/wscript b/graphics/wscript index 7937a389a..663e28287 100644 --- a/graphics/wscript +++ b/graphics/wscript @@ -51,7 +51,8 @@ def build(bld): 'zoom_all_white.png', 'zoom_all_black.png', 'me.jpg', - 'link.png', + 'link_white.png', + 'link_black.png', 'add_black.png', 'add_white.png', 'pause_black.png', diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index 4772d8b19..bebd089bd 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -251,7 +251,7 @@ function copy_resources { cp $prefix/src/dcpomatic/graphics/snap*.png "$dest" cp $prefix/src/dcpomatic/graphics/sequence*.png "$dest" cp $prefix/src/dcpomatic/graphics/me.jpg "$dest" - cp $prefix/src/dcpomatic/graphics/link.png "$dest" + cp $prefix/src/dcpomatic/graphics/link*.png "$dest" cp $prefix/src/dcpomatic/graphics/add*.png "$dest" cp $prefix/src/dcpomatic/graphics/pause*.png "$dest" cp -r $prefix/share/libdcp/xsd "$dest" diff --git a/platform/windows/wscript b/platform/windows/wscript index 8eb0fafa9..17965d54c 100644 --- a/platform/windows/wscript +++ b/platform/windows/wscript @@ -336,7 +336,8 @@ File "%graphics%/snap_black.png" File "%graphics%/sequence_white.png" File "%graphics%/sequence_black.png" File "%graphics%/me.jpg" -File "%graphics%/link.png" +File "%graphics%/link_white.png" +File "%graphics%/link_black.png" File "%graphics%/add_black.png" File "%graphics%/add_white.png" File "%graphics%/pause_black.png" diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index db42a0c28..859c0a886 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -127,8 +127,10 @@ VideoPanel::create () boost::bind (&VideoPanel::left_crop_changed, this) ); + auto const link_path = bitmap_path(gui_is_dark() ? "link_white.png" : "link_black.png"); + _left_right_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height)); - _left_right_link->SetBitmap (wxBitmap(bitmap_path("link.png"), wxBITMAP_TYPE_PNG)); + _left_right_link->SetBitmap(wxBitmap(link_path, wxBITMAP_TYPE_PNG)); _right_crop_label = create_label (this, _("Right"), true); _right_crop = new ContentSpinCtrl ( @@ -153,7 +155,7 @@ VideoPanel::create () ); _top_bottom_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height)); - _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link.png"), wxBITMAP_TYPE_PNG)); + _top_bottom_link->SetBitmap(wxBitmap(link_path, wxBITMAP_TYPE_PNG)); _bottom_crop_label = create_label (this, _("Bottom"), true); _bottom_crop = new ContentSpinCtrl ( -- cgit v1.2.3 From 9fd2a610d2d0c45c7c1d6dfa016f8daeac75f689 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 17 Mar 2024 10:28:59 +0100 Subject: Supporters update. --- src/wx/supporters.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wx/supporters.cc b/src/wx/supporters.cc index 260081fe3..711b6bbad 100644 --- a/src/wx/supporters.cc +++ b/src/wx/supporters.cc @@ -255,6 +255,7 @@ supported_by.Add (wxT ("Baptiste Darricarrère")); supported_by.Add (wxT ("JP Davidson")); supported_by.Add (wxT ("Carl Davis")); supported_by.Add (wxT ("Levi Davis")); +supported_by.Add (wxT ("James Davis")); supported_by.Add (wxT ("Stephen Day")); supported_by.Add (wxT ("Criolla DCP")); supported_by.Add (wxT ("Cinéma de la Neuveville")); @@ -455,6 +456,7 @@ supported_by.Add (wxT ("Silvio Giuliano")); supported_by.Add (wxT ("Cine Complete GmbH")); supported_by.Add (wxT ("CIDCOM Werbeagentur GmbH")); supported_by.Add (wxT ("Filmtheaterbetriebe Klein GmbH")); +supported_by.Add (wxT ("Konnektom GmbH")); supported_by.Add (wxT ("Artus Postproduktion GmbH")); supported_by.Add (wxT ("ProCinema GmbH")); supported_by.Add (wxT ("Urakypost GmbH")); @@ -697,6 +699,7 @@ supported_by.Add (wxT ("Olivier Lemaire")); supported_by.Add (wxT ("Tekanov Leonid")); supported_by.Add (wxT ("Eric Lesachet")); supported_by.Add (wxT ("Elmer Leupen")); +supported_by.Add (wxT ("Jason Levangie")); supported_by.Add (wxT ("Gavin Lewarne")); supported_by.Add (wxT ("Peter Liacopoulos")); supported_by.Add (wxT ("Peter Liermann")); @@ -732,6 +735,7 @@ supported_by.Add (wxT ("Fennworld LLC")); supported_by.Add (wxT ("The Gem LLC")); supported_by.Add (wxT ("ColabDM Productions LLP")); supported_by.Add (wxT ("Marco Löber")); +supported_by.Add (wxT ("Sergio Lobo-Navia")); supported_by.Add (wxT ("LoïcK!")); supported_by.Add (wxT ("Kwen In London")); supported_by.Add (wxT ("London48HFP")); @@ -903,6 +907,7 @@ supported_by.Add (wxT ("Anders Olsson")); supported_by.Add (wxT ("Didier Oriol")); supported_by.Add (wxT ("Kevin Orman")); supported_by.Add (wxT ("George Orr")); +supported_by.Add (wxT ("orwoid.com")); supported_by.Add (wxT ("Danilo Marichal Osorio")); supported_by.Add (wxT ("Norbert Ostendorf")); supported_by.Add (wxT ("Peter Östlund")); @@ -1020,6 +1025,7 @@ supported_by.Add (wxT ("Robin Rippmann")); supported_by.Add (wxT ("Ronnie Riskalla")); supported_by.Add (wxT ("Jimena Villarroel Rivadeneira")); supported_by.Add (wxT ("Rafa Rivera")); +supported_by.Add (wxT ("Cherie Rivers")); supported_by.Add (wxT ("Robbie Robertson")); supported_by.Add (wxT ("Charlotte Robinson")); supported_by.Add (wxT ("Fernando Rocha")); @@ -1151,7 +1157,9 @@ supported_by.Add (wxT ("Patrik Strömdahl")); supported_by.Add (wxT ("Francois Stuck")); supported_by.Add (wxT ("The Playroom Recording Studio")); supported_by.Add (wxT ("Yum Studio")); +supported_by.Add (wxT ("JLM Studios")); supported_by.Add (wxT ("Open Gate Studios")); +supported_by.Add (wxT ("Seelie Studios")); supported_by.Add (wxT ("Raggio Verde Subtitles")); supported_by.Add (wxT ("Michael Suesterhenn")); supported_by.Add (wxT ("Christian Suhren")); @@ -1185,6 +1193,7 @@ supported_by.Add (wxT ("Peter Hoopes for the Everett Theatre")); supported_by.Add (wxT ("The Concrete Theatre")); supported_by.Add (wxT ("Texas Theatre")); supported_by.Add (wxT ("Rodeo Drive-In Theatre")); +supported_by.Add (wxT ("Ralph Thiekötter")); supported_by.Add (wxT ("Carlo Thiel")); supported_by.Add (wxT ("Nicholas Thiele")); supported_by.Add (wxT ("Jamie Thomas")); @@ -1216,6 +1225,7 @@ supported_by.Add (wxT ("Stephen Tyler")); supported_by.Add (wxT ("Oles Tytokhod")); supported_by.Add (wxT ("Michael Ude")); supported_by.Add (wxT ("Mediakomitee UG")); +supported_by.Add (wxT ("Tor Uglum")); supported_by.Add (wxT ("Bjørn Uhrbrand")); supported_by.Add (wxT ("Cinema Metropolis Umbertide")); supported_by.Add (wxT ("Anthony Urgo")); @@ -1285,6 +1295,7 @@ supported_by.Add (wxT ("Mikael Wiström")); supported_by.Add (wxT ("Wolfgang Woehl")); supported_by.Add (wxT ("Nicolai Wolf")); supported_by.Add (wxT ("Chi Kong Wong")); +supported_by.Add (wxT ("Simon Wood")); supported_by.Add (wxT ("Andrew Woodward")); supported_by.Add (wxT ("Woody/mC")); supported_by.Add (wxT ("Jeremy Wooldridge")); -- cgit v1.2.3 From 08562514979d54288f850f95b8f514b1500614a1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 18 Mar 2024 18:09:28 +0100 Subject: Log job errors as errors during verify. --- src/wx/verify_dcp_dialog.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc index 2b108c945..7694121b1 100644 --- a/src/wx/verify_dcp_dialog.cc +++ b/src/wx/verify_dcp_dialog.cc @@ -130,6 +130,7 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job if (job->finished_in_error() && job->error_summary() != "") { /* We have an error that did not come from dcp::verify */ add_bullet (dcp::VerificationNote::Type::ERROR, std_to_wx(job->error_summary())); + ++counts[dcp::VerificationNote::Type::ERROR]; } for (auto i: job->notes()) { -- cgit v1.2.3 From f36991d7a91a4fd38c4159d51396b0f44422fd19 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 18 Mar 2024 18:09:37 +0100 Subject: Improve formatting of FAILED_READ errors. --- src/wx/verify_dcp_dialog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc index 7694121b1..c77f68ea1 100644 --- a/src/wx/verify_dcp_dialog.cc +++ b/src/wx/verify_dcp_dialog.cc @@ -136,7 +136,7 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job for (auto i: job->notes()) { switch (i.code()) { case dcp::VerificationNote::Code::FAILED_READ: - add (i, std_to_wx(*i.note())); + add (i, _("Could not read DCP (%n)")); break; case dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES: add(i, _("The hash (%reference_hash) of the CPL %n in the PKL does not agree with the CPL file (%calculated_hash). This probably means that the CPL file is corrupt.")); -- cgit v1.2.3 From 48bf4e68b251cbc00b7b462e60b0528d15423852 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 19 Mar 2024 10:00:55 +0100 Subject: Bump libdcp for SMPTE timecode parsing fix and better handling of unexpected verify errors. --- cscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscript b/cscript index f70b55568..53d2beb7b 100644 --- a/cscript +++ b/cscript @@ -535,7 +535,7 @@ def dependencies(target, options): # Use distro-provided FFmpeg on Arch deps = [] - deps.append(('libdcp', 'v1.8.97')) + deps.append(('libdcp', 'v1.8.98')) deps.append(('libsub', 'v1.6.47')) deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23')) deps.append(('rtaudio', 'f619b76')) -- cgit v1.2.3 From 059ad8809b715ca7b84f769529e8a441e3f002f2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 19 Mar 2024 23:02:32 +0100 Subject: The private test repo got some v2.18.x updates. --- run/tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run/tests b/run/tests index 4315e227f..6f43290c4 100755 --- a/run/tests +++ b/run/tests @@ -3,7 +3,7 @@ # e.g. --run_tests=foo set -e -PRIVATE_GIT="f4b0c41b263a17cf33edae7565f16bd21eb80b65" +PRIVATE_GIT="5298360d6bbae434fb4625fda1cc9dd6be101df3" if [ "$1" == "--check" ]; then shift 1 -- cgit v1.2.3 From 026f7e95210cafb6b44a1c207041df085ce92d95 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 11 Mar 2024 15:25:16 +0100 Subject: Fix failing tests. Broken in the fix for #2780, when we started to check that referenced audio MXFs have the correct number of channels. --- test/required_disk_space_test.cc | 10 ++++++---- test/vf_test.cc | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/required_disk_space_test.cc b/test/required_disk_space_test.cc index fad24389b..b704ccef2 100644 --- a/test/required_disk_space_test.cc +++ b/test/required_disk_space_test.cc @@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE (required_disk_space_test) { auto film = new_test_film ("required_disk_space_test"); film->set_j2k_bandwidth (100000000); - film->set_audio_channels (6); + film->set_audio_channels(8); film->set_reel_type (ReelType::BY_VIDEO_CONTENT); auto content_a = content_factory("test/data/flat_blue.png")[0]; BOOST_REQUIRE (content_a); @@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE (required_disk_space_test) check_within_n ( film->required_disk_space(), 288LL * (100000000 / 8) / 24 + // video - 288LL * 48000 * 6 * 3 / 24 + // audio + 288LL * 48000 * 8 * 3 / 24 + // audio 65536, // extra 16 ); @@ -69,17 +69,19 @@ BOOST_AUTO_TEST_CASE (required_disk_space_test) check_within_n ( film->required_disk_space(), 240LL * (100000000 / 8) / 24 + // video - 288LL * 48000 * 6 * 3 / 24 + // audio + 288LL * 48000 * 8 * 3 / 24 + // audio 65536, // extra 16 ); + std::string why_not; + BOOST_CHECK(content_b->can_reference_audio(film, why_not)); content_b->set_reference_audio (true); check_within_n ( film->required_disk_space(), 240LL * (100000000 / 8) / 24 + // video - 240LL * 48000 * 6 * 3 / 24 + // audio + 240LL * 48000 * 8 * 3 / 24 + // audio 65536, // extra 16 ); diff --git a/test/vf_test.cc b/test/vf_test.cc index ed7f483ae..ca987b22d 100644 --- a/test/vf_test.cc +++ b/test/vf_test.cc @@ -73,6 +73,7 @@ BOOST_AUTO_TEST_CASE (vf_test1) /* Multi-reel DCP can't be referenced if we are using a single reel for the project */ film->set_reel_type (ReelType::SINGLE); + film->set_audio_channels(16); string why_not; BOOST_CHECK (!dcp->can_reference_video(film, why_not)); BOOST_CHECK (!dcp->can_reference_audio(film, why_not)); -- cgit v1.2.3 From 15235c0d2fad7e916cda5b2d6ce79c4e9a38c4f9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 20 Mar 2024 15:34:24 +0100 Subject: Tidy up and fix assertion failure when selecting a CPL from the menu. --- src/wx/content_menu.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 4af5a71b7..642457d93 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -520,15 +520,11 @@ ContentMenu::cpl_selected (wxCommandEvent& ev) DCPOMATIC_ASSERT (dcp); auto cpls = dcp::find_and_resolve_cpls (dcp->directories(), true); - DCPOMATIC_ASSERT (ev.GetId() > 0); - DCPOMATIC_ASSERT (ev.GetId() <= int (cpls.size())); - auto i = cpls.begin (); - for (int j = 0; j < ev.GetId() - 1; ++j) { - ++i; - } + DCPOMATIC_ASSERT(ev.GetId() >= DCPOMATIC_CPL_MENU); + DCPOMATIC_ASSERT(ev.GetId() < int(DCPOMATIC_CPL_MENU + cpls.size())); + dcp->set_cpl(cpls[ev.GetId() - DCPOMATIC_CPL_MENU]->id()); - dcp->set_cpl ((*i)->id ()); auto film = _film.lock (); DCPOMATIC_ASSERT (film); JobManager::instance()->add (make_shared(film, dcp)); -- cgit v1.2.3