summaryrefslogtreecommitdiff
path: root/audio.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-11-03 11:53:58 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-11-03 11:53:58 +0100
commit0a517afdf8c4824d2961c477bda753ca81e800db (patch)
tree6b65f2e9fb1adabc297e3d700608c1f915fc15cf /audio.h
parent2e26a1d607b45bff095e93649d830cf7146be5f1 (diff)
downloadvdr-0a517afdf8c4824d2961c477bda753ca81e800db.tar.gz
vdr-0a517afdf8c4824d2961c477bda753ca81e800db.tar.bz2
Implemented audio plugin interface
Diffstat (limited to 'audio.h')
-rw-r--r--audio.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/audio.h b/audio.h
index 2541cdcb..565bd972 100644
--- a/audio.h
+++ b/audio.h
@@ -4,10 +4,52 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: audio.h 1.1 2002/06/10 16:30:00 kls Exp $
+ * $Id: audio.h 1.2 2002/11/03 11:50:02 kls Exp $
*/
#ifndef __AUDIO_H
#define __AUDIO_H
+#include "thread.h"
+#include "tools.h"
+
+class cAudio : public cListObject {
+protected:
+ cAudio(void);
+public:
+ virtual ~cAudio();
+ virtual void Play(const uchar *Data, int Length) = 0;
+ // Plays the given block of audio Data. Must return as soon as possible.
+ // If the entire block of data can't be processed immediately, it must
+ // be copied and processed in a separate thread. The Data is always a
+ // complete PES audio packet.
+ virtual void Mute(bool On) = 0;
+ // Immediately sets the audio device to be silent (On==true) or to
+ // normal replay (On==false).
+ virtual void Clear(void) = 0;
+ // Clears all data that might still be awaiting processing.
+ };
+
+class cAudios : public cList<cAudio> {
+public:
+ void PlayAudio(const uchar *Data, int Length);
+ void MuteAudio(bool On);
+ void ClearAudio(void);
+ };
+
+extern cAudios Audios;
+
+class cExternalAudio : public cAudio {
+private:
+ char *command;
+ cPipe pipe;
+ bool mute;
+public:
+ cExternalAudio(const char *Command);
+ virtual ~cExternalAudio();
+ virtual void Play(const uchar *Data, int Length);
+ virtual void Mute(bool On);
+ virtual void Clear(void);
+ };
+
#endif //__AUDIO_H