vdr  2.7.6
audio.h
Go to the documentation of this file.
1 /*
2  * audio.h: The basic audio interface
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: audio.h 5.1 2025/03/02 11:03:35 kls Exp $
8  */
9 
10 #ifndef __AUDIO_H
11 #define __AUDIO_H
12 
13 #include "thread.h"
14 #include "tools.h"
15 
16 class cAudio : public cListObject {
17 protected:
18  cAudio(void);
19 public:
20  virtual ~cAudio() override;
21  virtual void Play(const uchar *Data, int Length, uchar Id) = 0;
27  virtual void PlayTs(const uchar *Data, int Length) = 0;
32  virtual void Mute(bool On) = 0;
35  virtual void Clear(void) = 0;
37  };
38 
39 class cAudios : public cList<cAudio> {
40 public:
41  void PlayAudio(const uchar *Data, int Length, uchar Id);
42  void PlayTsAudio(const uchar *Data, int Length);
43  void MuteAudio(bool On);
44  void ClearAudio(void);
45  };
46 
47 extern cAudios Audios;
48 
49 class cExternalAudio : public cAudio {
50 private:
51  char *command;
53  bool mute;
54 public:
55  cExternalAudio(const char *Command);
56  virtual ~cExternalAudio() override;
57  virtual void Play(const uchar *Data, int Length, uchar Id) override;
58  virtual void PlayTs(const uchar *Data, int Length) override;
59  virtual void Mute(bool On) override;
60  virtual void Clear(void) override;
61  };
62 
63 #endif //__AUDIO_H
cAudios Audios
Definition: audio.c:27
Definition: audio.h:16
virtual void PlayTs(const uchar *Data, int Length)=0
Plays the given block of audio Data.
virtual void Clear(void)=0
Clears all data that might still be awaiting processing.
virtual void Play(const uchar *Data, int Length, uchar Id)=0
Plays the given block of audio Data.
cAudio(void)
Definition: audio.c:16
virtual ~cAudio() override
Definition: audio.c:21
virtual void Mute(bool On)=0
Immediately sets the audio device to be silent (On==true) or to normal replay (On==false).
Definition: audio.h:39
void PlayAudio(const uchar *Data, int Length, uchar Id)
Definition: audio.c:29
void PlayTsAudio(const uchar *Data, int Length)
Definition: audio.c:35
void ClearAudio(void)
Definition: audio.c:47
void MuteAudio(bool On)
Definition: audio.c:41
virtual void Play(const uchar *Data, int Length, uchar Id) override
Plays the given block of audio Data.
Definition: audio.c:67
cPipe pipe
Definition: audio.h:52
char * command
Definition: audio.h:51
bool mute
Definition: audio.h:53
virtual void Clear(void) override
Clears all data that might still be awaiting processing.
Definition: audio.c:125
virtual void Mute(bool On) override
Immediately sets the audio device to be silent (On==true) or to normal replay (On==false).
Definition: audio.c:118
virtual ~cExternalAudio() override
Definition: audio.c:62
cExternalAudio(const char *Command)
Definition: audio.c:55
virtual void PlayTs(const uchar *Data, int Length) override
Plays the given block of audio Data.
Definition: audio.c:95
Definition: tools.h:631
Definition: thread.h:292
unsigned char uchar
Definition: tools.h:31