Another try at sorting out the thorny question of timing.
[dcpomatic.git] / src / lib / audio_decoder.h
index 1da8a676f37c7f59c3deeb46a166829e60ff1687..ddfb296c9a9b4fffbf8e2b94928594907566fb68 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"
 
-class AudioContent;
+class AudioBuffers;
 
 /** @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 Film>);
 
-protected:
-
-       void audio (boost::shared_ptr<const AudioBuffers>, Time);
-       bool audio_done () const;
+       /** Emitted when some audio data is ready */
+       boost::signals2::signal<void (boost::shared_ptr<const AudioBuffers>, AudioContent::Frame)> Audio;
 
-       Time _next_audio;
-       boost::shared_ptr<const AudioContent> _audio_content;
+protected:
 
-private:       
-       SwrContext* _swr_context;
+       void audio (boost::shared_ptr<const AudioBuffers>, AudioContent::Frame);
+       AudioContent::Frame _audio_position;
 };
 
 #endif