summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio/qaudioformat.cpp
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-01-15 03:38:12 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-01-15 03:38:12 (GMT)
commitf0d24ba1eaa1079abef3a1da641b43437dc7df66 (patch)
tree297d6ae2cd6f39a7b84ff008245e441191c534df /src/multimedia/audio/qaudioformat.cpp
parent43d654e4d38b998972fa97ab2c23720db3fef8bb (diff)
downloadQt-f0d24ba1eaa1079abef3a1da641b43437dc7df66.zip
Qt-f0d24ba1eaa1079abef3a1da641b43437dc7df66.tar.gz
Qt-f0d24ba1eaa1079abef3a1da641b43437dc7df66.tar.bz2
Added new funcs to QAudioFormat and QAudioDeviceInfo class's.
QAudioFormat::setChannelCount(), channelCount() QAudioFormat::setSampleRate(), sampleRate() QAudioDeviceInfo::supportedChannelCounts(), supportedSampleRates() Changed all instances to use these new functions instead of channels(),frequency(),setFrequency(),setChannels() supportedChannels(),supportedFrequencies() Old functions still exist but are marked obsolete. Reviewed-by:Justin McPherson
Diffstat (limited to 'src/multimedia/audio/qaudioformat.cpp')
-rw-r--r--src/multimedia/audio/qaudioformat.cpp66
1 files changed, 59 insertions, 7 deletions
diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp
index 86fe85b..e31d2ec 100644
--- a/src/multimedia/audio/qaudioformat.cpp
+++ b/src/multimedia/audio/qaudioformat.cpp
@@ -111,7 +111,7 @@ public:
\o Parameter
\o Description
\row
- \o Frequency
+ \o Sample Rate
\o Samples per second of audio data in Hertz.
\row
\o Number of channels
@@ -143,8 +143,8 @@ public:
Values are initialized as follows:
\list
- \o frequency() = -1
- \o channels() = -1
+ \o sampleRate() = -1
+ \o channelCount() = -1
\o sampleSize() = -1
\o byteOrder() = QAudioFormat::Endian(QSysInfo::ByteOrder)
\o sampleType() = QAudioFormat::Unknown
@@ -227,7 +227,20 @@ bool QAudioFormat::isNull() const
}
/*!
- Sets the frequency to \a frequency.
+ Sets the sample rate to \a samplerate Hertz.
+*/
+
+void QAudioFormat::setSampleRate(int samplerate)
+{
+ d->frequency = samplerate;
+}
+
+/*!
+ \obsolete
+
+ Use setSampleRate() instead.
+
+ Sets the frequency to \a frequency Hertz.
*/
void QAudioFormat::setFrequency(int frequency)
@@ -236,7 +249,20 @@ void QAudioFormat::setFrequency(int frequency)
}
/*!
- Returns the current frequency value.
+ Returns the current sample rate in Hertz.
+*/
+
+int QAudioFormat::sampleRate() const
+{
+ return d->frequency;
+}
+
+/*!
+ \obsolete
+
+ Use sampleRate() instead.
+
+ Returns the current frequency in Hertz.
*/
int QAudioFormat::frequency() const
@@ -245,7 +271,20 @@ int QAudioFormat::frequency() const
}
/*!
- Sets the channels to \a channels.
+ Sets the channel count to \a channels.
+*/
+
+void QAudioFormat::setChannelCount(int channels)
+{
+ d->channels = channels;
+}
+
+/*!
+ \obsolete
+
+ Use setChannelCount() instead.
+
+ Sets the no. of channels to \a channels.
*/
void QAudioFormat::setChannels(int channels)
@@ -254,7 +293,20 @@ void QAudioFormat::setChannels(int channels)
}
/*!
- Returns the current channel value.
+ Returns the current channel count value.
+*/
+
+int QAudioFormat::channelCount() const
+{
+ return d->channels;
+}
+
+/*!
+ \obsolete
+
+ Use channelCount() instead.
+
+ Returns the no. of channels.
*/
int QAudioFormat::channels() const