Config option to disable preview audio.
[dcpomatic.git] / src / lib / butler.h
index d801d6cf9b7f1d12ff1eaa2d9cac1b21d04ca62d..948a78ea5f64d79dfa82c9ddc864f48b56556927 100644 (file)
@@ -19,6 +19,9 @@
 */
 
 #include "video_ring_buffers.h"
+#include "audio_ring_buffers.h"
+#include "audio_mapping.h"
+#include "exception_store.h"
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 #include <boost/thread.hpp>
@@ -29,24 +32,31 @@ class Film;
 class Player;
 class PlayerVideo;
 
-class Butler : public boost::noncopyable
+class Butler : public ExceptionStore, public boost::noncopyable
 {
 public:
-       Butler (boost::weak_ptr<const Film> film, boost::shared_ptr<Player> player);
+       Butler (boost::weak_ptr<const Film> film, boost::shared_ptr<Player> player, AudioMapping map, int audio_channels);
        ~Butler ();
 
        void seek (DCPTime position, bool accurate);
        std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> get_video ();
+       void get_audio (float* out, Frame frames);
+
+       void disable_audio ();
 
 private:
        void thread ();
        void video (boost::shared_ptr<PlayerVideo> video, DCPTime time);
+       void audio (boost::shared_ptr<AudioBuffers> audio, DCPTime time);
+       void player_changed ();
+       bool should_run () const;
 
        boost::weak_ptr<const Film> _film;
        boost::shared_ptr<Player> _player;
        boost::thread* _thread;
 
        VideoRingBuffers _video;
+       AudioRingBuffers _audio;
 
        boost::mutex _mutex;
        boost::condition _summon;
@@ -56,5 +66,13 @@ private:
 
        bool _finished;
 
+       AudioMapping _audio_mapping;
+       int _audio_channels;
+
+       bool _stop_thread;
+       bool _disable_audio;
+
        boost::signals2::scoped_connection _player_video_connection;
+       boost::signals2::scoped_connection _player_audio_connection;
+       boost::signals2::scoped_connection _player_changed_connection;
 };