summaryrefslogtreecommitdiff
path: root/dxr3audio.h
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2009-02-25 07:33:21 +0100
committerChristian Gmeiner <christian.gmeiner@gmail.com>2009-02-25 07:33:21 +0100
commit80e640c072b80590b3cc818e25a80589f515f4a4 (patch)
tree981767ce2874f0640a40d20d7d07b70749319af5 /dxr3audio.h
parent5ec77bd73a9de9611498893130e4e5b300b29c75 (diff)
downloadvdr-plugin-dxr3-80e640c072b80590b3cc818e25a80589f515f4a4.tar.gz
vdr-plugin-dxr3-80e640c072b80590b3cc818e25a80589f515f4a4.tar.bz2
factor our audio stuff from dxr3interface.h
With this commit ALSA support is only some commits away. This commit introduces cAudioOss, which has everything needed in it to handle a oss audio device. There are some problems, which will fixed soon. For instance, external mode is not supported at the moment.
Diffstat (limited to 'dxr3audio.h')
-rw-r--r--dxr3audio.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/dxr3audio.h b/dxr3audio.h
index 8ac071f..384fff9 100644
--- a/dxr3audio.h
+++ b/dxr3audio.h
@@ -21,11 +21,29 @@
#ifndef _AUDIO_H_
#define _AUDIO_H_
+#include <vdr/tools.h> // for uchar
+
+struct SampleContext {
+ unsigned int channels;
+ unsigned int samplerate;
+};
+
class iAudio {
public:
+ enum AudioMode {
+ Analog,
+ DigitalPcm,
+ Ac3,
+ };
+
iAudio() : vol(0), audioChannel(0) {}
virtual ~iAudio() {}
+ virtual void openDevice() = 0;
+ virtual void releaseDevice() = 0;
+ virtual void setup(SampleContext ctx) = 0;
+ virtual void write(uchar* data, size_t size) = 0;
+
void setVolume(int v) { vol = v; }
void mute() { setVolume(0); }
@@ -33,9 +51,17 @@ public:
void setAudioChannel(int channel) { audioChannel = channel; }
int getAudioChannel() { return audioChannel; }
+ virtual void setAudioMode(AudioMode m) = 0;
+ AudioMode getAudioMode() { return mode; }
+
+ bool isAudioModeAC3() { return mode == Ac3; }
+
+
protected:
int vol;
int audioChannel;
+ SampleContext curContext;
+ AudioMode mode;
};
#endif /*_AUDIO_H_*/