summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/audiooutput/audiooutput.cpp
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2009-11-10 03:07:46 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2009-11-10 03:07:46 (GMT)
commit74d3a4bf9654c8bbe9139951cc5c9352015438a6 (patch)
tree63cc04b5546454fcf668125169c6793fcdbdf04c /examples/multimedia/audiooutput/audiooutput.cpp
parent8df98549a4d84b5877e50318140c2041e17632fb (diff)
downloadQt-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 'examples/multimedia/audiooutput/audiooutput.cpp')
-rw-r--r--examples/multimedia/audiooutput/audiooutput.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp
index 244840d..c92bbaf 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::availableDevices(QAudio::AudioOutput))
+ foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(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, elapsedUSecs = "<<audioOutput->elapsedUSecs()<<", processedUSecs = "<<audioOutput->processedUSecs();
+ qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, clock = "<<audioOutput->clock()/1000<<"ms, totalTime = "<<audioOutput->totalTime()/1000<<"ms";
}
void AudioTest::writeMore()
@@ -208,7 +208,7 @@ void AudioTest::writeMore()
if(!audioOutput)
return;
- if(audioOutput->state() == QAudio::StoppedState)
+ if(audioOutput->state() == QAudio::StopState)
return;
int l;
@@ -234,7 +234,7 @@ void AudioTest::toggle()
if (pullMode) {
button->setText("Click for Pull Mode");
- output = audioOutput->start();
+ output = audioOutput->start(0);
pullMode = false;
timer->start(20);
} else {
@@ -247,7 +247,7 @@ void AudioTest::toggle()
void AudioTest::togglePlay()
{
// toggle suspend/resume
- if(audioOutput->state() == QAudio::SuspendedState) {
+ if(audioOutput->state() == QAudio::SuspendState) {
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::StoppedState) {
+ } else if (audioOutput->state() == QAudio::StopState) {
qWarning()<<"status: Stopped, resume()";
audioOutput->resume();
button2->setText("Click To Suspend");