summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-01-06 00:16:02 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-01-06 00:16:02 (GMT)
commitf124538ef4840c3d24b4c7e9e7221adb52bdee2c (patch)
tree22e96b25c3780fb849d4f833ef1e17331128dc36 /src/multimedia
parenta4550c49e982aa0218ab7097b814678505f8482c (diff)
downloadQt-f124538ef4840c3d24b4c7e9e7221adb52bdee2c.zip
Qt-f124538ef4840c3d24b4c7e9e7221adb52bdee2c.tar.gz
Qt-f124538ef4840c3d24b4c7e9e7221adb52bdee2c.tar.bz2
Added setChannelCount() to QAudioFormat.
Added setChannelCount() and updated docs/examples/tests to use it instead of setChannels(). Reviewed-by:Justin McPherson
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/audio/qaudio_mac.cpp2
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp6
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp2
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp4
-rw-r--r--src/multimedia/audio/qaudioformat.cpp9
-rw-r--r--src/multimedia/audio/qaudioformat.h1
-rw-r--r--src/multimedia/audio/qaudioinput.cpp2
-rw-r--r--src/multimedia/audio/qaudiooutput.cpp2
8 files changed, 19 insertions, 9 deletions
diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp
index 1cd9225..635377c 100644
--- a/src/multimedia/audio/qaudio_mac.cpp
+++ b/src/multimedia/audio/qaudio_mac.cpp
@@ -65,7 +65,7 @@ QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf)
QAudioFormat audioFormat;
audioFormat.setFrequency(sf.mSampleRate);
- audioFormat.setChannels(sf.mChannelsPerFrame);
+ audioFormat.setChannelCount(sf.mChannelsPerFrame);
audioFormat.setSampleSize(sf.mBitsPerChannel);
audioFormat.setCodec(QString::fromLatin1("audio/pcm"));
audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
index f58f5be..3bcf05b 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
@@ -79,19 +79,19 @@ QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const
QAudioFormat nearest;
if(mode == QAudio::AudioOutput) {
nearest.setFrequency(44100);
- nearest.setChannels(2);
+ nearest.setChannelCount(2);
nearest.setByteOrder(QAudioFormat::LittleEndian);
nearest.setSampleType(QAudioFormat::SignedInt);
nearest.setSampleSize(16);
nearest.setCodec(QLatin1String("audio/pcm"));
} else {
nearest.setFrequency(8000);
- nearest.setChannels(1);
+ nearest.setChannelCount(1);
nearest.setSampleType(QAudioFormat::UnSignedInt);
nearest.setSampleSize(8);
nearest.setCodec(QLatin1String("audio/pcm"));
if(!testSettings(nearest)) {
- nearest.setChannels(2);
+ nearest.setChannelCount(2);
nearest.setSampleSize(16);
nearest.setSampleType(QAudioFormat::SignedInt);
}
diff --git a/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp
index 8905119..c8b0196 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp
@@ -147,7 +147,7 @@ QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format)
if (rc.frequency() != target.frequency())
rc.setFrequency(target.frequency());
if (rc.channels() != target.channels())
- rc.setChannels(target.channels());
+ rc.setChannelCount(target.channels());
if (rc.sampleSize() != target.sampleSize())
rc.setSampleSize(target.sampleSize());
if (rc.byteOrder() != target.byteOrder())
diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
index 33af022..3c5b129 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
@@ -95,14 +95,14 @@ QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const
QAudioFormat nearest;
if(mode == QAudio::AudioOutput) {
nearest.setFrequency(44100);
- nearest.setChannels(2);
+ nearest.setChannelCount(2);
nearest.setByteOrder(QAudioFormat::LittleEndian);
nearest.setSampleType(QAudioFormat::SignedInt);
nearest.setSampleSize(16);
nearest.setCodec(QLatin1String("audio/pcm"));
} else {
nearest.setFrequency(11025);
- nearest.setChannels(1);
+ nearest.setChannelCount(1);
nearest.setByteOrder(QAudioFormat::LittleEndian);
nearest.setSampleType(QAudioFormat::SignedInt);
nearest.setSampleSize(8);
diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp
index b2bbe14..b8e0851 100644
--- a/src/multimedia/audio/qaudioformat.cpp
+++ b/src/multimedia/audio/qaudioformat.cpp
@@ -245,6 +245,15 @@ int QAudioFormat::frequency() const
Sets the channels to \a channels.
*/
+void QAudioFormat::setChannelCount(int channels)
+{
+ d->channels = channels;
+}
+
+/*!
+ \internal
+*/
+
void QAudioFormat::setChannels(int channels)
{
d->channels = channels;
diff --git a/src/multimedia/audio/qaudioformat.h b/src/multimedia/audio/qaudioformat.h
index 7e92c2f..88241df 100644
--- a/src/multimedia/audio/qaudioformat.h
+++ b/src/multimedia/audio/qaudioformat.h
@@ -76,6 +76,7 @@ public:
void setFrequency(int frequency);
int frequency() const;
+ void setChannelCount(int channels);
void setChannels(int channels);
int channels() const;
diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp
index d81df7a..0d43ce4 100644
--- a/src/multimedia/audio/qaudioinput.cpp
+++ b/src/multimedia/audio/qaudioinput.cpp
@@ -89,7 +89,7 @@ QT_BEGIN_NAMESPACE
QAudioFormat format;
// set up the format you want, eg.
format.setFrequency(8000);
- format.setChannels(1);
+ format.setChannelCount(1);
format.setSampleSize(8);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp
index 1c7b617..2f1ad3b 100644
--- a/src/multimedia/audio/qaudiooutput.cpp
+++ b/src/multimedia/audio/qaudiooutput.cpp
@@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE
QAudioFormat format;
// Set up the format, eg.
format.setFrequency(8000);
- format.setChannels(1);
+ format.setChannelCount(1);
format.setSampleSize(8);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);