/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
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
#include <wx/wx.h>
#include "lib/film.h"
-class ThumbPanel;
+class wxToggleButton;
+class FFmpegPlayer;
+class Image;
+class RGBPlusAlphaImage;
+class PlayerVideoFrame;
/** @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<Film>, wxWindow *);
- void set_film (Film *);
- void setup_visibility ();
+ void set_film (boost::shared_ptr<Film>);
private:
- void slider_changed (wxCommandEvent &);
- void set_thumbnail (int);
- void film_changed (FilmState::Property);
+ 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 (bool);
+ void back_clicked ();
+ void forward_clicked ();
+ void player_changed (bool);
+ void set_position_text ();
+ void get (DCPTime, bool);
+
+ boost::shared_ptr<Film> _film;
+ boost::shared_ptr<Player> _player;
- Film* _film;
- wxBoxSizer* _sizer;
- ThumbPanel* _thumb_panel;
+ wxSizer* _v_sizer;
+ wxPanel* _panel;
wxSlider* _slider;
+ wxButton* _back_button;
+ wxButton* _forward_button;
+ wxStaticText* _frame_number;
+ wxStaticText* _timecode;
+ wxToggleButton* _play_button;
+ wxTimer _timer;
+
+ boost::shared_ptr<const Image> _frame;
+ DCPTime _position;
+
+ /** 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;
};