diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-05 04:18:38 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-05 04:18:38 (GMT) |
commit | 5989d15f73da71b69a27129349a07a15954a8853 (patch) | |
tree | 9bfc7bb98b2074b79291c1e477d8fce77d843ebb /examples/multimedia/audioinput | |
parent | c416d0d026377a5c8659abbd12cb4a8eab7c7264 (diff) | |
download | Qt-5989d15f73da71b69a27129349a07a15954a8853.zip Qt-5989d15f73da71b69a27129349a07a15954a8853.tar.gz Qt-5989d15f73da71b69a27129349a07a15954a8853.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 'examples/multimedia/audioinput')
-rw-r--r-- | examples/multimedia/audioinput/audioinput.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index 3d537a2..62afd73 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -170,7 +170,7 @@ InputTest::InputTest() layout->addWidget(canvas); deviceBox = new QComboBox(this); - QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput); + QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput); for(int i = 0; i < devices.size(); ++i) { deviceBox->addItem(devices.at(i).deviceName(), qVariantFromValue(devices.at(i))); } @@ -216,7 +216,7 @@ InputTest::~InputTest() {} void InputTest::status() { - qWarning()<<"bytesReady = "<<audioInput->bytesReady()<<" bytes, clock = "<<audioInput->clock()/1000<<"ms, totalTime = "<<audioInput->totalTime()/1000<<"ms"; + qWarning()<<"bytesReady = "<<audioInput->bytesReady()<<" bytes, elapsedUSecs = "<<audioInput->elapsedUSecs()<<", processedUSecs = "<<audioInput->processedUSecs(); } void InputTest::readMore() @@ -239,7 +239,7 @@ void InputTest::toggleMode() if (pullMode) { button->setText(tr("Click for Pull Mode")); - input = audioInput->start(0); + input = audioInput->start(); connect(input,SIGNAL(readyRead()),SLOT(readMore())); pullMode = false; } else { @@ -252,7 +252,7 @@ void InputTest::toggleMode() void InputTest::toggleSuspend() { // toggle suspend/resume - if(audioInput->state() == QAudio::SuspendState) { + if(audioInput->state() == QAudio::SuspendedState) { qWarning()<<"status: Suspended, resume()"; audioInput->resume(); button2->setText("Click To Suspend"); @@ -260,7 +260,7 @@ void InputTest::toggleSuspend() qWarning()<<"status: Active, suspend()"; audioInput->suspend(); button2->setText("Click To Resume"); - } else if (audioInput->state() == QAudio::StopState) { + } else if (audioInput->state() == QAudio::StoppedState) { qWarning()<<"status: Stopped, resume()"; audioInput->resume(); button2->setText("Click To Suspend"); |