#include "playlist.h"
#include "audio_buffers.h"
#include "content.h"
+#include "film.h"
class Job;
class Film;
void disable_audio ();
bool pass ();
- void seek (Time);
- void seek_back ();
+ void seek (Time, bool);
- /** @return position that we are at; ie the time of the next thing we will emit on pass() */
- Time position () const {
- return _position;
+ Time video_position () const {
+ return _video_position;
}
void set_video_container_size (libdcp::Size);
/** Emitted when some audio data is ready */
boost::signals2::signal<void (boost::shared_ptr<const AudioBuffers>, Time)> Audio;
+ /** Emitted when something has changed such that if we went back and emitted
+ * the last frame again it would look different. This is not emitted after
+ * a seek.
+ */
+ boost::signals2::signal<void ()> Changed;
+
private:
void process_video (boost::weak_ptr<Piece>, boost::shared_ptr<const Image>, bool, VideoContent::Frame);
void playlist_changed ();
void content_changed (boost::weak_ptr<Content>, int);
void do_seek (Time, bool);
- void add_black_piece (Time, Time);
- void add_silent_piece (Time, Time);
void flush ();
+ void emit_black ();
+ void emit_silence (OutputAudioFrame);
boost::shared_ptr<Resampler> resampler (boost::shared_ptr<AudioContent>);
+ void film_changed (Film::Property);
boost::shared_ptr<const Film> _film;
boost::shared_ptr<const Playlist> _playlist;
/** Our pieces are ready to go; if this is false the pieces must be (re-)created before they are used */
bool _have_valid_pieces;
std::list<boost::shared_ptr<Piece> > _pieces;
- Time _position;
+
+ /** The time after the last video that we emitted */
+ Time _video_position;
+ /** The time after the last audio that we emitted */
+ Time _audio_position;
+
AudioBuffers _audio_buffers;
- Time _next_audio;
- boost::optional<libdcp::Size> _video_container_size;
+
+ libdcp::Size _video_container_size;
+ boost::shared_ptr<Image> _black_frame;
std::map<boost::shared_ptr<AudioContent>, boost::shared_ptr<Resampler> > _resamplers;
};