00001 #ifndef __VOLUME_BASE__
00002 #define __VOLUME_BASE__
00003
00004 #include "mythexp.h"
00005
00006 typedef enum {
00007 kMuteOff = 0,
00008 kMuteLeft,
00009 kMuteRight,
00010 kMuteAll,
00011 } MuteState;
00012
00013 class MPUBLIC VolumeBase
00014 {
00015 public:
00016 VolumeBase();
00017 virtual ~VolumeBase() {};
00018
00019 void SWVolume(bool set);
00020 bool SWVolume(void) const;
00021 virtual uint GetCurrentVolume(void) const;
00022 virtual void SetCurrentVolume(int value);
00023 virtual void AdjustCurrentVolume(int change);
00024 virtual void ToggleMute(void);
00025
00026 virtual MuteState GetMuteState(void) const;
00027 virtual MuteState SetMuteState(MuteState);
00028
00029 static MuteState NextMuteState(MuteState);
00030
00031 protected:
00032
00033 virtual int GetVolumeChannel(int channel) const = 0;
00034 virtual void SetVolumeChannel(int channel, int volume) = 0;
00035 virtual void SetSWVolume(int new_volume, bool save) = 0;
00036 virtual int GetSWVolume(void) = 0;
00037
00038 void UpdateVolume(void);
00039 void SyncVolume(void);
00040 void SetChannels(int new_channels);
00041 bool internal_vol;
00042
00043 private:
00044
00045 int volume;
00046 MuteState current_mute_state;
00047 bool swvol;
00048 bool swvol_setting;
00049 int channels;
00050
00051 };
00052
00053 #endif // __VOLUME_BASE__