diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-01 21:35:41 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-01 21:35:41 +0000 |
| commit | 6a516da9a403ce05b2b78b3cf1376f4dfe4be3fe (patch) | |
| tree | 7c5307ceefa5a6fc6a11d39bbfb2deca0e29758d /src/wx | |
| parent | dd7cf1ef6e860243b80f4c47a99393244f63a3d5 (diff) | |
Make film hold its DCP frame rate.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/film_editor.cc | 16 | ||||
| -rw-r--r-- | src/wx/film_editor.h | 4 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 6 | ||||
| -rw-r--r-- | src/wx/properties_dialog.cc | 4 |
4 files changed, 16 insertions, 14 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 362243ef3..0a6a35273 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -127,8 +127,8 @@ FilmEditor::make_film_panel () grid->Add (_dcp_content_type); video_control (add_label_to_sizer (grid, _film_panel, _("Original Frame Rate"))); - _frames_per_second = new wxStaticText (_film_panel, wxID_ANY, wxT ("")); - grid->Add (video_control (_frames_per_second), 1, wxALIGN_CENTER_VERTICAL); + _source_frame_rate = new wxStaticText (_film_panel, wxID_ANY, wxT ("")); + grid->Add (video_control (_source_frame_rate), 1, wxALIGN_CENTER_VERTICAL); video_control (add_label_to_sizer (grid, _film_panel, _("Original Size"))); _original_size = new wxStaticText (_film_panel, wxID_ANY, wxT ("")); @@ -596,9 +596,9 @@ FilmEditor::film_changed (Film::Property p) checked_set (_name, _film->name()); setup_dcp_name (); break; - case Film::FRAMES_PER_SECOND: - s << fixed << setprecision(2) << _film->frames_per_second(); - _frames_per_second->SetLabel (std_to_wx (s.str ())); + case Film::SOURCE_FRAME_RATE: + s << fixed << setprecision(2) << _film->source_frame_rate(); + _source_frame_rate->SetLabel (std_to_wx (s.str ())); break; case Film::SIZE: if (_film->size().width == 0 && _film->size().height == 0) { @@ -609,8 +609,8 @@ FilmEditor::film_changed (Film::Property p) } break; case Film::LENGTH: - if (_film->frames_per_second() > 0 && _film->length()) { - s << _film->length().get() << " " << _("frames") << "; " << seconds_to_hms (_film->length().get() / _film->frames_per_second()); + if (_film->source_frame_rate() > 0 && _film->length()) { + s << _film->length().get() << " " << _("frames") << "; " << seconds_to_hms (_film->length().get() / _film->source_frame_rate()); } else if (_film->length()) { s << _film->length().get() << " " << _("frames"); } @@ -782,7 +782,7 @@ FilmEditor::set_film (shared_ptr<Film> f) film_changed (Film::LENGTH); film_changed (Film::CONTENT_AUDIO_STREAMS); film_changed (Film::SUBTITLE_STREAMS); - film_changed (Film::FRAMES_PER_SECOND); + film_changed (Film::SOURCE_FRAME_RATE); } /** Updates the sensitivity of lots of widgets to a given value. diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 2af747bb0..da9bb0301 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -157,8 +157,8 @@ private: wxSpinCtrl* _j2k_bandwidth; /** The Film's DCP content type */ wxChoice* _dcp_content_type; - /** The Film's frames per second */ - wxStaticText* _frames_per_second; + /** The Film's source frame rate */ + wxStaticText* _source_frame_rate; /** The Film's original size */ wxStaticText* _original_size; /** The Film's length */ diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 5eba7fd80..a40a3c78d 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -188,7 +188,7 @@ FilmViewer::timer (wxTimerEvent &) get_frame (); if (_film->length()) { - int const new_slider_position = 4096 * _decoders.video->last_source_time() / (_film->length().get() / _film->frames_per_second()); + int const new_slider_position = 4096 * _decoders.video->last_source_time() / (_film->length().get() / _film->source_frame_rate()); if (new_slider_position != _slider->GetValue()) { _slider->SetValue (new_slider_position); } @@ -237,7 +237,7 @@ FilmViewer::slider_moved (wxScrollEvent &) return; } - if (_decoders.video->seek (_slider->GetValue() * _film->length().get() / (4096 * _film->frames_per_second()))) { + if (_decoders.video->seek (_slider->GetValue() * _film->length().get() / (4096 * _film->source_frame_rate()))) { return; } @@ -369,7 +369,7 @@ FilmViewer::check_play_state () } if (_play_button->GetValue()) { - _timer.Start (1000 / _film->frames_per_second()); + _timer.Start (1000 / _film->source_frame_rate()); } else { _timer.Stop (); } diff --git a/src/wx/properties_dialog.cc b/src/wx/properties_dialog.cc index e93d06dbe..f4acb6b1a 100644 --- a/src/wx/properties_dialog.cc +++ b/src/wx/properties_dialog.cc @@ -52,7 +52,9 @@ PropertiesDialog::PropertiesDialog (wxWindow* parent, shared_ptr<Film> film) if (_film->length()) { _frames->SetLabel (std_to_wx (lexical_cast<string> (_film->length().get()))); - double const disk = ((double) _film->j2k_bandwidth() / 8) * _film->length().get() / (_film->frames_per_second () * 1073741824); + FrameRateConversion frc (_film->source_frame_rate(), _film->dcp_frame_rate()); + int const dcp_length = _film->length().get() * frc.factor(); + double const disk = ((double) _film->j2k_bandwidth() / 8) * dcp_length / (_film->dcp_frame_rate() * 1073741824); stringstream s; s << fixed << setprecision (1) << disk << _("Gb"); _disk->SetLabel (std_to_wx (s.str ())); |
