diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-10 03:07:46 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-10 03:07:46 (GMT) |
commit | 74d3a4bf9654c8bbe9139951cc5c9352015438a6 (patch) | |
tree | 63cc04b5546454fcf668125169c6793fcdbdf04c /tests/auto/qaudiooutput | |
parent | 8df98549a4d84b5877e50318140c2041e17632fb (diff) | |
download | Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.zip Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.tar.gz Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.tar.bz2 |
Changes to low-level audio API.
QAudioFormat::isNull() -> QAudioFormat::isValid() (inverse logic)
QAudio::SuspendState -> QAudio::SuspendedState
QAudio::StopState -> QAudio::StoppedState
QAudioDeviceInfo::deviceList() ->
QAudioDeviceInfo::availableDevices()
clock() -> elapsedUSecs()
totalTime() -> processedUSecs()
QIODevice* start(QIODevice*) -> void
start(QIODevice*), QIODevice*
start()
Reviewed-by:Justin McPherson
Diffstat (limited to 'tests/auto/qaudiooutput')
-rw-r--r-- | tests/auto/qaudiooutput/tst_qaudiooutput.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp index 26694cc..b001af1 100644 --- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp @@ -79,7 +79,7 @@ void tst_QAudioOutput::initTestCase() format.setSampleType(QAudioFormat::UnSignedInt); // Only perform tests if audio output device exists! - QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput); + QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); if(devices.size() > 0) available = true; else { @@ -140,9 +140,9 @@ void tst_QAudioOutput::pullFile() audio->setNotifyInterval(100); // Always have default states, before start - QVERIFY(audio->state() == QAudio::StoppedState); + QVERIFY(audio->state() == QAudio::StopState); QVERIFY(audio->error() == QAudio::NoError); - QVERIFY(audio->elapsedUSecs() == 0); + QVERIFY(audio->clock() == 0); audio->start(&file); QTest::qWait(20); // wait 20ms @@ -150,12 +150,12 @@ void tst_QAudioOutput::pullFile() QVERIFY(audio->state() == QAudio::ActiveState); QVERIFY(audio->error() == QAudio::NoError); QVERIFY(audio->periodSize() > 0); - QVERIFY(audio->elapsedUSecs() > 10000 && audio->elapsedUSecs() < 800000); + QVERIFY(audio->clock() > 10000 && audio->clock() < 800000); QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState // Wait until finished... QTestEventLoop::instance().enterLoop(1); - QCOMPARE(audio->processedUSecs(), qint64(692250)); + QCOMPARE(audio->totalTime(), qint64(692250)); #ifdef Q_OS_WINCE // 4.wav is a little less than 700ms, so notify should fire 4 times on Wince! @@ -166,8 +166,8 @@ void tst_QAudioOutput::pullFile() #endif audio->stop(); QTest::qWait(20); // wait 20ms - QVERIFY(audio->state() == QAudio::StoppedState); - QVERIFY(audio->elapsedUSecs() == 0); + QVERIFY(audio->state() == QAudio::StopState); + QVERIFY(audio->clock() == 0); // Can only check to make sure we got at least 1 more signal, but can be more. QVERIFY(stateSignal.count() > 1); @@ -184,7 +184,7 @@ void tst_QAudioOutput::pushFile() const qint64 fileSize = file.size(); - QIODevice* feed = audio->start(); + QIODevice* feed = audio->start(0); char* buffer = new char[fileSize]; file.read(buffer, fileSize); @@ -199,7 +199,7 @@ void tst_QAudioOutput::pushFile() QTestEventLoop::instance().enterLoop(1); QVERIFY(written == fileSize); - QVERIFY(audio->processedUSecs() == 692250); + QVERIFY(audio->totalTime() == 692250); audio->stop(); file.close(); |