Added volume property to QMediaRecorder

Change-Id: I19f727107651c9f640ca1c010a3764f05aef8820
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Dmytro Poplavskiy
2012-05-21 12:09:50 +10:00
committed by Qt by Nokia
parent 0d0e89b1e8
commit 36ff2fe85e
14 changed files with 147 additions and 4 deletions

View File

@@ -76,6 +76,7 @@ private slots:
void testSink();
void testRecord();
void testMute();
void testVolume();
void testAudioDeviceControl();
void testAudioEncodeControl();
void testMediaFormatsControl();
@@ -373,6 +374,26 @@ void tst_QMediaRecorder::testMute()
QCOMPARE(mutedChanged.size(), 2);
}
void tst_QMediaRecorder::testVolume()
{
QSignalSpy volumeChanged(capture, SIGNAL(volumeChanged(qreal)));
QCOMPARE(capture->volume(), 1.0);
capture->setVolume(2.0);
QCOMPARE(volumeChanged.size(), 1);
QCOMPARE(volumeChanged[0][0].toReal(), 2.0);
QCOMPARE(capture->volume(), 2.0);
capture->setVolume(1.0);
QCOMPARE(volumeChanged.size(), 2);
QCOMPARE(volumeChanged[1][0].toReal(), 1.0);
QCOMPARE(capture->volume(), 1.0);
capture->setVolume(1.0);
QCOMPARE(volumeChanged.size(), 2);
}
void tst_QMediaRecorder::testAudioDeviceControl()
{
QSignalSpy readSignal(audio,SIGNAL(activeEndpointChanged(QString)));