]> git.tdb.fi Git - libs/al.git/blobdiff - source/source.h
Fix compilation on OS X
[libs/al.git] / source / source.h
index 234dcb832f4a2d8e9b4ca0bf66af3e87ea3bbf37..8de3d0284d109fe1b3524539937d655748e7055a 100644 (file)
@@ -1,21 +1,26 @@
-/* $Id$
-
-This file is part of libmspal
-Copyright © 2008 Mikko Rasa, Mikkosoft Productions
-Diestributed under the LGPL
-*/
-
 #ifndef MSP_AL_SOURCE_H_
 #define MSP_AL_SOURCE_H_
 
 #include <vector>
-#include <AL/al.h>
+#include "al.h"
+#include "types.h"
 
 namespace Msp {
 namespace AL {
 
 class Buffer;
 
+enum SourceState
+{
+       INITIAL = AL_INITIAL,
+       PLAYING = AL_PLAYING,
+       PAUSED  = AL_PAUSED,
+       STOPPED = AL_STOPPED
+};
+
+/**
+Represents an audio source in the 3D environment.
+*/
 class Source
 {
 private:
@@ -25,13 +30,26 @@ public:
        Source();
        ~Source();
 
-       void attribute(ALenum, int);
-       void attribute(ALenum, float);
-       void attribute(ALenum, float, float, float);
-       void attribute(ALenum, const float *);
-       void set_buffer(Buffer &);
-       void queue_buffers(const std::vector<Buffer *> &);
-       void queue_buffer(Buffer &);
+       SourceState get_state() const;
+       void set_position(float, float, float);
+       void set_velocity(float, float, float);
+       void set_gain(float);
+       void set_rolloff_factor(float);
+
+       void set_buffer(const Buffer &);
+       void queue_buffers(const std::vector<const Buffer *> &);
+       void queue_buffer(const Buffer &);
+       void unqueue_buffers(const std::vector<const Buffer *> &);
+       void unqueue_buffer(const Buffer &);
+       void clear_buffers();
+       unsigned get_buffers_queued() const;
+       unsigned get_buffers_processed() const;
+
+       void set_looping(bool);
+       void play();
+       void pause();
+       void stop();
+       void rewind();
 };
 
 } // namespace AL