/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-#include <sndfile.h>
#include "decoder.h"
#include "audio_decoder.h"
-#include "stream.h"
+#include "audio_examiner.h"
+#include "sndfile_base.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<SndfileStream> create ();
- static boost::shared_ptr<SndfileStream> create (std::string t, boost::optional<int> v);
+class SndfileContent;
-private:
- friend class stream_test;
-
- SndfileStream ();
- SndfileStream (std::string t, boost::optional<int> v);
-};
-
-class SndfileDecoder : public AudioDecoder
+class SndfileDecoder : public Sndfile, public AudioDecoder
{
public:
- SndfileDecoder (boost::shared_ptr<Film>, DecodeOptions);
+ SndfileDecoder (boost::shared_ptr<const SndfileContent> c);
~SndfileDecoder ();
- bool pass ();
-
private:
- std::vector<SNDFILE*> _sndfiles;
- sf_count_t _done;
- sf_count_t _frames;
+ bool pass (PassReason);
+ void seek (ContentTime, bool);
+
+ int64_t _done;
+ int64_t _remaining;
+ float* _deinterleave_buffer;
};