MythTV  master
audiooutputoss.h
Go to the documentation of this file.
1 #ifndef AUDIOOUTPUTOSS
2 #define AUDIOOUTPUTOSS
3 
4 #if HAVE_SYS_SOUNDCARD_H
5  #include <sys/soundcard.h>
6 #elif HAVE_SOUNDCARD_H
7  #include <soundcard.h>
8 #endif
9 
10 #include "audiooutputbase.h"
11 
13 {
14  public:
15  explicit AudioOutputOSS(const AudioSettings &settings);
16  ~AudioOutputOSS() override;
17 
18  // Volume control
19  int GetVolumeChannel(int channel) const override; // VolumeBase
20  void SetVolumeChannel(int channel, int volume) override; // VolumeBase
21 
22  protected:
23  // You need to implement the following functions
24  bool OpenDevice(void) override; // AudioOutputBase
25  void CloseDevice(void) override; // AudioOutputBase
26  void WriteAudio(unsigned char *aubuf, int size) override; // AudioOutputBase
27  int GetBufferedOnSoundcard(void) const override; // AudioOutputBase
28  AudioOutputSettings* GetOutputSettings(bool digital) override; // AudioOutputBase
29 
30  private:
31  void VolumeInit(void);
32  void VolumeCleanup(void);
33 
34  void SetFragSize(void);
35 
36  int m_audioFd {-1};
37  mutable int m_numBadIoctls {0};
38 
39  // Volume related
40  int m_mixerFd {-1};
41  int m_control {SOUND_MIXER_VOLUME};
42 };
43 
44 #endif
45 
AudioOutputOSS(const AudioSettings &settings)
void VolumeCleanup(void)
void VolumeInit(void)
void SetFragSize(void)
void SetVolumeChannel(int channel, int volume) override
bool OpenDevice(void) override
AudioOutputSettings * GetOutputSettings(bool digital) override
void CloseDevice(void) override
int GetVolumeChannel(int channel) const override
~AudioOutputOSS() override
int GetBufferedOnSoundcard(void) const override
Return the size in bytes of frames currently in the audio buffer adjusted with the audio playback lat...
void WriteAudio(unsigned char *aubuf, int size) override