summaryrefslogtreecommitdiffstats
path: root/src/sources/soundsourcesndfile.h
diff options
context:
space:
mode:
authorUwe Klotz <uwe_klotz@web.de>2015-02-27 20:49:09 +0100
committerUwe Klotz <uwe_klotz@web.de>2015-02-28 00:54:03 +0100
commit647c53b2e0439120866dfa94c4e5722df0bdebfa (patch)
tree79946b00e88d638af30702d850a26d6c9f706c38 /src/sources/soundsourcesndfile.h
parentca21d94521f21ba6be1138d7e0ed3601b36f3548 (diff)
Move code from specialized AudioSources back into corresponding SoundSources
Diffstat (limited to 'src/sources/soundsourcesndfile.h')
-rw-r--r--src/sources/soundsourcesndfile.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/sources/soundsourcesndfile.h b/src/sources/soundsourcesndfile.h
index 3e32a4f208..f93f06b59b 100644
--- a/src/sources/soundsourcesndfile.h
+++ b/src/sources/soundsourcesndfile.h
@@ -1,15 +1,38 @@
-#ifndef SOUNDSOURCESNDFILE_H
-#define SOUNDSOURCESNDFILE_H
+#ifndef MIXXX_SOUNDSOURCESNDFILE_H
+#define MIXXX_SOUNDSOURCESNDFILE_H
#include "sources/soundsource.h"
+#ifdef Q_OS_WIN
+//Enable unicode in libsndfile on Windows
+//(sf_open uses UTF-8 otherwise)
+#include <windows.h>
+#define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1
+#endif
+#include <sndfile.h>
+
+namespace Mixxx {
+
class SoundSourceSndFile: public Mixxx::SoundSource {
public:
static QList<QString> supportedFileExtensions();
explicit SoundSourceSndFile(QUrl url);
+ ~SoundSourceSndFile();
+
+ Result open() /*override*/;
+ void close() /*override*/;
- Mixxx::AudioSourcePointer open() const /*override*/;
+ SINT seekSampleFrame(SINT frameIndex) /*override*/;
+
+ SINT readSampleFrames(SINT numberOfFrames,
+ CSAMPLE* sampleBuffer) /*override*/;
+
+private:
+ SNDFILE* m_pSndFile;
+ SF_INFO m_sfInfo;
};
-#endif
+} // namespace Mixxx
+
+#endif // MIXXX_SOUNDSOURCESNDFILE_H