X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fcontrols.h;h=321d7e05c0868fa1083135d443f82160dd90590b;hb=5fa6584826d7c356451bcea46928c1721f857ca5;hp=fd6181d91d193ada92c17d10d9c6657f5808eb3a;hpb=866552989b82ed28964172fce1dd6b787589f8d7;p=dcpomatic.git diff --git a/src/wx/controls.h b/src/wx/controls.h index fd6181d91..321d7e05c 100644 --- a/src/wx/controls.h +++ b/src/wx/controls.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,45 +18,59 @@ */ + #ifndef DCPOMATIC_CONTROLS_H #define DCPOMATIC_CONTROLS_H + #include "lib/dcpomatic_time.h" -#include "lib/types.h" #include "lib/film.h" -#include "lib/spl.h" +#include +LIBDCP_DISABLE_WARNINGS #include -#include +LIBDCP_ENABLE_WARNINGS #include -class FilmViewer; -class Film; + +class CheckBox; class ClosedCaptionsDialog; class Content; +class ContentView; +class Film; +class FilmViewer; +class MarkersPanel; class PlayerVideo; -class wxToggleButton; + class wxListCtrl; -class ContentView; +class wxToggleButton; + namespace dcp { class CPL; } + class Controls : public wxPanel { public: Controls ( wxWindow* parent, - boost::shared_ptr, + FilmViewer &, bool editor_controls = true ); - virtual void set_film (boost::shared_ptr film); - boost::shared_ptr film () const; + virtual void set_film (std::shared_ptr film); + + virtual void play () {}; + virtual void stop () {}; + void seek (int slider); + + std::shared_ptr film () const; void back_frame (); void forward_frame (); protected: + virtual void started (); virtual void stopped (); virtual void setup_sensitivity (); @@ -64,9 +78,10 @@ protected: wxSizer* _v_sizer; wxBoxSizer* _button_sizer; - boost::shared_ptr _film; + std::shared_ptr _film; + MarkersPanel* _markers; wxSlider* _slider; - boost::shared_ptr _viewer; + FilmViewer& _viewer; boost::optional _active_job; private: @@ -82,21 +97,20 @@ private: void jump_to_selected_clicked (); void timecode_clicked (); void active_jobs_changed (boost::optional); - DCPTime nudge_amount (wxKeyboardState& ev); - void image_changed (boost::weak_ptr); + dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev); + void image_changed (std::weak_ptr); void outline_content_changed (); void eye_changed (); - void position_changed (); + void update_position (); void film_change (ChangeType, Film::Property); - typedef std::pair, boost::filesystem::path> CPL; + typedef std::pair, boost::filesystem::path> CPL; - bool _slider_being_moved; - bool _was_running_before_slider; + bool _slider_being_moved = false; - wxCheckBox* _outline_content; - wxChoice* _eye; - wxCheckBox* _jump_to_selected; + CheckBox* _outline_content = nullptr; + wxChoice* _eye = nullptr; + CheckBox* _jump_to_selected = nullptr; wxButton* _rewind_button; wxButton* _back_button; wxButton* _forward_button; @@ -105,8 +119,11 @@ private: ClosedCaptionsDialog* _closed_captions_dialog; + wxTimer _timer; + boost::signals2::scoped_connection _film_change_connection; boost::signals2::scoped_connection _config_changed_connection; }; + #endif