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::WriteAudio
void WriteAudio(unsigned char *aubuf, int size) override
Definition: audiooutputoss.cpp:237
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:504
AudioOutputOSS::VolumeCleanup
void VolumeCleanup(void)
Definition: audiooutputoss.cpp:314
AudioOutputOSS::~AudioOutputOSS
~AudioOutputOSS() override
Definition: audiooutputoss.cpp:32
AudioOutputOSS::m_numBadIoctls
int m_numBadIoctls
Definition: audiooutputoss.h:37
AudioOutputOSS::SetVolumeChannel
void SetVolumeChannel(int channel, int volume) override
Definition: audiooutputoss.cpp:348
AudioOutputOSS::VolumeInit
void VolumeInit(void)
Definition: audiooutputoss.cpp:274
AudioOutputOSS::m_mixerFd
int m_mixerFd
Definition: audiooutputoss.h:40
AudioSettings
Definition: audiosettings.h:29
AudioOutputOSS::AudioOutputOSS
AudioOutputOSS(const AudioSettings &settings)
Definition: audiooutputoss.cpp:23
AudioOutputBase
Definition: audiooutputbase.h:50
AudioOutputOSS::GetVolumeChannel
int GetVolumeChannel(int channel) const override
Definition: audiooutputoss.cpp:323
AudioOutputOSS::m_audioFd
int m_audioFd
Definition: audiooutputoss.h:36
AudioOutputOSS::CloseDevice
void CloseDevice(void) override
Definition: audiooutputoss.cpp:226
AudioOutputOSS
Definition: audiooutputoss.h:13
AudioOutputOSS::GetBufferedOnSoundcard
int GetBufferedOnSoundcard(void) const override
Return the size in bytes of frames currently in the audio buffer adjusted with the audio playback lat...
Definition: audiooutputoss.cpp:263
audiooutputbase.h
AudioOutputSettings
Definition: audiooutputsettings.h:50
AudioOutputOSS::GetOutputSettings
AudioOutputSettings * GetOutputSettings(bool digital) override
Definition: audiooutputoss.cpp:37
AudioOutputOSS::m_control
int m_control
Definition: audiooutputoss.h:41
AudioOutputOSS::OpenDevice
bool OpenDevice(void) override
Definition: audiooutputoss.cpp:104
AudioOutputOSS::SetFragSize
void SetFragSize(void)