X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.h;h=aacede06e5bf64ff43629d8be01fb82951fff273;hb=e257ae9a74c608d308401f39fb113bff595df390;hp=d01e002906be3522bad6ee72595987d55ee3b7fc;hpb=a78b741c43830c84bcb4d18e3147746f13a668e5;p=dcpomatic.git diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index d01e00290..aacede06e 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -22,14 +22,18 @@ * @brief A wx widget to view `thumbnails' of a Film. */ -#include #include "lib/film.h" +#include "lib/config.h" +#include +#include class wxToggleButton; class FFmpegPlayer; class Image; class RGBPlusAlphaImage; class PlayerVideo; +class Player; +class Butler; /** @class FilmViewer * @brief A wx widget to view a preview of a Film. @@ -38,12 +42,13 @@ class FilmViewer : public wxPanel { public: FilmViewer (wxWindow *); + ~FilmViewer (); void set_film (boost::shared_ptr); /** @return our `playhead' position; this may not lie exactly on a frame boundary */ DCPTime position () const { - return _position; + return _video_position; } void set_position (DCPTime p); @@ -51,6 +56,8 @@ public: void refresh (); + int audio_callback (void* out, unsigned int frames); + boost::signals2::signal)> ImageChanged; private: @@ -67,7 +74,6 @@ private: void player_changed (bool); void update_position_label (); void update_position_slider (); - void video (boost::shared_ptr, DCPTime time); void get (); void seek (DCPTime t, bool accurate); void refresh_panel (); @@ -78,6 +84,12 @@ private: void frame_number_clicked (); void go_to (DCPTime t); void jump_to_selected_clicked (); + void recreate_butler (); + void config_changed (Config::Property); + DCPTime time () const; + void start (); + bool stop (); + Frame average_latency () const; boost::shared_ptr _film; boost::shared_ptr _player; @@ -99,7 +111,7 @@ private: bool _pending_player_change; boost::shared_ptr _frame; - DCPTime _position; + DCPTime _video_position; Position _inter_position; dcp::Size _inter_size; @@ -112,4 +124,17 @@ private: * can get the same one that we got last time. */ bool _last_seek_accurate; + + RtAudio _audio; + int _audio_channels; + unsigned int _audio_block_size; + bool _playing; + boost::shared_ptr _butler; + + std::list _latency_history; + /** Mutex to protect _latency_history */ + mutable boost::mutex _latency_history_mutex; + int _latency_history_count; + + boost::signals2::scoped_connection _config_changed_connection; };