X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_decoder.h;h=a4b74e2eae011cec3379e4520137504f381fdb6d;hb=89aa9d4ba69e471949f791cdafe4ae20cea554d2;hp=2415bd6ac15f3131cb2da05621cb416b64719994;hpb=fb607fb660317fcce15320c2ec7db78d85a43f41;p=dcpomatic.git diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 2415bd6ac..a4b74e2ea 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -28,7 +28,9 @@ #include "decoder.h" #include "content_audio.h" #include "audio_stream.h" +#include "decoder_part.h" #include +#include class AudioBuffers; class AudioContent; @@ -38,30 +40,19 @@ class Log; /** @class AudioDecoder. * @brief Parent class for audio decoders. */ -class AudioDecoder : public boost::enable_shared_from_this +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, boost::shared_ptr log); - /** Try to fetch some audio from a specific place in this content. - * @param frame Frame to start from (after resampling, if applicable) - * @param length Frames to get (after resampling, if applicable) - * @param accurate true to try hard to return frames from exactly `frame', false if we don't mind nearby frames. - * @return Time-stamped audio data which may or may not be from the location (and of the length) requested. - */ - ContentAudio get (AudioStreamPtr stream, Frame time, Frame length, bool accurate); + ContentTime position () const; + void emit (AudioStreamPtr stream, boost::shared_ptr, ContentTime); + void seek (); - void set_ignore (); - void set_fast (); - - void give (AudioStreamPtr stream, boost::shared_ptr, ContentTime); - void flush (); - void seek (ContentTime t, bool accurate); + boost::signals2::signal Data; private: - /** An AudioDecoderStream object to manage each stream in _audio_content */ - std::map > _streams; - bool _ignore; + std::map _positions; }; #endif