diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-01-06 03:45:05 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-01-06 03:45:05 (GMT) |
commit | 80d4a4945d3273a4b2ce91e34597533f661af320 (patch) | |
tree | 3f861af1fcf0813cf63e57591b62e887f4329469 /examples/multimedia | |
parent | f124538ef4840c3d24b4c7e9e7221adb52bdee2c (diff) | |
download | Qt-80d4a4945d3273a4b2ce91e34597533f661af320.zip Qt-80d4a4945d3273a4b2ce91e34597533f661af320.tar.gz Qt-80d4a4945d3273a4b2ce91e34597533f661af320.tar.bz2 |
Frequency to SampleRate and channels to channelCount.
-Added channelCount(), changed everything to use this instead
of channels() in QAudioFormat class.
-Added setSampleRate() and sampleRate(), changed everthing to use these
instead of setFrequency() and frequency() in QAudioFormat class.
-Added supportedSampleRates() and supportedChannelCounts(), changed
everything to use these instead of supportedFrequencies() and
supportedChannels() in QAudioDeviceInfo class.
Reviewed-by:Justin McPherson
Diffstat (limited to 'examples/multimedia')
-rw-r--r-- | examples/multimedia/audiodevices/audiodevices.cpp | 12 | ||||
-rw-r--r-- | examples/multimedia/audioinput/audioinput.cpp | 2 | ||||
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.cpp | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp index 4f4a95f..beb31b4 100644 --- a/examples/multimedia/audiodevices/audiodevices.cpp +++ b/examples/multimedia/audiodevices/audiodevices.cpp @@ -108,8 +108,8 @@ void AudioTest::test() } else { QAudioFormat nearest = deviceInfo.nearestFormat(settings); logOutput->append(tr("Failed")); - nearestFreq->setText(QString("%1").arg(nearest.frequency())); - nearestChannel->setText(QString("%1").arg(nearest.channels())); + nearestFreq->setText(QString("%1").arg(nearest.sampleRate())); + nearestChannel->setText(QString("%1").arg(nearest.channelCount())); nearestCodec->setText(nearest.codec()); nearestSampleSize->setText(QString("%1").arg(nearest.sampleSize())); @@ -161,14 +161,14 @@ void AudioTest::deviceChanged(int idx) deviceInfo = deviceBox->itemData(idx).value<QAudioDeviceInfo>(); frequencyBox->clear(); - QList<int> freqz = deviceInfo.supportedFrequencies(); + QList<int> freqz = deviceInfo.supportedSampleRates(); for(int i = 0; i < freqz.size(); ++i) frequencyBox->addItem(QString("%1").arg(freqz.at(i))); if(freqz.size()) - settings.setFrequency(freqz.at(0)); + settings.setSampleRate(freqz.at(0)); channelsBox->clear(); - QList<int> chz = deviceInfo.supportedChannels(); + QList<int> chz = deviceInfo.supportedChannelCounts(); for(int i = 0; i < chz.size(); ++i) channelsBox->addItem(QString("%1").arg(chz.at(i))); if(chz.size()) @@ -229,7 +229,7 @@ void AudioTest::deviceChanged(int idx) void AudioTest::freqChanged(int idx) { // freq has changed - settings.setFrequency(frequencyBox->itemText(idx).toInt()); + settings.setSampleRate(frequencyBox->itemText(idx).toInt()); } void AudioTest::channelChanged(int idx) diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index e6ebe95..dbf460b 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -195,7 +195,7 @@ InputTest::InputTest() pullMode = true; - format.setFrequency(8000); + format.setSampleRate(8000); format.setChannelCount(1); format.setSampleSize(16); format.setSampleType(QAudioFormat::SignedInt); diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index e822064..7d60cd4 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -164,7 +164,7 @@ AudioTest::AudioTest() gen->start(); - settings.setFrequency(SYSTEM_FREQ); + settings.setSampleRate(SYSTEM_FREQ); settings.setChannelCount(1); settings.setSampleSize(16); settings.setCodec("audio/pcm"); |