X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsndfile_decoder.h;h=77fa6d17734da4096757dae504a759c9925e0e8b;hb=abc6fa5ea5877a3a4d6eb65b7819821ed99a042c;hp=9489cb5ec5b56e4a6b076ff0da1360e643a19734;hpb=a8d24d35dc999228f804ed425c0d9e90b9ddceaa;p=dcpomatic.git diff --git a/src/lib/sndfile_decoder.h b/src/lib/sndfile_decoder.h index 9489cb5ec..77fa6d177 100644 --- a/src/lib/sndfile_decoder.h +++ b/src/lib/sndfile_decoder.h @@ -20,37 +20,27 @@ #include #include "decoder.h" #include "audio_decoder.h" -#include "stream.h" -class SndfileStream : public AudioStream -{ -public: - SndfileStream (int sample_rate, int64_t layout) - : AudioStream (sample_rate, layout) - {} - - std::string to_string () const; - - static boost::shared_ptr create (); - static boost::shared_ptr create (std::string t, boost::optional v); - -private: - friend class stream_test; - - SndfileStream (); - SndfileStream (std::string t, boost::optional v); -}; +class SndfileContent; class SndfileDecoder : public AudioDecoder { public: - SndfileDecoder (boost::shared_ptr, DecodeOptions); + SndfileDecoder (boost::shared_ptr, boost::shared_ptr); ~SndfileDecoder (); - bool pass (); + void pass (); + bool done () const; + + int audio_channels () const; + AudioContent::Frame audio_length () const; + int audio_frame_rate () const; private: - std::vector _sndfiles; - sf_count_t _done; - sf_count_t _frames; + boost::shared_ptr _sndfile_content; + SNDFILE* _sndfile; + SF_INFO _info; + AudioContent::Frame _done; + AudioContent::Frame _remaining; + float* _deinterleave_buffer; };