summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-01-06 03:45:05 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-01-06 03:45:05 (GMT)
commit80d4a4945d3273a4b2ce91e34597533f661af320 (patch)
tree3f861af1fcf0813cf63e57591b62e887f4329469 /src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
parentf124538ef4840c3d24b4c7e9e7221adb52bdee2c (diff)
downloadQt-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 'src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp')
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
index 3bcf05b..9187264 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
@@ -78,14 +78,14 @@ QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const
{
QAudioFormat nearest;
if(mode == QAudio::AudioOutput) {
- nearest.setFrequency(44100);
+ nearest.setSampleRate(44100);
nearest.setChannelCount(2);
nearest.setByteOrder(QAudioFormat::LittleEndian);
nearest.setSampleType(QAudioFormat::SignedInt);
nearest.setSampleSize(16);
nearest.setCodec(QLatin1String("audio/pcm"));
} else {
- nearest.setFrequency(8000);
+ nearest.setSampleRate(8000);
nearest.setChannelCount(1);
nearest.setSampleType(QAudioFormat::UnSignedInt);
nearest.setSampleSize(8);
@@ -253,8 +253,8 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
snd_pcm_hw_params_any( handle, params );
// set the values!
- snd_pcm_hw_params_set_channels(handle,params,format.channels());
- snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir);
+ snd_pcm_hw_params_set_channels(handle,params,format.channelCount());
+ snd_pcm_hw_params_set_rate(handle,params,format.sampleRate(),dir);
switch(format.sampleSize()) {
case 8:
if(format.sampleType() == QAudioFormat::SignedInt)
@@ -295,18 +295,18 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
} else
testCodec = true;
- if(err>=0 && format.channels() != -1) {
- err = snd_pcm_hw_params_test_channels(handle,params,format.channels());
+ if(err>=0 && format.channelCount() != -1) {
+ err = snd_pcm_hw_params_test_channels(handle,params,format.channelCount());
if(err>=0)
- err = snd_pcm_hw_params_set_channels(handle,params,format.channels());
+ err = snd_pcm_hw_params_set_channels(handle,params,format.channelCount());
if(err>=0)
testChannel = true;
}
- if(err>=0 && format.frequency() != -1) {
- err = snd_pcm_hw_params_test_rate(handle,params,format.frequency(),0);
+ if(err>=0 && format.sampleRate() != -1) {
+ err = snd_pcm_hw_params_test_rate(handle,params,format.sampleRate(),0);
if(err>=0)
- err = snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir);
+ err = snd_pcm_hw_params_set_rate(handle,params,format.sampleRate(),dir);
if(err>=0)
testFreq = true;
}