- make_video_panel ();
- _content_notebook->AddPage (_video_panel, _("Video"), false);
- make_audio_panel ();
- _content_notebook->AddPage (_audio_panel, _("Audio"), false);
- make_subtitle_panel ();
- _content_notebook->AddPage (_subtitle_panel, _("Subtitles"), false);
- make_timing_panel ();
- _content_notebook->AddPage (_timing_panel, _("Timing"), false);
-
- _loop_count->SetRange (2, 1024);
-}
-
-void
-FilmEditor::make_audio_panel ()
-{
- _audio_panel = new wxPanel (_content_notebook);
- wxBoxSizer* audio_sizer = new wxBoxSizer (wxVERTICAL);
- _audio_panel->SetSizer (audio_sizer);
-
- wxFlexGridSizer* grid = new wxFlexGridSizer (3, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- audio_sizer->Add (grid, 0, wxALL, 8);
-
- _show_audio = new wxButton (_audio_panel, wxID_ANY, _("Show Audio..."));
- grid->Add (_show_audio, 1);
- grid->AddSpacer (0);
- grid->AddSpacer (0);
-
- add_label_to_sizer (grid, _audio_panel, _("Audio Gain"), true);
- {
- wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _audio_gain = new wxSpinCtrl (_audio_panel);
- s->Add (_audio_gain, 1);
- add_label_to_sizer (s, _audio_panel, _("dB"), false);
- grid->Add (s, 1);
- }
-
- _audio_gain_calculate_button = new wxButton (_audio_panel, wxID_ANY, _("Calculate..."));
- grid->Add (_audio_gain_calculate_button);
-
- add_label_to_sizer (grid, _audio_panel, _("Audio Delay"), false);
- {
- wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _audio_delay = new wxSpinCtrl (_audio_panel);
- s->Add (_audio_delay, 1);
- /// TRANSLATORS: this is an abbreviation for milliseconds, the unit of time
- add_label_to_sizer (s, _audio_panel, _("ms"), false);
- grid->Add (s);
- }
-
- grid->AddSpacer (0);
-
- add_label_to_sizer (grid, _audio_panel, _("Audio Stream"), true);
- _audio_stream = new wxChoice (_audio_panel, wxID_ANY);
- grid->Add (_audio_stream, 1, wxEXPAND);
- _audio_description = new wxStaticText (_audio_panel, wxID_ANY, wxT (""));
- grid->AddSpacer (0);
-
- grid->Add (_audio_description, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 8);
- grid->AddSpacer (0);
- grid->AddSpacer (0);
-
- _audio_mapping = new AudioMappingView (_audio_panel);
- audio_sizer->Add (_audio_mapping, 1, wxEXPAND | wxALL, 6);
-
- _audio_gain->SetRange (-60, 60);
- _audio_delay->SetRange (-1000, 1000);
-}
-
-void
-FilmEditor::make_subtitle_panel ()
-{
- _subtitle_panel = new wxPanel (_content_notebook);
- wxBoxSizer* subtitle_sizer = new wxBoxSizer (wxVERTICAL);
- _subtitle_panel->SetSizer (subtitle_sizer);
- wxFlexGridSizer* grid = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- subtitle_sizer->Add (grid, 0, wxALL, 8);
-
- _with_subtitles = new wxCheckBox (_subtitle_panel, wxID_ANY, _("With Subtitles"));
- grid->Add (_with_subtitles, 1);
- grid->AddSpacer (0);
-
- {
- add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset"), true);
- wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _subtitle_offset = new wxSpinCtrl (_subtitle_panel);
- s->Add (_subtitle_offset);
- add_label_to_sizer (s, _subtitle_panel, _("%"), false);
- grid->Add (s);
- }
-
- {
- add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Scale"), true);
- wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _subtitle_scale = new wxSpinCtrl (_subtitle_panel);
- s->Add (_subtitle_scale);
- add_label_to_sizer (s, _subtitle_panel, _("%"), false);
- grid->Add (s);
- }
-
- add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Stream"), true);
- _subtitle_stream = new wxChoice (_subtitle_panel, wxID_ANY);
- grid->Add (_subtitle_stream, 1, wxEXPAND);
-
- _subtitle_offset->SetRange (-100, 100);
- _subtitle_scale->SetRange (1, 1000);
- _subtitle_scale->SetValue (100);
-}
-
-void
-FilmEditor::make_timing_panel ()
-{
- _timing_panel = new wxPanel (_content_notebook);
- wxBoxSizer* timing_sizer = new wxBoxSizer (wxVERTICAL);
- _timing_panel->SetSizer (timing_sizer);
- wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
- timing_sizer->Add (grid, 0, wxALL, 8);
-
- add_label_to_sizer (grid, _timing_panel, _("Start time"), true);
- _start = new Timecode (_timing_panel);
- grid->Add (_start);
- add_label_to_sizer (grid, _timing_panel, _("Length"), true);
- _length = new Timecode (_timing_panel);
- grid->Add (_length);
-}
-
-
-/** Called when the left crop widget has been changed */
-void
-FilmEditor::left_crop_changed (wxCommandEvent &)
-{
- shared_ptr<VideoContent> c = selected_video_content ();
- if (!c) {
- return;
- }
-
- c->set_left_crop (_left_crop->GetValue ());
-}
-
-/** Called when the right crop widget has been changed */
-void
-FilmEditor::right_crop_changed (wxCommandEvent &)
-{
- shared_ptr<VideoContent> c = selected_video_content ();
- if (!c) {
- return;
- }
-
- c->set_right_crop (_right_crop->GetValue ());
-}
-
-/** Called when the top crop widget has been changed */
-void
-FilmEditor::top_crop_changed (wxCommandEvent &)
-{
- shared_ptr<VideoContent> c = selected_video_content ();
- if (!c) {
- return;
- }
-
- c->set_top_crop (_top_crop->GetValue ());
-}
-
-/** Called when the bottom crop value has been changed */
-void
-FilmEditor::bottom_crop_changed (wxCommandEvent &)
-{
- shared_ptr<VideoContent> c = selected_video_content ();
- if (!c) {
- return;
- }
-
- c->set_bottom_crop (_bottom_crop->GetValue ());