From d2b7059dae5a440f0a44f2ad8e7b1f0e834a7a9e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 23 Dec 2025 00:07:25 +0100 Subject: Display markers in the player (#2793). The space above the position slider was already reserved, but nothing would be shown there. --- src/tools/dcpomatic_player.cc | 3 +++ src/wx/controls.cc | 2 +- src/wx/markers_panel.cc | 7 ++++++- src/wx/markers_panel.h | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 037fd3d72..3b121b677 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -42,6 +42,7 @@ #include "lib/audio_content.h" #include "lib/config.h" #include "lib/constants.h" +#include "lib/copy_dcp_details_to_film.h" #include "lib/cross.h" #include "lib/dcp_content.h" #include "lib/dcp_examiner.h" @@ -500,6 +501,8 @@ public: for (auto i: _film->content()) { auto dcp = dynamic_pointer_cast(i); + copy_dcp_markers_to_film(dcp, _film); + for (auto j: i->text) { j->set_use(true); } diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 57adeb34b..fce3fd7eb 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -67,7 +67,7 @@ using namespace dcpomatic; Controls::Controls(wxWindow* parent, FilmViewer& viewer, bool editor_controls) : wxPanel(parent) - , _markers(new MarkersPanel(this, viewer)) + , _markers(new MarkersPanel(this, viewer, editor_controls)) , _slider(new wxSlider(this, wxID_ANY, 0, 0, 4096)) , _viewer(viewer) , _rewind_button(new Button(this, char_to_wx("|<"))) diff --git a/src/wx/markers_panel.cc b/src/wx/markers_panel.cc index e01d3bc28..021128ddf 100644 --- a/src/wx/markers_panel.cc +++ b/src/wx/markers_panel.cc @@ -55,9 +55,10 @@ enum { }; -MarkersPanel::MarkersPanel(wxWindow* parent, FilmViewer& viewer) +MarkersPanel::MarkersPanel(wxWindow* parent, FilmViewer& viewer, bool allow_editing) : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, 40)) , _viewer(viewer) + , _allow_editing(allow_editing) { Bind(wxEVT_PAINT, boost::bind(&MarkersPanel::paint, this)); Bind(wxEVT_MOTION, boost::bind(&MarkersPanel::mouse_moved, this, _1)); @@ -267,6 +268,10 @@ MarkersPanel::mouse_left_down() void MarkersPanel::mouse_right_down(wxMouseEvent& ev) { + if (!_allow_editing) { + return; + } + wxMenu menu; if (_over) { DCPOMATIC_ASSERT(_over->marker); diff --git a/src/wx/markers_panel.h b/src/wx/markers_panel.h index 760df23ac..4c5fd63cf 100644 --- a/src/wx/markers_panel.h +++ b/src/wx/markers_panel.h @@ -35,7 +35,7 @@ class wxTipWindow; class MarkersPanel : public wxPanel { public: - MarkersPanel(wxWindow* parent, FilmViewer& viewer); + MarkersPanel(wxWindow* parent, FilmViewer& viewer, bool allow_editing); void set_film(std::weak_ptr film); @@ -58,5 +58,6 @@ private: MarkerLayoutComponent const* _over = nullptr; FilmViewer& _viewer; MarkerLayoutComponent const* _menu_marker = nullptr; + bool _allow_editing; }; -- cgit v1.2.3