diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-02-25 13:09:36 +0100 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-02-25 13:09:36 +0100 |
commit | da29390ac2d8593434a94f08896ff776e3e9392a (patch) | |
tree | 95bdac749d2dbdb9ee6197dbae4d13739beaef8f /dxr3audio.h | |
parent | 5344138582d635e9bb24a74c6529bd081430b521 (diff) | |
download | vdr-plugin-dxr3-da29390ac2d8593434a94f08896ff776e3e9392a.tar.gz vdr-plugin-dxr3-da29390ac2d8593434a94f08896ff776e3e9392a.tar.bz2 |
improve audio device handling
- keep track if sound device is open
- use pass-by-reference-to-const instead of pass-by-value (no copying needed)
Diffstat (limited to 'dxr3audio.h')
-rw-r--r-- | dxr3audio.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dxr3audio.h b/dxr3audio.h index 1f0bbda..118d460 100644 --- a/dxr3audio.h +++ b/dxr3audio.h @@ -37,12 +37,12 @@ public: Ac3, }; - iAudio() : vol(0), audioChannel(0) { memset(&curContext, 0, sizeof(SampleContext)); } + iAudio() : open(false), vol(0), audioChannel(0) { memset(&curContext, 0, sizeof(SampleContext)); } virtual ~iAudio() {} virtual void openDevice() = 0; virtual void releaseDevice() = 0; - virtual void setup(SampleContext ctx) = 0; + virtual void setup(const SampleContext& ctx) = 0; virtual void write(uchar* data, size_t size) = 0; void setVolume(int v) { vol = v; } @@ -59,6 +59,7 @@ public: protected: + bool open; int vol; int audioChannel; SampleContext curContext; |