--- /dev/null
+/*
+ Copyright (C) 2022 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "markers.h"
+
+
+using std::make_pair;
+using std::pair;
+using std::vector;
+
+
+vector<pair<wxString, dcp::Marker>>
+all_markers ()
+{
+ vector<pair<wxString, dcp::Marker>> out;
+ out.push_back (make_pair(_("First frame of composition"), dcp::Marker::FFOC));
+ out.push_back (make_pair(_("Last frame of composition"), dcp::Marker::LFOC));
+ out.push_back (make_pair(_("First frame of title credits"), dcp::Marker::FFTC));
+ out.push_back (make_pair(_("Last frame of title credits"), dcp::Marker::LFTC));
+ out.push_back (make_pair(_("First frame of intermission"), dcp::Marker::FFOI));
+ out.push_back (make_pair(_("Last frame of intermission"), dcp::Marker::LFOI));
+ out.push_back (make_pair(_("First frame of end credits"), dcp::Marker::FFEC));
+ out.push_back (make_pair(_("Last frame of end credits"), dcp::Marker::LFEC));
+ out.push_back (make_pair(_("First frame of moving credits"), dcp::Marker::FFMC));
+ out.push_back (make_pair(_("Last frame of moving credits"), dcp::Marker::LFMC));
+ return out;
+}
+
--- /dev/null
+/*
+ Copyright (C) 2022 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include <dcp/types.h>
+#include <wx/wx.h>
+#include <utility>
+#include <vector>
+
+
+extern std::vector<std::pair<wxString, dcp::Marker>> all_markers ();
*/
-#include "markers_dialog.h"
-#include "wx_util.h"
-#include "timecode.h"
-#include "static_text.h"
-#include "dcpomatic_button.h"
#include "check_box.h"
+#include "dcpomatic_button.h"
#include "film_viewer.h"
+#include "markers.h"
+#include "markers_dialog.h"
+#include "static_text.h"
+#include "timecode.h"
+#include "wx_util.h"
#include "lib/film.h"
#include <dcp/types.h>
#include <wx/gbsizer.h>
using std::cout;
+using std::make_shared;
using std::shared_ptr;
using std::weak_ptr;
-using std::make_shared;
-using boost::optional;
using boost::bind;
+using boost::optional;
using dcpomatic::DCPTime;
auto grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
int r = 0;
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("First frame of composition"), dcp::Marker::FFOC));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("Last frame of composition"), dcp::Marker::LFOC));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("First frame of title credits"), dcp::Marker::FFTC));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("Last frame of title credits"), dcp::Marker::LFTC));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("First frame of intermission"), dcp::Marker::FFOI));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("Last frame of intermission"), dcp::Marker::LFOI));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("First frame of end credits"), dcp::Marker::FFEC));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("Last frame of end credits"), dcp::Marker::LFEC));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("First frame of moving credits"), dcp::Marker::FFMC));
- _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, _("Last frame of moving credits"), dcp::Marker::LFMC));
+ for (auto const& marker: all_markers()) {
+ _markers.push_back (make_shared<Marker>(this, grid, r++, film, viewer, marker.first, marker.second));
+ }
sizer->Add (grid, 0, wxALL, 8);