diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp | 30 | ||||
-rw-r--r-- | src/plugins/windowsaudio/windowsaudio.pro | 3 |
2 files changed, 32 insertions, 1 deletions
diff --git a/src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp b/src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp index d37056a5f..98c161ae5 100644 --- a/src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp +++ b/src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp @@ -412,6 +412,7 @@ QList<QByteArray> QWindowsAudioDeviceInfo::availableDevices(QAudio::Mode mode) Q_UNUSED(mode) QList<QByteArray> devices; +#ifndef Q_OS_WINCE //enumerate device fullnames through directshow api CoInitialize(NULL); ICreateDevEnum *pDevEnum = NULL; @@ -463,6 +464,35 @@ QList<QByteArray> QWindowsAudioDeviceInfo::availableDevices(QAudio::Mode mode) } } CoUninitialize(); +#else // Q_OS_WINCE + if (mode == QAudio::AudioOutput) { + WAVEOUTCAPS woc; + unsigned long iNumDevs,i; + iNumDevs = waveOutGetNumDevs(); + for (i=0;i<iNumDevs;i++) { + if (waveOutGetDevCaps(i, &woc, sizeof(WAVEOUTCAPS)) + == MMSYSERR_NOERROR) { + QByteArray device; + QDataStream ds(&device, QIODevice::WriteOnly); + ds << quint32(i) << QString::fromWCharArray(woc.szPname); + devices.append(device); + } + } + } else { + WAVEINCAPS woc; + unsigned long iNumDevs,i; + iNumDevs = waveInGetNumDevs(); + for (i=0;i<iNumDevs;i++) { + if (waveInGetDevCaps(i, &woc, sizeof(WAVEINCAPS)) + == MMSYSERR_NOERROR) { + QByteArray device; + QDataStream ds(&device, QIODevice::WriteOnly); + ds << quint32(i) << QString::fromWCharArray(woc.szPname); + devices.append(device); + } + } + } +#endif // !Q_OS_WINCE return devices; } diff --git a/src/plugins/windowsaudio/windowsaudio.pro b/src/plugins/windowsaudio/windowsaudio.pro index a1a327953..ead73251b 100644 --- a/src/plugins/windowsaudio/windowsaudio.pro +++ b/src/plugins/windowsaudio/windowsaudio.pro @@ -5,7 +5,8 @@ PLUGIN_TYPE = audio PLUGIN_CLASS_NAME = QWindowsAudioPlugin load(qt_plugin) -LIBS += -lwinmm -lstrmiids -lole32 -loleaut32 +LIBS += -lstrmiids -lole32 -loleaut32 +!wince*:LIBS += -lwinmm HEADERS += \ qwindowsaudioplugin.h \ |