X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.h;h=04f8b9f7abcb2bfae7910d1d0ac6efbfe58ce62f;hb=740977ac39b3b1ae64bd06efce0a3bf9d188dd67;hp=f1213e023f8252069c75358ac886768394adca81;hpb=489e6a92b9aa940de64a886a1f9b5a420b50c7fc;p=dcpomatic.git diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index f1213e023..04f8b9f7a 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,40 +24,85 @@ #include #include "lib/film.h" -class ThumbPanel; +class wxToggleButton; +class FFmpegPlayer; +class Image; +class RGBPlusAlphaImage; +class PlayerVideo; /** @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 (wxWindow *); + + void set_film (boost::shared_ptr); + + DCPTime position () const { + return _position; + } + + void set_position (DCPTime p); + void set_coalesce_player_changes (bool c); + + void refresh (); - void set_film (Film *); - void setup_visibility (); + boost::signals2::signal)> ImageChanged; private: - void slider_changed (wxCommandEvent &); - void update_thumbs (); - std::string format_position_slider_value (double) const; - void load_thumbnail (int); + void paint_panel (); + void panel_sized (wxSizeEvent &); + void slider_moved (); + void play_clicked (); + void timer (); + void calculate_sizes (); + void check_play_state (); + void active_jobs_changed (boost::optional); + void back_clicked (); + void forward_clicked (); + void player_changed (bool); + void update_position_label (); + void update_position_slider (); + void get (DCPTime, bool); + void refresh_panel (); + void setup_sensitivity (); void film_changed (Film::Property); - void reload_current_thumbnail (); - void update_scaled_pixbuf (); - std::pair scaled_pixbuf_size () const; -// void scroller_size_allocate (Gtk::Allocation); - - Film* _film; - wxBoxSizer* _sizer; - ThumbPanel* _thumb_panel; + + boost::shared_ptr _film; + boost::shared_ptr _player; + + wxSizer* _v_sizer; + wxPanel* _panel; + wxCheckBox* _outline_content; + wxRadioButton* _left_eye; + wxRadioButton* _right_eye; wxSlider* _slider; -// Gtk::VBox _vbox; -// Gtk::ScrolledWindow _scroller; -// Gtk::Image _image; -// Glib::RefPtr _pixbuf; -// Glib::RefPtr _cropped_pixbuf; -// Glib::RefPtr _scaled_pixbuf; -// Gtk::HScale _position_slider; -// Gtk::Allocation _last_scroller_allocation; + wxButton* _back_button; + wxButton* _forward_button; + wxStaticText* _frame_number; + wxStaticText* _timecode; + wxToggleButton* _play_button; + wxTimer _timer; + bool _coalesce_player_changes; + bool _pending_player_change; + + boost::shared_ptr _frame; + DCPTime _position; + Position _inter_position; + dcp::Size _inter_size; + + /** Size of our output (including padding if we have any) */ + dcp::Size _out_size; + /** Size of the panel that we have available */ + dcp::Size _panel_size; + /** true if the last call to ::get() was specified to be accurate; + * this is used so that when re-fetching the current frame we + * can get the same one that we got last time. + */ + bool _last_get_accurate; + + boost::signals2::scoped_connection _film_connection; + boost::signals2::scoped_connection _player_connection; };