X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Faudio_decoder.h;h=50e361e8f19f80cb181bc8a55d3e80f1aa73da8c;hp=25d858681eea36e6e4ed0f6605526f88a37c49d2;hb=254b3044d72de6b033d7c584f5abd2b9aa70aad5;hpb=3350e8134ec419ca561d3e596c510fbfe0e071d5 diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 25d858681..50e361e8f 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. @@ -36,6 +36,8 @@ class AudioBuffers; class AudioContent; class AudioDecoderStream; class Log; +class Film; +class Resampler; /** @class AudioDecoder. * @brief Parent class for audio decoders. @@ -43,16 +45,31 @@ class Log; class AudioDecoder : public boost::enable_shared_from_this, public DecoderPart { public: - AudioDecoder (Decoder* parent, boost::shared_ptr content, boost::shared_ptr log); + AudioDecoder (Decoder* parent, boost::shared_ptr content, bool fast); - ContentTime position () const; - void emit (AudioStreamPtr stream, boost::shared_ptr, ContentTime); + ContentTime position (boost::shared_ptr film) const; + void emit (boost::shared_ptr film, AudioStreamPtr stream, boost::shared_ptr, ContentTime); void seek (); + void flush (); + ContentTime stream_position (boost::shared_ptr film, AudioStreamPtr stream) const; + + /** @return Number of frames of data that were accepted */ boost::signals2::signal Data; private: - std::map _positions; + void silence (int milliseconds); + + boost::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