diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-09 15:56:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-09 15:56:55 +0100 |
| commit | b5828ccf20a0e0c4365854ac19a05d5a4783e254 (patch) | |
| tree | 338fd3dfc1b7f74edf4fb2615ed6d1136942f4d8 /src/wx | |
| parent | 9b0d04f34424c9aeddaf07007838f2c8c0113093 (diff) | |
Make subtitle addition optional.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/film_editor.cc | 32 | ||||
| -rw-r--r-- | src/wx/film_editor.h | 3 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 3b26a5537..bc7414c41 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -130,6 +130,11 @@ FilmEditor::FilmEditor (Film* f, wxWindow* parent) _sizer->Add (s); } + _with_subtitles = new wxCheckBox (this, wxID_ANY, wxT("With Subtitles")); + video_control (_with_subtitles); + _sizer->Add (_with_subtitles, 1); + _sizer->AddSpacer (0); + video_control (add_label_to_sizer (_sizer, this, "Frames Per Second")); _frames_per_second = new wxStaticText (this, wxID_ANY, wxT ("")); _sizer->Add (video_control (_frames_per_second), 1, wxALIGN_CENTER_VERTICAL); @@ -292,6 +297,7 @@ FilmEditor::content_changed (wxCommandEvent &) setup_visibility (); setup_formats (); + setup_subtitle_button (); } /** Called when the DCP A/B switch has been toggled */ @@ -340,6 +346,7 @@ FilmEditor::film_changed (Film::Property p) _content->SetPath (std_to_wx (_film->content ())); setup_visibility (); setup_formats (); + setup_subtitle_button (); break; case Film::FORMAT: { @@ -437,6 +444,9 @@ FilmEditor::film_changed (Film::Property p) case Film::STILL_DURATION: _still_duration->SetValue (_film->still_duration ()); break; + case Film::WITH_SUBTITLES: + _with_subtitles->SetValue (_film->with_subtitles ()); + break; } } @@ -702,3 +712,25 @@ FilmEditor::setup_formats () _sizer->Layout (); } + +void +FilmEditor::with_subtitles_toggled (wxCommandEvent &) +{ + if (!_film) { + return; + } + + _ignore_changes = Film::WITH_SUBTITLES; + _film->set_with_subtitles (_with_subtitles->GetValue ()); + _ignore_changes = Film::NONE; +} + +void +FilmEditor::setup_subtitle_button () +{ + _with_subtitles->Enable (_film->has_subtitles ()); + if (!_film->has_subtitles ()) { + _with_subtitles->SetValue (false); + } +} + diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index c599cd285..720e71902 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -58,6 +58,7 @@ private: void audio_gain_changed (wxCommandEvent &); void audio_gain_calculate_button_clicked (wxCommandEvent &); void audio_delay_changed (wxCommandEvent &); + void with_subtitles_toggled (wxCommandEvent &); void still_duration_changed (wxCommandEvent &); /* Handle changes to the model */ @@ -69,6 +70,7 @@ private: void set_things_sensitive (bool); void setup_formats (); + void setup_subtitle_button (); wxControl* video_control (wxControl *); wxControl* still_control (wxControl *); @@ -103,6 +105,7 @@ private: wxButton* _audio_gain_calculate_button; /** The Film's audio delay */ wxSpinCtrl* _audio_delay; + wxCheckBox* _with_subtitles; /** The Film's DCP content type */ wxComboBox* _dcp_content_type; /** The Film's frames per second */ |
