X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.h;h=784434f6b60c2a198ce4c29edbd97575eba5b475;hb=e32d1c52f8f8e7cad145766b9b33bb9c3470a6c0;hp=d2e597637fcfac6fd9a2ad6f2ed9b92be93b4626;hpb=d6e74fb7dbc5b01c9ce42f8fe780bb16262d13b1;p=dcpomatic.git diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index d2e597637..784434f6b 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -23,28 +23,64 @@ #include #include "lib/film.h" +#include "lib/decoder_factory.h" -class ThumbPanel; +class wxToggleButton; +class FFmpegPlayer; +class Image; +class RGBPlusAlphaImage; +class Subtitle; /** @class FilmViewer - * @brief A wx widget to view `thumbnails' of a Film. + * @brief A wx widget to view a preview of a Film. */ class FilmViewer : public wxPanel { public: - FilmViewer (Film *, wxWindow *); + FilmViewer (boost::shared_ptr, wxWindow *); - void set_film (Film *); - void setup_visibility (); + void set_film (boost::shared_ptr); private: - void slider_changed (wxCommandEvent &); - void update_thumbs (); - void set_thumbnail (int); - void film_changed (FilmState::Property); - - Film* _film; - wxBoxSizer* _sizer; - ThumbPanel* _thumb_panel; + void film_changed (Film::Property); + void paint_panel (wxPaintEvent &); + void panel_sized (wxSizeEvent &); + void slider_moved (wxScrollEvent &); + void play_clicked (wxCommandEvent &); + void timer (wxTimerEvent &); + void process_video (boost::shared_ptr, bool, boost::shared_ptr); + void calculate_sizes (); + void check_play_state (); + void update_from_raw (); + void decoder_changed (); + void raw_to_display (); + void get_frame (); + void active_jobs_changed (bool); + + boost::shared_ptr _film; + + wxSizer* _v_sizer; + wxPanel* _panel; wxSlider* _slider; + wxToggleButton* _play_button; + wxTimer _timer; + + Decoders _decoders; + boost::shared_ptr _raw_frame; + boost::shared_ptr _raw_sub; + boost::shared_ptr _display_frame; + /* The x offset at which we display the actual film content; this corresponds + to the film's padding converted to our coordinates. + */ + int _display_frame_x; + boost::shared_ptr _display_sub; + Position _display_sub_position; + bool _got_frame; + + /** Size of our output (including padding if we have any) */ + libdcp::Size _out_size; + /** Size that we will make our film (equal to _out_size unless we have padding) */ + libdcp::Size _film_size; + /** Size of the panel that we have available */ + libdcp::Size _panel_size; };