X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_decoder.h;h=8765be42674c3fd8a41323c5bf865dfdab2d7071;hb=dffc146e5387a0b3f7a671d845d6c3051b0e7067;hp=a4b74e2eae011cec3379e4520137504f381fdb6d;hpb=89aa9d4ba69e471949f791cdafe4ae20cea554d2;p=dcpomatic.git diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index a4b74e2ea..8765be426 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,7 @@ class AudioBuffers; class AudioContent; class AudioDecoderStream; class Log; +class Resampler; /** @class AudioDecoder. * @brief Parent class for audio decoders. @@ -43,16 +44,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, boost::shared_ptr log, bool fast); ContentTime position () const; void emit (AudioStreamPtr stream, boost::shared_ptr, ContentTime); void seek (); + void flush (); + ContentTime stream_position (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