Replace calls to Position::end.
[dcpomatic.git] / src / lib / piece.h
index 711e292eed451bd7961b8d11d3fa5111a83bdb40..0adc8fb32454894ea2e7758f6a0dccea1d106cdb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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.
 
@@ -21,6 +21,9 @@
 #ifndef DCPOMATIC_PIECE_H
 #define DCPOMATIC_PIECE_H
 
+#include "audio_stream.h"
+#include "dcpomatic_time.h"
+#include "frame_rate_change.h"
 #include "types.h"
 
 class Content;
@@ -29,17 +32,21 @@ 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