Merge master.
[dcpomatic.git] / src / lib / audio_decoder.h
index 1da8a676f37c7f59c3deeb46a166829e60ff1687..35d9f3560b7d55565ddc3eb8cf9b17e1bebe4ac7 100644 (file)
 #ifndef DCPOMATIC_AUDIO_DECODER_H
 #define DCPOMATIC_AUDIO_DECODER_H
 
-#include "audio_source.h"
 #include "decoder.h"
-extern "C" {
-#include <libswresample/swresample.h>
-}
+#include "content.h"
+#include "audio_content.h"
+#include "decoded.h"
 
-class AudioContent;
+class AudioBuffers;
+class Resampler;
 
 /** @class AudioDecoder.
  *  @brief Parent class for audio decoders.
  */
-class AudioDecoder : public AudioSource, public virtual Decoder
+class AudioDecoder : public virtual Decoder
 {
 public:
-       AudioDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const AudioContent>);
-       ~AudioDecoder ();
-
+       AudioDecoder (boost::shared_ptr<const AudioContent>);
+       
+       boost::shared_ptr<const AudioContent> audio_content () const {
+               return _audio_content;
+       }
+
+       void seek (ContentTime time, bool accurate);
+       
 protected:
 
-       void audio (boost::shared_ptr<const AudioBuffers>, Time);
-       bool audio_done () const;
+       void audio (boost::shared_ptr<const AudioBuffers>, ContentTime);
+       void flush ();
 
-       Time _next_audio;
        boost::shared_ptr<const AudioContent> _audio_content;
-
-private:       
-       SwrContext* _swr_context;
+       boost::shared_ptr<Resampler> _resampler;
+       boost::optional<ContentTime> _audio_position;
 };
 
 #endif