MythTV  master
volumebase.h
Go to the documentation of this file.
1 #ifndef __VOLUME_BASE__
2 #define __VOLUME_BASE__
3 
4 #include "mythexp.h"
5 
6 typedef enum {
7  kMuteOff = 0,
11 } MuteState;
12 
14 {
15  public:
16  VolumeBase();
17  virtual ~VolumeBase() = default;
18 
19  void SWVolume(bool set);
20  bool SWVolume(void) const;
21  virtual uint GetCurrentVolume(void) const;
22  virtual void SetCurrentVolume(int value);
23  virtual void AdjustCurrentVolume(int change);
24  virtual void ToggleMute(void);
25 
26  virtual MuteState GetMuteState(void) const;
27  virtual MuteState SetMuteState(MuteState /*mstate*/);
28 
29  static MuteState NextMuteState(MuteState /*cur*/);
30 
31  protected:
32 
33  virtual int GetVolumeChannel(int channel) const = 0; // Returns 0-100
34  virtual void SetVolumeChannel(int channel, int volume) = 0; // range 0-100 for vol
35  virtual void SetSWVolume(int new_volume, bool save) = 0;
36  virtual int GetSWVolume(void) = 0;
37 
38  void UpdateVolume(void);
39  void SyncVolume(void);
40  void SetChannels(int new_channels);
41  bool internal_vol {false};
42 
43  private:
44 
45  int m_volume {80};
46  MuteState m_current_mute_state {kMuteOff};
47  bool m_swvol {false};
48  bool m_swvol_setting {false};
49  int m_channels {0};
50 
51 };
52 
53 #endif // __VOLUME_BASE__
#define MPUBLIC
Definition: mythexp.h:10
MuteState
Definition: volumebase.h:6
unsigned int uint
Definition: compat.h:140