#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;
class AudioContent;
class Piece;
class Image;
+class Resampler;
/** @class Player
* @brief A class which can `play' a Playlist; emitting its audio and video.
/** 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;
void flush ();
void emit_black ();
void emit_silence (OutputAudioFrame);
+ boost::shared_ptr<Resampler> resampler (boost::shared_ptr<AudioContent>, bool);
void film_changed (Film::Property);
void update_subtitle ();
/** 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;
struct {
boost::weak_ptr<Piece> piece;
#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