diff options
author | Otto Ryynänen <otto.ryynanen@qt.io> | 2018-05-23 09:10:34 +0300 |
---|---|---|
committer | Otto Ryynänen <otto.ryynanen@qt.io> | 2018-10-30 09:18:56 +0000 |
commit | 3ee6d65377cb563d49d81c3adac0523e4ae8a0b9 (patch) | |
tree | d06d1378c5679315aa6e9d53626f14f17341f04f /tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp | |
parent | 023c48830386566042497bfac2a01c713bc5423b (diff) |
Add a support for selecting the output device used by QSoundEffect
The QSoundEffect can be forced to use a specific audio output device.
This is useful on a system with multiple output devices as individual
QSoundeffects can use separate output devices.
Due to way QAudioOutput (alternate implementation behind QSoundEffect)
is implemented, QAudioDeviceInfo is used as a method of defining
the output device to be used.
Task-number: QTBUG-63596
Change-Id: Ibfb9894fec914726faee4e31c42ab08832693cf6
Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
Diffstat (limited to 'tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp')
-rw-r--r-- | tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp index fa98c8b16..7cbd57007 100644 --- a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp +++ b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp @@ -60,6 +60,7 @@ private slots: void testSetSourceWhileLoading(); void testSetSourceWhilePlaying(); + void testSupportedMimeTypes_data(); void testSupportedMimeTypes(); void testCorruptFile(); void testPlaying24Bits(); @@ -387,9 +388,19 @@ void tst_QSoundEffect::testSetSourceWhilePlaying() } } +void tst_QSoundEffect::testSupportedMimeTypes_data() +{ + // Verify also passing of audio device info as parameter + QTest::addColumn<QSoundEffect*>("instance"); + QTest::newRow("without QAudioDeviceInfo") << sound; + QAudioDeviceInfo deviceInfo(QAudioDeviceInfo::defaultOutputDevice()); + QTest::newRow("with QAudioDeviceInfo") << new QSoundEffect(deviceInfo, this); +} + void tst_QSoundEffect::testSupportedMimeTypes() { - QStringList mimeTypes = sound->supportedMimeTypes(); + QFETCH(QSoundEffect*, instance); + QStringList mimeTypes = instance->supportedMimeTypes(); QVERIFY(!mimeTypes.empty()); QVERIFY(mimeTypes.indexOf(QLatin1String("audio/wav")) != -1 || mimeTypes.indexOf(QLatin1String("audio/x-wav")) != -1 || |