summaryrefslogtreecommitdiff
path: root/src/wx/film_editor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx/film_editor.cc')
-rw-r--r--src/wx/film_editor.cc53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 97a98e54d..ae1557c3e 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -135,6 +135,14 @@ FilmEditor::FilmEditor (Film* f, wxWindow* parent)
_sizer->Add (_with_subtitles, 1);
_sizer->AddSpacer (0);
+ video_control (add_label_to_sizer (_sizer, this, "Subtitle Offset"));
+ _subtitle_offset = new wxSpinCtrl (this);
+ _sizer->Add (video_control (_subtitle_offset), 1);
+
+ video_control (add_label_to_sizer (_sizer, this, "Subtitle Scale"));
+ _subtitle_scale = new wxSpinCtrl (this);
+ _sizer->Add (video_control (_subtitle_scale), 1);
+
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);
@@ -186,6 +194,7 @@ FilmEditor::FilmEditor (Film* f, wxWindow* parent)
_audio_gain->SetRange (-60, 60);
_audio_delay->SetRange (-1000, 1000);
_still_duration->SetRange (0, 60 * 60);
+ _subtitle_offset->SetRange (-1024, 1024);
vector<DCPContentType const *> const ct = DCPContentType::all ();
for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
@@ -220,6 +229,8 @@ FilmEditor::FilmEditor (Film* f, wxWindow* parent)
_still_duration->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::still_duration_changed), 0, this);
_change_dcp_range_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::change_dcp_range_clicked), 0, this);
_with_subtitles->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::with_subtitles_toggled), 0, this);
+ _subtitle_offset->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_offset_changed), 0, this);
+ _subtitle_scale->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_scale_changed), 0, this);
setup_visibility ();
setup_formats ();
@@ -327,6 +338,31 @@ FilmEditor::name_changed (wxCommandEvent &)
_ignore_changes = Film::NONE;
}
+void
+FilmEditor::subtitle_offset_changed (wxCommandEvent &)
+{
+ if (!_film) {
+ return;
+ }
+
+ _ignore_changes = Film::SUBTITLE_OFFSET;
+ _film->set_subtitle_offset (_subtitle_offset->GetValue ());
+ _ignore_changes = Film::NONE;
+}
+
+void
+FilmEditor::subtitle_scale_changed (wxCommandEvent &)
+{
+ if (!_film) {
+ return;
+ }
+
+ _ignore_changes = Film::SUBTITLE_OFFSET;
+ _film->set_subtitle_scale (_subtitle_scale->GetValue ());
+ _ignore_changes = Film::NONE;
+}
+
+
/** Called when the metadata stored in the Film object has changed;
* so that we can update the GUI.
* @param p Property of the Film that has changed.
@@ -447,6 +483,14 @@ FilmEditor::film_changed (Film::Property p)
break;
case Film::WITH_SUBTITLES:
_with_subtitles->SetValue (_film->with_subtitles ());
+ _subtitle_scale->Enable (_film->with_subtitles ());
+ _subtitle_offset->Enable (_film->with_subtitles ());
+ break;
+ case Film::SUBTITLE_OFFSET:
+ _subtitle_offset->SetValue (_film->subtitle_offset ());
+ break;
+ case Film::SUBTITLE_SCALE:
+ _subtitle_scale->SetValue (_film->subtitle_scale ());
break;
}
}
@@ -520,6 +564,9 @@ FilmEditor::set_film (Film* f)
film_changed (Film::AUDIO_GAIN);
film_changed (Film::AUDIO_DELAY);
film_changed (Film::STILL_DURATION);
+ film_changed (Film::WITH_SUBTITLES);
+ film_changed (Film::SUBTITLE_OFFSET);
+ film_changed (Film::SUBTITLE_SCALE);
}
/** Updates the sensitivity of lots of widgets to a given value.
@@ -546,6 +593,9 @@ FilmEditor::set_things_sensitive (bool s)
_audio_gain_calculate_button->Enable (s);
_audio_delay->Enable (s);
_still_duration->Enable (s);
+ _with_subtitles->Enable (s);
+ _subtitle_offset->Enable (s);
+ _subtitle_scale->Enable (s);
}
/** Called when the `Edit filters' button has been clicked */
@@ -724,6 +774,9 @@ FilmEditor::with_subtitles_toggled (wxCommandEvent &)
_ignore_changes = Film::WITH_SUBTITLES;
_film->set_with_subtitles (_with_subtitles->GetValue ());
_ignore_changes = Film::NONE;
+
+ _subtitle_scale->Enable (_film->with_subtitles ());
+ _subtitle_offset->Enable (_film->with_subtitles ());
}
void