00001 #ifndef VOLUMECONTROL_H_ 00002 #define VOLUMECONTROL_H_ 00003 00004 typedef enum { MUTE_OFF=0, MUTE_LEFT, MUTE_RIGHT, MUTE_BOTH } kMuteState; 00005 00006 class VolumeControl 00007 { 00008 public: 00009 VolumeControl(bool setstartingvolume = true); 00010 ~VolumeControl(); 00011 00012 int GetCurrentVolume(void); 00013 void SetCurrentVolume(int value); 00014 void AdjustCurrentVolume(int change); 00015 00016 void SetMute(bool on); 00017 void ToggleMute(void); 00018 bool GetMute(void) { return mute; } 00019 kMuteState IterateMutedChannels(void); 00020 00021 private: 00022 int mixerfd; 00023 int volume; 00024 int internal_volume; 00025 int control; 00026 00027 bool mute; 00028 kMuteState current_mute_state; 00029 }; 00030 00031 #endif
1.5.5