-#include "timecode.h"
-#include "film_editor.h"
-
-using std::cout;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
-
-TimingPanel::TimingPanel (FilmEditor* e)
- : FilmEditorPanel (e, _("Timing"))
-{
- wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
- _sizer->Add (grid, 0, wxALL, 8);
-
- add_label_to_sizer (grid, this, _("Position"), true);
- _position = new DCPTimecode (this);
- grid->Add (_position);
- add_label_to_sizer (grid, this, _("Full length"), true);
- _full_length = new DCPTimecode (this);
- grid->Add (_full_length);
- add_label_to_sizer (grid, this, _("Trim from start"), true);
- _trim_start = new DCPTimecode (this);
- grid->Add (_trim_start);
- add_label_to_sizer (grid, this, _("Trim from end"), true);
- _trim_end = new DCPTimecode (this);
- grid->Add (_trim_end);
- add_label_to_sizer (grid, this, _("Play length"), true);
- _play_length = new DCPTimecode (this);
- grid->Add (_play_length);
+#include "lib/audio_content.h"
+#include "lib/content.h"
+#include "lib/dcp_content.h"
+#include "lib/dcp_subtitle_content.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/image_content.h"
+#include "lib/string_text_file_content.h"
+#include "lib/text_content.h"
+#include "lib/video_content.h"
+#include <dcp/locale_convert.h>
+#include <dcp/warnings.h>
+#if defined(__WXGTK20__) && !defined(__WXGTK3__)
+#define TIMING_PANEL_ALIGNMENT_HACK 1
+LIBDCP_DISABLE_WARNINGS
+#include <gtk/gtk.h>
+LIBDCP_ENABLE_WARNINGS
+#endif
+#include <set>
+
+
+using std::string;
+using std::set;
+using std::shared_ptr;
+using std::weak_ptr;
+using std::dynamic_pointer_cast;
+using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
+using dcp::locale_convert;
+using namespace dcpomatic;
+
+
+TimingPanel::TimingPanel (ContentPanel* p, FilmViewer& viewer)
+ /* horrid hack for apparent lack of context support with wxWidgets i18n code */
+ /// TRANSLATORS: translate the word "Timing" here; do not include the "Timing|" prefix
+ : ContentSubPanel (p, S_("Timing|Timing"))
+ , _viewer (viewer)
+ , _film_content_changed_suspender (boost::bind(&TimingPanel::film_content_changed, this, _1))
+{
+
+}
+
+
+void
+TimingPanel::create ()
+{
+ wxSize size = TimecodeBase::size (this);
+
+ for (int i = 0; i < 3; ++i) {
+ _colon[i] = create_label (this, wxT(":"), false);
+ }
+
+ //// TRANSLATORS: this is an abbreviation for "hours"
+ _h_label = new StaticText (this, _("h"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef TIMING_PANEL_ALIGNMENT_HACK
+ /* Hack to work around failure to centre text on GTK */
+ gtk_label_set_line_wrap (GTK_LABEL(_h_label->GetHandle()), FALSE);
+#endif
+ //// TRANSLATORS: this is an abbreviation for "minutes"
+ _m_label = new StaticText (this, _("m"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef TIMING_PANEL_ALIGNMENT_HACK
+ gtk_label_set_line_wrap (GTK_LABEL (_m_label->GetHandle()), FALSE);
+#endif
+ //// TRANSLATORS: this is an abbreviation for "seconds"
+ _s_label = new StaticText (this, _("s"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef TIMING_PANEL_ALIGNMENT_HACK
+ gtk_label_set_line_wrap (GTK_LABEL(_s_label->GetHandle()), FALSE);
+#endif
+ //// TRANSLATORS: this is an abbreviation for "frames"
+ _f_label = new StaticText (this, _("f"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef TIMING_PANEL_ALIGNMENT_HACK
+ gtk_label_set_line_wrap (GTK_LABEL(_f_label->GetHandle()), FALSE);
+#endif
+
+ _position_label = create_label (this, _("Position"), true);
+ _position = new Timecode<DCPTime> (this);
+ _move_to_start_of_reel = new Button (this, _("Move to start of reel"));
+ _full_length_label = create_label (this, _("Full length"), true);
+ _full_length = new Timecode<DCPTime> (this);
+ _trim_start_label = create_label (this, _("Trim from start"), true);
+ _trim_start = new Timecode<ContentTime> (this);
+ _trim_start_to_playhead = new Button (this, _("Trim up to current position"));
+ _trim_end_label = create_label (this, _("Trim from end"), true);
+ _trim_end = new Timecode<ContentTime> (this);
+ _trim_end_to_playhead = new Button (this, _("Trim from current position to end"));
+ _play_length_label = create_label (this, _("Play length"), true);
+ _play_length = new Timecode<DCPTime> (this);