/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#ifndef DCPOMATIC_PIECE_H
#define DCPOMATIC_PIECE_H
-#include "types.h"
+#include "audio_stream.h"
+#include "dcpomatic_time.h"
#include "frame_rate_change.h"
+#include "types.h"
class Content;
class Decoder;
class Piece
{
public:
- Piece (boost::shared_ptr<Content> c, boost::shared_ptr<Decoder> d, FrameRateChange f)
- : content (c)
- , decoder (d)
- , frc (f)
- , done (false)
- {}
-
- boost::shared_ptr<Content> content;
- boost::shared_ptr<Decoder> decoder;
- FrameRateChange frc;
- bool done;
+ Piece (boost::shared_ptr<Content> c, boost::shared_ptr<Decoder> d, FrameRateChange f);
+
+ void update_pull_to (dcpomatic::DCPTime& pull_to) const;
+ void set_last_push_end (AudioStreamPtr stream, dcpomatic::DCPTime last_push_end);
+
+ dcpomatic::DCPTime position () const;
+ dcpomatic::DCPTime end (boost::shared_ptr<const Film> film) const;
+
+private:
+ std::vector<boost::shared_ptr<Content> > _content;
+ std::vector<boost::shared_ptr<Decoder> > _decoder;
+ FrameRateChange _frc;
+ bool _done;
+
+ std::map<AudioStreamPtr, dcpomatic::DCPTime> _stream_last_push_end;
};
#endif