Take Film pointer out of Content.
[dcpomatic.git] / src / lib / audio_decoder.h
index 359540d6ffd1861343793f8f2d71f146b451ba70..50e361e8f19f80cb181bc8a55d3e80f1aa73da8c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -36,6 +36,7 @@ class AudioBuffers;
 class AudioContent;
 class AudioDecoderStream;
 class Log;
+class Film;
 class Resampler;
 
 /** @class AudioDecoder.
@@ -44,25 +45,31 @@ class Resampler;
 class AudioDecoder : public boost::enable_shared_from_this<AudioDecoder>, public DecoderPart
 {
 public:
-       AudioDecoder (Decoder* parent, boost::shared_ptr<const AudioContent> content, boost::shared_ptr<Log> log);
+       AudioDecoder (Decoder* parent, boost::shared_ptr<const AudioContent> content, bool fast);
 
-       ContentTime position () const;
-       void emit (AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, ContentTime);
+       ContentTime position (boost::shared_ptr<const Film> film) const;
+       void emit (boost::shared_ptr<const Film> film, AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, ContentTime);
        void seek ();
        void flush ();
 
-       ContentTime stream_position (AudioStreamPtr stream) const;
+       ContentTime stream_position (boost::shared_ptr<const Film> film, AudioStreamPtr stream) const;
 
        /** @return Number of frames of data that were accepted */
-       boost::signals2::signal<Frame (AudioStreamPtr, ContentAudio)> Data;
+       boost::signals2::signal<void (AudioStreamPtr, ContentAudio)> Data;
 
 private:
        void silence (int milliseconds);
 
        boost::shared_ptr<const AudioContent> _content;
-       /** Frame after the last one that was emitted from Data for each AudioStream */
-       std::map<AudioStreamPtr, Frame> _positions;
-       std::map<AudioStreamPtr, boost::shared_ptr<Resampler> > _resamplers;
+       /** Frame after the last one that was emitted from Data (i.e. at the resampled rate, if applicable)
+        *  for each AudioStream.
+        */
+       typedef std::map<AudioStreamPtr, Frame> PositionMap;
+       PositionMap _positions;
+       typedef std::map<AudioStreamPtr, boost::shared_ptr<Resampler> > ResamplerMap;
+       ResamplerMap _resamplers;
+
+       bool _fast;
 };
 
 #endif