X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsndfile_decoder.h;h=52590ef24a3b99bc841edff4687b2a97ced69a9c;hb=73f52e94953848c696725defd3d7f5c4c30707e2;hp=9489cb5ec5b56e4a6b076ff0da1360e643a19734;hpb=a8d24d35dc999228f804ed425c0d9e90b9ddceaa;p=dcpomatic.git diff --git a/src/lib/sndfile_decoder.h b/src/lib/sndfile_decoder.h index 9489cb5ec..52590ef24 100644 --- a/src/lib/sndfile_decoder.h +++ b/src/lib/sndfile_decoder.h @@ -20,37 +20,28 @@ #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 c); ~SndfileDecoder (); - bool pass (); + void seek (ContentTime, bool); + + int audio_channels () const; + ContentTime audio_length () const; + int audio_frame_rate () const; private: - std::vector _sndfiles; - sf_count_t _done; - sf_count_t _frames; + bool pass (); + + boost::shared_ptr _sndfile_content; + SNDFILE* _sndfile; + SF_INFO _info; + int64_t _done; + int64_t _remaining; + float* _deinterleave_buffer; };