X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_decoder.h;h=2b6e3f75879889e4e7b713a8b119b3179d0bdb23;hb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;hp=a4b74e2eae011cec3379e4520137504f381fdb6d;hpb=89aa9d4ba69e471949f791cdafe4ae20cea554d2;p=dcpomatic.git diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index a4b74e2ea..2b6e3f758 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington + Copyright (C) 2012-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -29,30 +29,45 @@ #include "content_audio.h" #include "audio_stream.h" #include "decoder_part.h" -#include #include class AudioBuffers; class AudioContent; class AudioDecoderStream; class Log; +class Film; +class Resampler; /** @class AudioDecoder. * @brief Parent class for audio decoders. */ -class AudioDecoder : public boost::enable_shared_from_this, public DecoderPart +class AudioDecoder : public std::enable_shared_from_this, public DecoderPart { public: - AudioDecoder (Decoder* parent, boost::shared_ptr content, boost::shared_ptr log); + AudioDecoder (Decoder* parent, std::shared_ptr content, bool fast); - ContentTime position () const; - void emit (AudioStreamPtr stream, boost::shared_ptr, ContentTime); + boost::optional position (std::shared_ptr film) const; + void emit (std::shared_ptr film, AudioStreamPtr stream, std::shared_ptr, dcpomatic::ContentTime, bool time_already_delayed = false); void seek (); + void flush (); + + dcpomatic::ContentTime stream_position (std::shared_ptr film, AudioStreamPtr stream) const; boost::signals2::signal Data; private: - std::map _positions; + void silence (int milliseconds); + + std::shared_ptr _content; + /** Frame after the last one that was emitted from Data (i.e. at the resampled rate, if applicable) + * for each AudioStream. + */ + typedef std::map PositionMap; + PositionMap _positions; + typedef std::map > ResamplerMap; + ResamplerMap _resamplers; + + bool _fast; }; #endif