WIP: more
[dcpomatic.git] / src / lib / audio_decoder.h
index 32d71c0671b849d57c5a4bfa921110fca57526d0..4cb2f17bf8d9c76d70ec16bc8b859e14a129a032 100644 (file)
 
 */
 
+
 /** @file src/lib/audio_decoder.h
  *  @brief Parent class for audio decoders.
  */
 
+
 #ifndef DCPOMATIC_AUDIO_DECODER_H
 #define DCPOMATIC_AUDIO_DECODER_H
 
-#include "decoder.h"
-#include "content_audio.h"
+
 #include "audio_stream.h"
+#include "decoder.h"
 #include "decoder_part.h"
-#include <boost/enable_shared_from_this.hpp>
+#include "piece_audio.h"
 #include <boost/signals2.hpp>
 
+
 class AudioBuffers;
 class AudioContent;
 class AudioDecoderStream;
@@ -39,37 +42,32 @@ class Log;
 class Film;
 class Resampler;
 
+
 /** @class AudioDecoder.
  *  @brief Parent class for audio decoders.
  */
-class AudioDecoder : public boost::enable_shared_from_this<AudioDecoder>, public DecoderPart
+class AudioDecoder : public std::enable_shared_from_this<AudioDecoder>, public DecoderPart
 {
 public:
-       AudioDecoder (Decoder* parent, boost::shared_ptr<const AudioContent> content, bool fast);
+       AudioDecoder (Decoder* parent, std::shared_ptr<const AudioContent> content);
 
-       dcpomatic::ContentTime position (boost::shared_ptr<const Film> film) const;
-       void emit (boost::shared_ptr<const Film> film, AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, dcpomatic::ContentTime);
+       boost::optional<dcpomatic::ContentTime> position (std::shared_ptr<const Film> film) const;
+       void emit (AudioStreamPtr stream, std::shared_ptr<const AudioBuffers>, dcpomatic::ContentTime, bool time_already_delayed = false);
        void seek ();
        void flush ();
 
-       dcpomatic::ContentTime stream_position (boost::shared_ptr<const Film> film, AudioStreamPtr stream) const;
+       dcpomatic::ContentTime stream_position (std::shared_ptr<const Film> film, AudioStreamPtr stream) const;
 
-       /** @return Number of frames of data that were accepted */
-       boost::signals2::signal<void (AudioStreamPtr, ContentAudio)> Data;
+       boost::signals2::signal<void (AudioStreamPtr, std::shared_ptr<const AudioBuffers>, Frame)> Data;
 
 private:
        void silence (int milliseconds);
 
-       boost::shared_ptr<const AudioContent> _content;
-       /** Frame after the last one that was emitted from Data (i.e. at the resampled rate, if applicable)
-        *  for each AudioStream.
-        */
+       std::shared_ptr<const AudioContent> _content;
+       /** Frame after the last one that was emitted from Data 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