Add new implementation of QSound class
Added a re-implementation of QSound, using functionality derived from QSoundEffect. QSound API remains the same as the original 4.x version. It offers both a static interface (with auto resource cleanup on sound completion), as well as an object instance interface for more detailed control. Change-Id: I85c00dd88547f8dea9b1e1ef2da31d2f2e28a172 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
c13a13c486
commit
f9ec11a25e
@@ -106,16 +106,20 @@ void tst_QSoundEffect::testSource()
|
||||
|
||||
void tst_QSoundEffect::testLooping()
|
||||
{
|
||||
QSignalSpy readSignal(sound, SIGNAL(loopCountChanged()));
|
||||
QSignalSpy readSignal_Count(sound, SIGNAL(loopCountChanged()));
|
||||
QSignalSpy readSignal_Remaining(sound, SIGNAL(loopsRemainingChanged()));
|
||||
|
||||
sound->setLoopCount(5);
|
||||
QCOMPARE(sound->loopCount(),5);
|
||||
QCOMPARE(readSignal_Count.count(),1);
|
||||
|
||||
sound->play();
|
||||
|
||||
// test.wav is about 200ms, wait until it has finished playing 5 times
|
||||
QTest::qWait(3000);
|
||||
|
||||
QCOMPARE(sound->loopsRemaining(), 0);
|
||||
QCOMPARE(readSignal_Remaining.count(),5);
|
||||
}
|
||||
|
||||
void tst_QSoundEffect::testVolume()
|
||||
|
||||
Reference in New Issue
Block a user