Added check to qsound and qsoundeffect unit tests for audio support
- skip tests if QSoundEffect::supportedMimeTypes() returns empty list Change-Id: I0f8d6f854c46b74f8518c4d969bd31ea167d20b2 Reviewed-by: Ling Hu <ling.hu@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
86553ef811
commit
a6e88ea87f
@@ -89,6 +89,11 @@ void QSoundEffectPrivate::release()
|
||||
|
||||
QStringList QSoundEffectPrivate::supportedMimeTypes()
|
||||
{
|
||||
// Only return supported mime types if we have a audio device available
|
||||
const QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
|
||||
if (devices.size() <= 0)
|
||||
return QStringList();
|
||||
|
||||
return QStringList() << QLatin1String("audio/x-wav")
|
||||
<< QLatin1String("audio/wav")
|
||||
<< QLatin1String("audio/wave")
|
||||
|
||||
Reference in New Issue
Block a user