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 | |
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')
-rw-r--r-- | examples/multimedia/audiodevices/audiodevices.cpp | 2 | ||||
-rw-r--r-- | examples/multimedia/audioinput/audioinput.cpp | 10 | ||||
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.cpp | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp index 4198605..e205e03 100644 --- a/examples/multimedia/audiodevices/audiodevices.cpp +++ b/examples/multimedia/audiodevices/audiodevices.cpp @@ -148,7 +148,7 @@ void AudioTest::modeChanged(int idx) mode=QAudio::AudioOutput; deviceBox->clear(); - foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(mode)) + foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(mode)) deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); } 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"); diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index c92bbaf..244840d 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -134,7 +134,7 @@ AudioTest::AudioTest() QVBoxLayout* layout = new QVBoxLayout; deviceBox = new QComboBox(this); - foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(QAudio::AudioOutput)) + foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); layout->addWidget(deviceBox); @@ -200,7 +200,7 @@ void AudioTest::deviceChanged(int idx) void AudioTest::status() { - qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, clock = "<<audioOutput->clock()/1000<<"ms, totalTime = "<<audioOutput->totalTime()/1000<<"ms"; + qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, elapsedUSecs = "<<audioOutput->elapsedUSecs()<<", processedUSecs = "<<audioOutput->processedUSecs(); } void AudioTest::writeMore() @@ -208,7 +208,7 @@ void AudioTest::writeMore() if(!audioOutput) return; - if(audioOutput->state() == QAudio::StopState) + if(audioOutput->state() == QAudio::StoppedState) return; int l; @@ -234,7 +234,7 @@ void AudioTest::toggle() if (pullMode) { button->setText("Click for Pull Mode"); - output = audioOutput->start(0); + output = audioOutput->start(); pullMode = false; timer->start(20); } else { @@ -247,7 +247,7 @@ void AudioTest::toggle() void AudioTest::togglePlay() { // toggle suspend/resume - if(audioOutput->state() == QAudio::SuspendState) { + if(audioOutput->state() == QAudio::SuspendedState) { qWarning()<<"status: Suspended, resume()"; audioOutput->resume(); button2->setText("Click To Suspend"); @@ -255,7 +255,7 @@ void AudioTest::togglePlay() qWarning()<<"status: Active, suspend()"; audioOutput->suspend(); button2->setText("Click To Resume"); - } else if (audioOutput->state() == QAudio::StopState) { + } else if (audioOutput->state() == QAudio::StoppedState) { qWarning()<<"status: Stopped, resume()"; audioOutput->resume(); button2->setText("Click To Suspend"); |