summaryrefslogtreecommitdiff
path: root/tests/auto/integration
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2017-10-10 13:24:27 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-05-08 10:17:11 +0000
commita0049de16d9e2a92b8d31b1ee6943c994ffdf7d2 (patch)
tree6a52972230451f4f7d27cd73dcab42afae827216 /tests/auto/integration
parent0675d111de8bb1b96bfceeaa13448595b06b9e7c (diff)
downloadqtmultimedia-a0049de16d9e2a92b8d31b1ee6943c994ffdf7d2.tar.gz
Fix adjusting volume for default device
Using WAVE_MAPPER device id (which points to default device) is not possible to get and initialize a mixer object to set volume. Function mixerGetID() does not support WAVE_MAPPER as a device id yet. Since we do not know device number anymore needs to call waveInOpen() first and after that initialize mixer controls using hWaveIn handler. - Fixed default volume from 0.0f -> 1.0f. - Before QWindowsAudioInput::start() is called, use cached volume. - After QWindowsAudioInput::start(), mixer controls are initialized. - QWindowsAudioInput::stop() deinitializes mixer controls. Task-number: QTBUG-61920 Change-Id: I5a94dad282618fb4a2e0f75c34008ca002bd1aeb Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'tests/auto/integration')
-rw-r--r--tests/auto/integration/qaudioinput/tst_qaudioinput.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp b/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp
index 14023f229..64e872f27 100644
--- a/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp
+++ b/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp
@@ -887,6 +887,12 @@ void tst_QAudioInput::volume()
QTest::qWait(500);
QTRY_VERIFY(qRound(audioInput.volume()*10.0f) == 10);
+ audioInput.setVolume(half);
+ audioInput.start();
+ QTRY_VERIFY(qRound(audioInput.volume()*10.0f) == 5);
+ audioInput.setVolume(one);
+ QTRY_VERIFY(qRound(audioInput.volume()*10.0f) == 10);
+
audioInput.setVolume(volume);
}