Try to actually use colour conversion; bump libdcp in cscript.
[dcpomatic.git] / src / lib / player.h
index baaa8579166a0837be3e8f3a4783b662941f8b43..2261f66eaa6aafb8c09c3c71961e5f152fc5f513 100644 (file)
 #include <boost/shared_ptr.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include "playlist.h"
-#include "audio_buffers.h"
 #include "content.h"
 #include "film.h"
 #include "rect.h"
+#include "audio_merger.h"
+#include "audio_content.h"
 
 class Job;
 class Film;
@@ -61,10 +62,11 @@ public:
        /** Emitted when a video frame is ready.
         *  First parameter is the video image.
         *  Second parameter is the eye(s) that should see this image.
-        *  Third parameter is true if the image is the same as the last one that was emitted.
-        *  Fourth parameter is the time.
+        *  Third parameter is the colour conversion that should be used for this image.
+        *  Fourth parameter is true if the image is the same as the last one that was emitted.
+        *  Fifth parameter is the time.
         */
-       boost::signals2::signal<void (boost::shared_ptr<const Image>, Eyes, bool, Time)> Video;
+       boost::signals2::signal<void (boost::shared_ptr<const Image>, Eyes, ColourConversion, bool, Time)> Video;
        
        /** Emitted when some audio data is ready */
        boost::signals2::signal<void (boost::shared_ptr<const AudioBuffers>, Time)> Audio;
@@ -109,12 +111,11 @@ private:
        /** The time after the last audio that we emitted */
        Time _audio_position;
 
-       AudioBuffers _audio_buffers;
+       AudioMerger<Time, AudioContent::Frame> _audio_merger;
 
        libdcp::Size _video_container_size;
        boost::shared_ptr<Image> _black_frame;
        std::map<boost::shared_ptr<AudioContent>, boost::shared_ptr<Resampler> > _resamplers;
-       boost::shared_ptr<Resampler> _last_resampler;
 
        struct {
                boost::weak_ptr<Piece> piece;
@@ -133,7 +134,13 @@ private:
 
 #ifdef DCPOMATIC_DEBUG
        boost::shared_ptr<Content> _last_video;
-#endif 
+#endif
+
+       bool _last_emit_was_black;
+
+       boost::signals2::scoped_connection _playlist_changed_connection;
+       boost::signals2::scoped_connection _playlist_content_changed_connection;
+       boost::signals2::scoped_connection _film_changed_connection;
 };
 
 #endif