diff plugin/plugins/SamplePlayer.cpp @ 1359:1c9bbbb6116a 3.0-integration

Use W64 instead of WAV for decoded files; use Ogg reader in preference to WAV one for Ogg files (WAV reader works, via libsndfile, but doesn't load metadata); fix Ogg reader to use QFile open instead of non-Win32-compatible API; add more encoder tests, audio writer test, midi reader test
author Chris Cannam
date Tue, 10 Jan 2017 10:58:25 +0000
parents 63b73a21bccd
children 49b43306778b
line wrap: on
line diff
--- a/plugin/plugins/SamplePlayer.cpp	Mon Jan 09 18:51:42 2017 +0000
+++ b/plugin/plugins/SamplePlayer.cpp	Tue Jan 10 10:58:25 2017 +0000
@@ -29,6 +29,11 @@
 #include <QDir>
 #include <QFileInfo>
 
+#ifdef Q_OS_WIN
+#include <windows.h>
+#define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1
+#endif
+
 #include <sndfile.h>
 #include <samplerate.h>
 #include <iostream>
@@ -395,7 +400,11 @@
     size_t i;
 
     info.format = 0;
+#ifdef Q_OS_WIN
+    file = sf_wchar_open((LPCWSTR)path.utf16(), SFM_READ, &m_fileInfo);
+#else
     file = sf_open(path.toLocal8Bit().data(), SFM_READ, &info);
+#endif
     if (!file) {
 	cerr << "SamplePlayer::loadSampleData: Failed to open file "
 		  << path << ": "