From f2caad0df1a451e2aff68dfd37277faa72116e12 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 20 May 2013 14:27:00 +0100 Subject: Various time-related fixes; fix daft hang on decodes. --- src/wx/film_editor.cc | 8 +++++--- src/wx/film_viewer.cc | 12 +++++------- src/wx/film_viewer.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/wx') diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 32def4641..891675143 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -1,3 +1,5 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + /* Copyright (C) 2012 Carl Hetherington @@ -337,13 +339,13 @@ FilmEditor::make_content_panel () wxBoxSizer* b = new wxBoxSizer (wxVERTICAL); _content_add = new wxButton (_content_panel, wxID_ANY, _("Add...")); - b->Add (_content_add); + b->Add (_content_add, 1, wxEXPAND | wxLEFT | wxRIGHT); _content_remove = new wxButton (_content_panel, wxID_ANY, _("Remove")); - b->Add (_content_remove); + b->Add (_content_remove, 1, wxEXPAND | wxLEFT | wxRIGHT); _content_properties = new wxButton (_content_panel, wxID_ANY, _("Properties...")); b->Add (_content_properties); _content_timeline = new wxButton (_content_panel, wxID_ANY, _("Timeline...")); - b->Add (_content_timeline); + b->Add (_content_timeline, 1, wxEXPAND | wxLEFT | wxRIGHT); s->Add (b, 0, wxALL, 4); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 11c826a26..2f69235c1 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -1,3 +1,5 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + /* Copyright (C) 2012 Carl Hetherington @@ -388,7 +390,7 @@ FilmViewer::check_play_state () } void -FilmViewer::process_video (shared_ptr image, bool, shared_ptr sub, double t) +FilmViewer::process_video (shared_ptr image, bool, shared_ptr sub, Time t) { _raw_frame = image; _raw_sub = sub; @@ -398,9 +400,9 @@ FilmViewer::process_video (shared_ptr image, bool, shared_ptrdcp_video_frame_rate (); - _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps)))); + _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps / TIME_HZ)))); - double w = t; + double w = static_cast(t) / TIME_HZ; int const h = (w / 3600); w -= h * 3600; int const m = (w / 60); @@ -425,8 +427,6 @@ FilmViewer::get_frame () return; } - cout << "-> FilmViewer::get_frame()\n"; - try { _got_frame = false; while (!_got_frame) { @@ -443,8 +443,6 @@ FilmViewer::get_frame () check_play_state (); error_dialog (this, wxString::Format (_("Could not decode video for view (%s)"), std_to_wx(e.what()).data())); } - - cout << "<- FilmViewer::get_frame()\n"; } void diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 02d862ca0..68d51bfbd 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -67,7 +67,7 @@ private: void slider_moved (wxScrollEvent &); void play_clicked (wxCommandEvent &); void timer (wxTimerEvent &); - void process_video (boost::shared_ptr, bool, boost::shared_ptr, double); + void process_video (boost::shared_ptr, bool, boost::shared_ptr, Time); void calculate_sizes (); void check_play_state (); void update_from_raw (); -- cgit v1.2.3