summaryrefslogtreecommitdiffstats
path: root/kmix/volume.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
commitb1057f437bf65300831a0ccb45b920787c6b318d (patch)
treef8a73db06ca1180d0da0ba6dfbe786197b4f4bc3 /kmix/volume.cpp
parent4ddfca384ced9ad654213aef9dc2c3973720b980 (diff)
downloadtdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.tar.gz
tdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.zip
TQt4 port kdemultimedia
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1236079 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmix/volume.cpp')
-rw-r--r--kmix/volume.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/kmix/volume.cpp b/kmix/volume.cpp
index 99dd180b..d2eb4314 100644
--- a/kmix/volume.cpp
+++ b/kmix/volume.cpp
@@ -34,9 +34,9 @@ int Volume::_channelMaskEnum[10] =
MCUSTOM1, MCUSTOM2
};
-Volume::Volume( ChannelMask chmask, long maxVolume, long minVolume, bool isCapture )
+Volume::Volume( ChannelMask chtqmask, long maxVolume, long minVolume, bool isCapture )
{
- init(chmask, maxVolume, minVolume, isCapture);
+ init(chtqmask, maxVolume, minVolume, isCapture);
}
@@ -56,22 +56,22 @@ Volume::Volume( int channels, long maxVolume ) {
Volume::Volume( const Volume &v )
{
- _chmask = v._chmask;
+ _chtqmask = v._chtqmask;
_maxVolume = v._maxVolume;
_minVolume = v._minVolume;
_muted = v._muted;
_isCapture = v._isCapture;
- setVolume(v, (ChannelMask)v._chmask);
+ setVolume(v, (ChannelMask)v._chtqmask);
// kdDebug(67100) << "Volume::copy-constructor initialized " << v << "\n";
}
-void Volume::init( ChannelMask chmask, long maxVolume, long minVolume, bool isCapture )
+void Volume::init( ChannelMask chtqmask, long maxVolume, long minVolume, bool isCapture )
{
for ( int i=0; i<= Volume::CHIDMAX; i++ ) {
_volumes[i] = 0;
}
- _chmask = chmask;
+ _chtqmask = chtqmask;
_maxVolume = maxVolume;
_minVolume = minVolume;
_isCapture = isCapture;
@@ -82,7 +82,7 @@ void Volume::init( ChannelMask chmask, long maxVolume, long minVolume, bool isCa
void Volume::setAllVolumes(long vol)
{
for ( int i=0; i<= Volume::CHIDMAX; i++ ) {
- if ( (_channelMaskEnum[i]) & _chmask ) {
+ if ( (_channelMaskEnum[i]) & _chtqmask ) {
// we are supposed to set it
_volumes[i] = volrange(vol);
}
@@ -106,17 +106,17 @@ void Volume::setVolume( ChannelID chid, long vol)
*/
void Volume::setVolume(const Volume &v)
{
- setVolume(v, (ChannelMask)(v._chmask&_chmask) );
+ setVolume(v, (ChannelMask)(v._chtqmask&_chtqmask) );
}
/**
* Copy the volume elements contained in v to this Volume object.
* Only those elments are copied, that are supported in BOTH Volume objects
- * and match the ChannelMask given by chmask.
+ * and match the ChannelMask given by chtqmask.
*/
-void Volume::setVolume(const Volume &v, ChannelMask chmask) {
+void Volume::setVolume(const Volume &v, ChannelMask chtqmask) {
for ( int i=0; i<= Volume::CHIDMAX; i++ ) {
- if ( _channelMaskEnum[i] & _chmask & (int)chmask ) {
+ if ( _channelMaskEnum[i] & _chtqmask & (int)chtqmask ) {
// we are supposed to copy it
_volumes[i] = volrange(v._volumes[i]);
}
@@ -149,8 +149,8 @@ long Volume::getVolume(ChannelID chid) {
}
else {
// check if channel is supported
- int chmask = _channelMaskEnum[chid];
- if ( (chmask & _chmask) != 0 ) {
+ int chtqmask = _channelMaskEnum[chid];
+ if ( (chtqmask & _chtqmask) != 0 ) {
// channel is supported
vol = _volumes[chid];
}
@@ -162,11 +162,11 @@ long Volume::getVolume(ChannelID chid) {
return vol;
}
-long Volume::getAvgVolume(ChannelMask chmask) {
+long Volume::getAvgVolume(ChannelMask chtqmask) {
int avgVolumeCounter = 0;
long long sumOfActiveVolumes = 0;
for ( int i=0; i<= Volume::CHIDMAX; i++ ) {
- if ( (_channelMaskEnum[i] & _chmask) & (int)chmask ) {
+ if ( (_channelMaskEnum[i] & _chtqmask) & (int)chtqmask ) {
avgVolumeCounter++;
sumOfActiveVolumes += _volumes[i];
}
@@ -180,10 +180,10 @@ long Volume::getAvgVolume(ChannelMask chmask) {
return (long)sumOfActiveVolumes;
}
-long Volume::getTopStereoVolume(ChannelMask chmask) {
+long Volume::getTopStereoVolume(ChannelMask chtqmask) {
long long topVolumeCount = 0;
for ( int i=0; i<= Volume::CHIDMAX; i++ ) {
- if ( (_channelMaskEnum[i] & _chmask) & (int)chmask ) {
+ if ( (_channelMaskEnum[i] & _chtqmask) & (int)chtqmask ) {
if ( topVolumeCount < _volumes[i] )
topVolumeCount = _volumes[i];
}
@@ -194,7 +194,7 @@ long Volume::getTopStereoVolume(ChannelMask chmask) {
int Volume::count() {
int counter = 0;
for ( int i=0; i<= Volume::CHIDMAX; i++ ) {
- if ( _channelMaskEnum[i] & _chmask ) {
+ if ( _channelMaskEnum[i] & _chtqmask ) {
counter++;
}
}
@@ -225,7 +225,7 @@ std::ostream& operator<<(std::ostream& os, const Volume& vol) {
if ( i != 0 ) {
os << ",";
}
- if ( Volume::_channelMaskEnum[i] & vol._chmask ) {
+ if ( Volume::_channelMaskEnum[i] & vol._chtqmask ) {
// supported channel: Print Volume
os << vol._volumes[i];
}
@@ -248,7 +248,7 @@ kdbgstream& operator<<(kdbgstream &os, const Volume& vol) {
if ( i != 0 ) {
os << ",";
}
- if ( Volume::_channelMaskEnum[i] & vol._chmask ) {
+ if ( Volume::_channelMaskEnum[i] & vol._chtqmask ) {
// supported channel: Print Volume
os << vol._volumes[i];
}