summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-10 01:05:27 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-10 01:05:30 +0200
commitba438ecd16207700ffd849820796b6f833beef21 (patch)
tree7d37e4ba4322e74204fb4a210657fa8bba6af385 /src/wx
parentb56481622c385732ae9ba2affd38ae7b820aab45 (diff)
Add new "copy markers from this DCP" option (#2628).
Also stop the "copy settings" options from doing this, as Carsten points out that it could be confusing and potentially very bad if you copy markers from an OV to an edited VF which then bring house lights up at the wrong time or whatever.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_menu.cc21
-rw-r--r--src/wx/content_menu.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 722f4563b..8bb7e3526 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -83,6 +83,7 @@ enum {
ID_ov,
ID_choose_cpl,
ID_set_dcp_settings,
+ ID_set_dcp_markers,
ID_remove
};
@@ -106,6 +107,7 @@ ContentMenu::ContentMenu(wxWindow* p, FilmViewer& viewer)
_cpl_menu = new wxMenu ();
_choose_cpl = _menu->Append (ID_choose_cpl, _("Choose CPL..."), _cpl_menu);
_set_dcp_settings = _menu->Append (ID_set_dcp_settings, _("Set project DCP settings from this DCP"));
+ _set_dcp_markers = _menu->Append(ID_set_dcp_markers, _("Set project markers from this DCP"));
_menu->AppendSeparator ();
_remove = _menu->Append (ID_remove, _("Remove"));
@@ -119,6 +121,7 @@ ContentMenu::ContentMenu(wxWindow* p, FilmViewer& viewer)
_parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::kdm, this), ID_kdm);
_parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::ov, this), ID_ov);
_parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::set_dcp_settings, this), ID_set_dcp_settings);
+ _parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::set_dcp_markers, this), ID_set_dcp_markers);
_parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::remove, this), ID_remove);
_parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::cpl_selected, this, _1), 1, ID_repeat - 1);
}
@@ -158,6 +161,7 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList
_kdm->Enable (dcp->encrypted ());
_ov->Enable (dcp->needs_assets ());
_set_dcp_settings->Enable (static_cast<bool>(dcp));
+ _set_dcp_markers->Enable(static_cast<bool>(dcp));
try {
auto cpls = dcp::find_and_resolve_cpls (dcp->directories(), true);
_choose_cpl->Enable (cpls.size() > 1);
@@ -186,10 +190,12 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList
_ov->Enable (false);
_choose_cpl->Enable (false);
_set_dcp_settings->Enable (false);
+ _set_dcp_markers->Enable(false);
}
} else {
_kdm->Enable (false);
_set_dcp_settings->Enable (false);
+ _set_dcp_markers->Enable(false);
}
_remove->Enable (!_content.empty ());
@@ -216,6 +222,21 @@ ContentMenu::set_dcp_settings ()
void
+ContentMenu::set_dcp_markers()
+{
+ auto film = _film.lock();
+ if (!film) {
+ return;
+ }
+
+ DCPOMATIC_ASSERT(_content.size() == 1);
+ auto dcp = dynamic_pointer_cast<DCPContent>(_content.front());
+ DCPOMATIC_ASSERT(dcp);
+ copy_dcp_markers_to_film(dcp, film);
+}
+
+
+void
ContentMenu::repeat ()
{
if (_content.empty ()) {
diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h
index c750ae852..2f3250284 100644
--- a/src/wx/content_menu.h
+++ b/src/wx/content_menu.h
@@ -61,6 +61,7 @@ private:
void kdm ();
void ov ();
void set_dcp_settings ();
+ void set_dcp_markers();
void remove ();
void cpl_selected (wxCommandEvent& ev);
@@ -84,6 +85,7 @@ private:
wxMenuItem* _ov;
wxMenuItem* _choose_cpl;
wxMenuItem* _set_dcp_settings;
+ wxMenuItem* _set_dcp_markers;
wxMenuItem* _remove;
wx_ptr<AutoCropDialog> _auto_crop_dialog;