diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-11 01:25:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-11 11:58:15 +0100 |
| commit | c370a1f38215f6461cf4366e6885757e7aa2b96a (patch) | |
| tree | 6d660895988652297260c2434115b903032bc60d /src/tools | |
| parent | 23b60bec13fa8f0b88c34922a169aa0084d99476 (diff) | |
Separate out management of controls.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 14 | ||||
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 34 |
2 files changed, 28 insertions, 20 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 7392c830c..d7862a803 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -23,6 +23,7 @@ */ #include "wx/control_film_viewer.h" +#include "wx/film_viewer.h" #include "wx/film_editor.h" #include "wx/job_manager_view.h" #include "wx/full_config_dialog.h" @@ -317,12 +318,14 @@ public: */ wxPanel* overall_panel = new wxPanel (this, wxID_ANY); - _film_viewer = new ControlFilmViewer (overall_panel); + _film_viewer.reset (new FilmViewer (overall_panel)); + _controls = new Controls (overall_panel, _film_viewer); _film_editor = new FilmEditor (overall_panel, _film_viewer); JobManagerView* job_manager_view = new JobManagerView (overall_panel, false); wxBoxSizer* right_sizer = new wxBoxSizer (wxVERTICAL); - right_sizer->Add (_film_viewer, 2, wxEXPAND | wxALL, 6); + right_sizer->Add (_film_viewer->panel(), 2, wxEXPAND | wxALL, 6); + right_sizer->Add (_controls, 0, wxEXPAND | wxALL, 6); right_sizer->Add (job_manager_view, 1, wxEXPAND | wxALL, 6); wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL); @@ -1298,16 +1301,17 @@ private: void back_frame () { - _film_viewer->back_frame (); + _film_viewer->move (-_film_viewer->one_video_frame()); } void forward_frame () { - _film_viewer->forward_frame (); + _film_viewer->move (_film_viewer->one_video_frame()); } FilmEditor* _film_editor; - ControlFilmViewer* _film_viewer; + boost::shared_ptr<FilmViewer> _film_viewer; + Controls* _controls; VideoWaveformDialog* _video_waveform_dialog; HintsDialog* _hints_dialog; ServersListDialog* _servers_list_dialog; diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 03ace74c9..a8895e8e8 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -18,6 +18,17 @@ */ + +#include "wx/wx_signal_manager.h" +#include "wx/wx_util.h" +#include "wx/about_dialog.h" +#include "wx/report_problem_dialog.h" +#include "wx/film_viewer.h" +#include "wx/player_information.h" +#include "wx/update_dialog.h" +#include "wx/player_config_dialog.h" +#include "wx/verify_dcp_dialog.h" +#include "wx/control_film_viewer.h" #include "lib/cross.h" #include "lib/config.h" #include "lib/util.h" @@ -35,15 +46,6 @@ #include "lib/examine_content_job.h" #include "lib/server.h" #include "lib/dcpomatic_socket.h" -#include "wx/wx_signal_manager.h" -#include "wx/wx_util.h" -#include "wx/about_dialog.h" -#include "wx/report_problem_dialog.h" -#include "wx/control_film_viewer.h" -#include "wx/player_information.h" -#include "wx/update_dialog.h" -#include "wx/player_config_dialog.h" -#include "wx/verify_dcp_dialog.h" #include <wx/wx.h> #include <wx/stdpaths.h> #include <wx/splash.h> @@ -109,7 +111,6 @@ public: , _history_items (0) , _history_position (0) , _history_separator (0) - , _viewer (0) { #if defined(DCPOMATIC_WINDOWS) @@ -151,11 +152,13 @@ public: */ wxPanel* overall_panel = new wxPanel (this, wxID_ANY); - _viewer = new ControlFilmViewer (overall_panel, false, false); + _viewer.reset (new FilmViewer (overall_panel)); + _controls = new Controls (overall_panel, _viewer); _viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ()); _info = new PlayerInformation (overall_panel, _viewer); wxSizer* main_sizer = new wxBoxSizer (wxVERTICAL); - main_sizer->Add (_viewer, 1, wxEXPAND | wxALL, 6); + main_sizer->Add (_viewer->panel(), 1, wxEXPAND | wxALL, 6); + main_sizer->Add (_controls, 0, wxEXPAND | wxALL, 6); main_sizer->Add (_info, 0, wxEXPAND | wxALL, 6); overall_panel->SetSizer (main_sizer); @@ -576,12 +579,12 @@ private: void back_frame () { - _viewer->back_frame (); + _viewer->move (-_viewer->one_video_frame()); } void forward_frame () { - _viewer->forward_frame (); + _viewer->move (_viewer->one_video_frame()); } private: @@ -649,7 +652,8 @@ private: int _history_items; int _history_position; wxMenuItem* _history_separator; - ControlFilmViewer* _viewer; + shared_ptr<FilmViewer> _viewer; + Controls* _controls; boost::shared_ptr<Film> _film; boost::signals2::scoped_connection _config_changed_connection; wxMenuItem* _file_add_ov; |
