Restore QWindowsAudio support on wince.
Enabled Audio playback with wave device on WindowsCE again. Change-Id: Ic7749821ef8f991a909cbeb29083219ea988f5dc Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
committed by
Yoann Lopes
parent
20da381608
commit
b3c2dca466
@@ -38,8 +38,11 @@
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
#include <wmp.h>
|
||||
#else
|
||||
#include <wmpcore.h>
|
||||
#endif
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
|
||||
@@ -3,4 +3,5 @@ CONFIG += console
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
LIBS += -lstrmiids -lole32 -lOleaut32 -luser32 -lgdi32
|
||||
LIBS += -lstrmiids -lole32 -lOleaut32
|
||||
!wince*:LIBS += -luser32 -lgdi32
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user