10
enum ChannelID { LEFT = 0, RIGHT, CENTER,
11
REARLEFT, REARRIGHT, WOOFER, MAXCHANNELS };
13
Volume( int channels = 2, int maxVolume = 100 );
15
void setAllVolumes( int value )
16
{ v_volumes.fill( volrange(value) ); };
17
void setVolume( unsigned channel, int value )
18
{ if( channel<v_volumes.size() ) v_volumes[ channel ] = volrange(value); };
19
int operator[]( unsigned channel ) const
20
{ return (channel<v_volumes.size()) ? v_volumes[channel] : 0; };
21
int getVolume( unsigned channel ) const
22
{ return (channel<v_volumes.size()) ? v_volumes[channel] : 0; };
23
int maxVolume() const { return v_maxVolume; };
24
int channels() const { return v_volumes.size(); };
26
void setMuted( bool val ) { v_muted = val; };
27
bool isMuted() const { return v_muted; };
29
int volrange( int vol ) { return vol > v_maxVolume ? v_maxVolume : vol; };
33
QArray<int> v_volumes;
36
class MonoVolume : public Volume
38
MonoVolume( int maxVolume = 100 ) : Volume( 1, maxVolume ) {};
41
class StereoVolume : public Volume
43
StereoVolume( int maxVolume = 100 ) : Volume( 2, maxVolume ) {};