added audio
[laserbrain_demo] / src / audio / ovstream.h
diff --git a/src/audio/ovstream.h b/src/audio/ovstream.h
new file mode 100644 (file)
index 0000000..772fa2a
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef OVSTREAM_H_
+#define OVSTREAM_H_
+
+#include <pthread.h>
+#include <vorbis/vorbisfile.h>
+#include "stream.h"
+
+class OggVorbisStream : public AudioStream {
+private:
+       OggVorbis_File vf;
+       bool vfopen;
+       pthread_mutex_t vflock;
+
+       virtual bool more_samples(AudioStreamBuffer *buf);
+
+public:
+       OggVorbisStream();
+       virtual ~OggVorbisStream();
+
+       bool open(const char *fname);
+       void close();
+
+       virtual void rewind();
+};
+
+#endif  // OVSTREAM_H_