X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.h;h=aacede06e5bf64ff43629d8be01fb82951fff273;hb=e257ae9a74c608d308401f39fb113bff595df390;hp=9fc21fc9ce765e2dd57e82e669826781eb1cfc4b;hpb=d2c4aba65a9eb2ee75961cdc860d2f3aa0b1a548;p=dcpomatic.git diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 9fc21fc9c..aacede06e 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -22,8 +22,10 @@ * @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; @@ -31,6 +33,7 @@ class Image; class RGBPlusAlphaImage; class PlayerVideo; class Player; +class Butler; /** @class FilmViewer * @brief A wx widget to view a preview of a Film. @@ -39,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); @@ -52,6 +56,8 @@ public: void refresh (); + int audio_callback (void* out, unsigned int frames); + boost::signals2::signal)> ImageChanged; private: @@ -68,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 (); @@ -79,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; @@ -100,7 +111,7 @@ private: bool _pending_player_change; boost::shared_ptr _frame; - DCPTime _position; + DCPTime _video_position; Position _inter_position; dcp::Size _inter_size; @@ -113,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; };