MythTV  master
volumebase.h
Go to the documentation of this file.
1 #ifndef VOLUME_BASE_H
2 #define VOLUME_BASE_H
3 
4 #include "mythexp.h"
5 
6 enum MuteState {
7  kMuteOff = 0,
11 };
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 m_internalVol {false};
42 
43  private:
44 
45  int m_volume {80};
46  MuteState m_currentMuteState {kMuteOff};
47  bool m_swvol {false};
48  bool m_swvolSetting {false};
49  int m_channels {0};
50 
51 };
52 
53 #endif // VOLUME_BASE_H
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:498
MPUBLIC
#define MPUBLIC
Definition: mythexp.h:10
VolumeBase::GetVolumeChannel
virtual int GetVolumeChannel(int channel) const =0
kMuteRight
@ kMuteRight
Definition: volumebase.h:9
mythexp.h
VolumeBase::GetSWVolume
virtual int GetSWVolume(void)=0
MuteState
MuteState
Definition: volumebase.h:6
VolumeBase
Definition: volumebase.h:14
VolumeBase::SetSWVolume
virtual void SetSWVolume(int new_volume, bool save)=0
kMuteLeft
@ kMuteLeft
Definition: volumebase.h:8
kMuteOff
@ kMuteOff
Definition: volumebase.h:7
uint
unsigned int uint
Definition: compat.h:140
VolumeBase::~VolumeBase
virtual ~VolumeBase()=default
VolumeBase::SetVolumeChannel
virtual void SetVolumeChannel(int channel, int volume)=0
kMuteAll
@ kMuteAll
Definition: volumebase.h:10