aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-08-06 12:08:03 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-08-06 12:08:03 +0000
commitc41f44356491c77aa9a5e8083e7135e50ee753ea (patch)
treee84b4e383ff6791d455fd4bfa84610fde3b40121 /src/plugins
parent58c80be840c049f7ffa3b82e2bd1a27e66ec9f8e (diff)
downloadqmmp-c41f44356491c77aa9a5e8083e7135e50ee753ea.tar.gz
qmmp-c41f44356491c77aa9a5e8083e7135e50ee753ea.tar.bz2
qmmp-c41f44356491c77aa9a5e8083e7135e50ee753ea.zip
fixed windows build
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2294 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Output/waveout/outputwaveout.cpp40
-rw-r--r--src/plugins/Output/waveout/outputwaveout.h3
2 files changed, 22 insertions, 21 deletions
diff --git a/src/plugins/Output/waveout/outputwaveout.cpp b/src/plugins/Output/waveout/outputwaveout.cpp
index e4263208f..f95100aac 100644
--- a/src/plugins/Output/waveout/outputwaveout.cpp
+++ b/src/plugins/Output/waveout/outputwaveout.cpp
@@ -94,8 +94,13 @@ OutputWaveOut::~OutputWaveOut()
uninitialize();
}
-void OutputWaveOut::configure(quint32 freq, int chan, Qmmp::AudioFormat format)
+bool OutputWaveOut::initialize(quint32 freq, int chan, Qmmp::AudioFormat format)
{
+ if (!waveOutGetNumDevs ())
+ {
+ qWarning("OutputWaveOut: no audio device found");
+ return false;
+ }
WAVEFORMATEX fmt;
UINT deviceID = WAVE_MAPPER;
@@ -109,36 +114,33 @@ void OutputWaveOut::configure(quint32 freq, int chan, Qmmp::AudioFormat format)
switch (waveOutOpen (&dev, deviceID, &fmt, (DWORD)wave_callback, 0, CALLBACK_FUNCTION))
{
case MMSYSERR_ALLOCATED:
- return qWarning("OutputWaveOut: Device is already open.");
+ qWarning("OutputWaveOut: Device is already open.");
+ return false;
case MMSYSERR_BADDEVICEID:
- return qWarning("OutputWaveOut: The specified device is out of range.");
+ qWarning("OutputWaveOut: The specified device is out of range.");
+ return false;
case MMSYSERR_NODRIVER:
- return qWarning("OutputWaveOut: There is no audio driver in this system.");
+ qWarning("OutputWaveOut: There is no audio driver in this system.");
+ return false;
case MMSYSERR_NOMEM:
- return qWarning("OutputWaveOut: Unable to allocate sound memory.");
+ qWarning("OutputWaveOut: Unable to allocate sound memory.");
+ return false;
case WAVERR_BADFORMAT:
- return qWarning("OutputWaveOut: This audio format is not supported.");
+ qWarning("OutputWaveOut: This audio format is not supported.");
+ return false;
case WAVERR_SYNC:
- return qWarning("OutputWaveOut: The device is synchronous.");
+ qWarning("OutputWaveOut: The device is synchronous.");
+ return false;
default:
- return qWarning("OutputWaveOut: Unknown media error.");
+ qWarning("OutputWaveOut: Unknown media error.");
+ return false;
case MMSYSERR_NOERROR:
break;
}
waveOutReset (dev);
InitializeCriticalSection ( &cs );
- Output::configure(freq, chan, format);
- return;
-}
-
-bool OutputWaveOut::initialize()
-{
- if (!waveOutGetNumDevs ())
- {
- qWarning("OutputWaveOut: no audio device found");
- return false;
- }
+ configure(freq, chan, format);
return true;
}
diff --git a/src/plugins/Output/waveout/outputwaveout.h b/src/plugins/Output/waveout/outputwaveout.h
index a0292335e..2d019ef6e 100644
--- a/src/plugins/Output/waveout/outputwaveout.h
+++ b/src/plugins/Output/waveout/outputwaveout.h
@@ -36,8 +36,7 @@ public:
OutputWaveOut(QObject * parent = 0);
~OutputWaveOut();
- bool initialize();
- void configure(quint32, int, Qmmp::AudioFormat format);
+ bool initialize(quint32, int, Qmmp::AudioFormat format);
qint64 latency();
private: