diff options
author | David Boddie <dboddie@trolltech.com> | 2010-01-06 12:44:17 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-01-06 12:44:17 (GMT) |
commit | 982cffb529f65c7d0c401844ef9af1925e550ffb (patch) | |
tree | 641bdb47e9b68dc917b6fabfe1bb22f70797a647 /examples/multimedia/audiooutput | |
parent | fac8aa652775424ae890cb428267c155f8e48b9b (diff) | |
download | Qt-982cffb529f65c7d0c401844ef9af1925e550ffb.zip Qt-982cffb529f65c7d0c401844ef9af1925e550ffb.tar.gz Qt-982cffb529f65c7d0c401844ef9af1925e550ffb.tar.bz2 |
Doc: Made coding style changes to the Audio Input and Output examples.
Reviewed-by: Trust Me
Diffstat (limited to 'examples/multimedia/audiooutput')
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index b6047db..5ec6d68 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -103,10 +103,10 @@ int Generator::fillData(char *start, int frequency, int seconds) qint64 Generator::readData(char *data, qint64 maxlen) { int len = maxlen; - if(len > 16384) + if (len > 16384) len = 16384; - if(len < (SECONDS*SYSTEM_FREQ*2)-pos) { + if (len < (SECONDS*SYSTEM_FREQ*2)-pos) { // Normal memcpy(data,t+pos,len); pos+=len; @@ -212,15 +212,15 @@ void AudioTest::deviceChanged(int idx) void AudioTest::status() { - qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, elapsedUSecs = "<<audioOutput->elapsedUSecs()<<", processedUSecs = "<<audioOutput->processedUSecs(); + qWarning() << "byteFree = " << audioOutput->bytesFree() << " bytes, elapsedUSecs = " << audioOutput->elapsedUSecs() << ", processedUSecs = " << audioOutput->processedUSecs(); } void AudioTest::writeMore() { - if(!audioOutput) + if (!audioOutput) return; - if(audioOutput->state() == QAudio::StoppedState) + if (audioOutput->state() == QAudio::StoppedState) return; int l; @@ -229,9 +229,9 @@ void AudioTest::writeMore() int chunks = audioOutput->bytesFree()/audioOutput->periodSize(); while(chunks) { l = gen->read(buffer,audioOutput->periodSize()); - if(l > 0) + if (l > 0) out = output->write(buffer,l); - if(l != audioOutput->periodSize()) + if (l != audioOutput->periodSize()) break; chunks--; } @@ -259,24 +259,24 @@ void AudioTest::toggle() void AudioTest::togglePlay() { // toggle suspend/resume - if(audioOutput->state() == QAudio::SuspendedState) { - qWarning()<<"status: Suspended, resume()"; + if (audioOutput->state() == QAudio::SuspendedState) { + qWarning() << "status: Suspended, resume()"; audioOutput->resume(); button2->setText("Click To Suspend"); } else if (audioOutput->state() == QAudio::ActiveState) { - qWarning()<<"status: Active, suspend()"; + qWarning() << "status: Active, suspend()"; audioOutput->suspend(); button2->setText("Click To Resume"); } else if (audioOutput->state() == QAudio::StoppedState) { - qWarning()<<"status: Stopped, resume()"; + qWarning() << "status: Stopped, resume()"; audioOutput->resume(); button2->setText("Click To Suspend"); } else if (audioOutput->state() == QAudio::IdleState) { - qWarning()<<"status: IdleState"; + qWarning() << "status: IdleState"; } } void AudioTest::state(QAudio::State state) { - qWarning()<<" state="<<state; + qWarning() << " state=" << state; } |