Add debug option to log SMTP session transcripts.
[dcpomatic.git] / src / lib / sndfile_decoder.h
index e16eab6731e2f23d4bc32e9f4e6dfd1a8c2fced7..da9016ee09a958c26211df60e4ae68b6a1d9620d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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 "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);
-
-private:
-       friend class stream_test;
-       
-       SndfileStream ();
-       SndfileStream (std::string t, boost::optional<int> v);
-};
+class SndfileContent;
 
-class SndfileDecoder : public AudioDecoder
+class SndfileDecoder : public Sndfile, public AudioDecoder
 {
 public:
-       SndfileDecoder (boost::shared_ptr<Film>, DecodeOptions);
+       SndfileDecoder (boost::shared_ptr<const SndfileContent> c, bool fast);
+       ~SndfileDecoder ();
 
+private:
        bool pass ();
+       void seek (ContentTime, bool);
 
-private:
-       std::vector<SNDFILE*> open_files (sf_count_t &);
-       void close_files (std::vector<SNDFILE*> const &);
+       int64_t _done;
+       int64_t _remaining;
+       float* _deinterleave_buffer;
 };