X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_decoder.h;h=d81a1c7c804eaef70e0444bc19c06c86c16ebcb1;hb=a16523af5f70b60f4890f198f6214177077a9c1d;hp=68e99608fb2b42c2631d718018a59ebd8af685f5;hpb=e11276a822289d7d7d91a4f431f386ad28ef16dd;p=dcpomatic.git diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 68e99608f..d81a1c7c8 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,24 +45,31 @@ class Log; class AudioDecoder : public boost::enable_shared_from_this, public DecoderPart { public: - AudioDecoder (Decoder* parent, boost::shared_ptr, boost::shared_ptr log); + AudioDecoder (Decoder* parent, boost::shared_ptr content, bool fast); - boost::optional position () const; - void set_position (AudioStreamPtr stream, ContentTime position); - - void set_fast (); + boost::optional position (boost::shared_ptr film) const; + void emit (boost::shared_ptr film, AudioStreamPtr stream, boost::shared_ptr, dcpomatic::ContentTime); + void seek (); void flush (); - void emit (AudioStreamPtr stream, boost::shared_ptr, ContentTime); + dcpomatic::ContentTime stream_position (boost::shared_ptr film, AudioStreamPtr stream) const; + /** @return Number of frames of data that were accepted */ boost::signals2::signal Data; - boost::optional position () const; - private: - /** An AudioDecoderStream object to manage each stream in _audio_content */ - std::map > _streams; - 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