diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-22 12:25:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-22 12:25:35 +0100 |
| commit | 75712cfaf2a8ec8904d7d9552c542a2245bbbc17 (patch) | |
| tree | 5a7994b213e7baab5675351b13807719a44d7862 /src/wx | |
| parent | 3d9f434ef9db3e78eed808d6ecb2d26fd03c2902 (diff) | |
Basic UI.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/film_editor.cc | 7 | ||||
| -rw-r--r-- | src/wx/video_panel.cc | 28 | ||||
| -rw-r--r-- | src/wx/video_panel.h | 10 |
3 files changed, 35 insertions, 10 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 3800774e2..39935927f 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -488,6 +488,9 @@ FilmEditor::set_film (shared_ptr<Film> f) { set_general_sensitivity (f != 0); + wxListEvent ev; + content_selection_changed (ev); + if (_film == f) { return; } @@ -522,9 +525,6 @@ FilmEditor::set_film (shared_ptr<Film> f) if (!_film->content().empty ()) { set_selection (_film->content().front ()); } - - wxListEvent ev; - content_selection_changed (ev); } void @@ -703,6 +703,7 @@ FilmEditor::content_selection_changed (wxListEvent &) film_content_changed (s, ContentProperty::LENGTH); film_content_changed (s, VideoContentProperty::VIDEO_CROP); film_content_changed (s, VideoContentProperty::VIDEO_RATIO); + film_content_changed (s, VideoContentProperty::VIDEO_FRAME_TYPE); film_content_changed (s, AudioContentProperty::AUDIO_GAIN); film_content_changed (s, AudioContentProperty::AUDIO_DELAY); film_content_changed (s, AudioContentProperty::AUDIO_MAPPING); diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index b72bae035..e08edfa5a 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -30,6 +30,7 @@ using std::string; using std::pair; using boost::shared_ptr; using boost::dynamic_pointer_cast; +using boost::bind; VideoPanel::VideoPanel (FilmEditor* e) : FilmEditorPanel (e, _("Video")) @@ -38,6 +39,12 @@ VideoPanel::VideoPanel (FilmEditor* e) _sizer->Add (grid, 0, wxALL, 8); int r = 0; + + add_label_to_grid_bag_sizer (grid, this, _("Type"), true, wxGBPosition (r, 0)); + _frame_type = new wxChoice (this, wxID_ANY); + grid->Add (_frame_type, wxGBPosition (r, 1)); + ++r; + add_label_to_grid_bag_sizer (grid, this, _("Left crop"), true, wxGBPosition (r, 0)); _left_crop = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)); grid->Add (_left_crop, wxGBPosition (r, 1)); @@ -93,11 +100,15 @@ VideoPanel::VideoPanel (FilmEditor* e) _ratio->Append (std_to_wx ((*i)->nickname ())); } - _ratio->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (VideoPanel::ratio_changed), 0, this); + _frame_type->Append (_("2D")); + _frame_type->Append (_("3D left/right")); + + _frame_type->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, bind (&VideoPanel::frame_type_changed, this)); _left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (VideoPanel::left_crop_changed), 0, this); _right_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (VideoPanel::right_crop_changed), 0, this); _top_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (VideoPanel::top_crop_changed), 0, this); _bottom_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (VideoPanel::bottom_crop_changed), 0, this); + _ratio->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (VideoPanel::ratio_changed), 0, this); _filters_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (VideoPanel::edit_filters_clicked), 0, this); } @@ -167,8 +178,10 @@ VideoPanel::film_content_changed (shared_ptr<Content> c, int property) { shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (c); shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c); - - if (property == VideoContentProperty::VIDEO_CROP) { + + if (property == VideoContentProperty::VIDEO_FRAME_TYPE) { + checked_set (_frame_type, vc->video_frame_type ()); + } else if (property == VideoContentProperty::VIDEO_CROP) { checked_set (_left_crop, vc ? vc->crop().left : 0); checked_set (_right_crop, vc ? vc->crop().right : 0); checked_set (_top_crop, vc ? vc->crop().top : 0); @@ -308,3 +321,12 @@ VideoPanel::ratio_changed (wxCommandEvent &) vc->set_ratio (ratios[n]); } } + +void +VideoPanel::frame_type_changed () +{ + shared_ptr<VideoContent> vc = _editor->selected_video_content (); + if (vc) { + vc->set_video_frame_type (static_cast<VideoFrameType> (_frame_type->GetSelection ())); + } +} diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h index 4cc9cd79c..51a593e75 100644 --- a/src/wx/video_panel.h +++ b/src/wx/video_panel.h @@ -40,16 +40,18 @@ private: void bottom_crop_changed (wxCommandEvent &); void edit_filters_clicked (wxCommandEvent &); void ratio_changed (wxCommandEvent &); + void frame_type_changed (); void setup_scaling_description (); - - wxChoice* _ratio; - wxStaticText* _ratio_description; - wxStaticText* _scaling_description; + + wxChoice* _frame_type; wxSpinCtrl* _left_crop; wxSpinCtrl* _right_crop; wxSpinCtrl* _top_crop; wxSpinCtrl* _bottom_crop; + wxChoice* _ratio; + wxStaticText* _ratio_description; + wxStaticText* _scaling_description; wxStaticText* _filters; wxButton* _filters_button; }; |
