X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_decoder.h;h=a8495aaa8b16cdd1090f09923f6f4084bc43ffa0;hb=dba7e1137282b52a1bd6ad1d56fe6371a8c97e30;hp=897ddb7e40b8253ecb54c74e4b3fb58a98d3c4ef;hpb=8798bfab1539c3ac6031bb325e1b181c58b13fc5;p=dcpomatic.git diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 897ddb7e4..a8495aaa8 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2018 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,20 +18,23 @@ */ + /** @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 "content_audio.h" +#include "decoder.h" #include "decoder_part.h" -#include #include + class AudioBuffers; class AudioContent; class AudioDecoderStream; @@ -39,36 +42,38 @@ 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, bool fast); + AudioDecoder (Decoder* parent, std::shared_ptr content, bool fast); - boost::optional position (boost::shared_ptr film) const; - void emit (boost::shared_ptr film, AudioStreamPtr stream, boost::shared_ptr, dcpomatic::ContentTime, bool time_already_delayed = false); - void seek (); + boost::optional position (std::shared_ptr film) const override; + void emit (std::shared_ptr film, AudioStreamPtr stream, std::shared_ptr, dcpomatic::ContentTime, bool time_already_delayed = false); + void seek () override; void flush (); - dcpomatic::ContentTime stream_position (boost::shared_ptr film, AudioStreamPtr stream) const; + dcpomatic::ContentTime stream_position (std::shared_ptr film, AudioStreamPtr stream) const; boost::signals2::signal Data; private: - void silence (int milliseconds); + void silence (AudioStreamPtr stream, int milliseconds); - boost::shared_ptr _content; + 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; + typedef std::map> ResamplerMap; ResamplerMap _resamplers; bool _fast; }; + #endif