]> git.tdb.fi Git - libs/al.git/blobdiff - source/source.cpp
Style update: add spaces around assignments
[libs/al.git] / source / source.cpp
index 3619b1d61205c9128d0ffb87d7e66909acf738f2..23770b0163cf8418a85f831eecf55af0aa545c07 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspal
-Copyright © 2008 Mikko Rasa, Mikkosoft Productions
+Copyright © 2008-2009  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -60,28 +60,24 @@ SourceState Source::get_state() const
        return static_cast<SourceState>(state);
 }
 
-unsigned Source::get_buffers_queued() const
+void Source::set_position(float x, float y, float z)
 {
-       int n;
-       get_attribute(AL_BUFFERS_QUEUED, &n);
-       return n;
+       attribute(AL_POSITION, x, y, z);
 }
 
-unsigned Source::get_buffers_processed() const
+void Source::set_looping(bool l)
 {
-       int n;
-       get_attribute(AL_BUFFERS_PROCESSED, &n);
-       return n;
+       attribute(AL_LOOPING, l);
 }
 
-void Source::set_position(float x, float y, float z)
+void Source::set_gain(float g)
 {
-       attribute(AL_POSITION, x, y, z);
+       attribute(AL_GAIN, g);
 }
 
-void Source::set_looping(bool l)
+void Source::set_rolloff_factor(float f)
 {
-       attribute(AL_LOOPING, l);
+       attribute(AL_ROLLOFF_FACTOR, f);
 }
 
 void Source::set_buffer(const Buffer &buffer)
@@ -100,7 +96,7 @@ void Source::queue_buffers(const vector<const Buffer *> &buffers)
 
 void Source::queue_buffer(const Buffer &buffer)
 {
-       uint bid=buffer.get_id();
+       uint bid = buffer.get_id();
        alSourceQueueBuffers(id, 1, &bid);
 }
 
@@ -115,7 +111,7 @@ void Source::unqueue_buffers(const vector<const Buffer *> &buffers)
 
 void Source::unqueue_buffer(const Buffer &buffer)
 {
-       uint bid=buffer.get_id();
+       uint bid = buffer.get_id();
        alSourceUnqueueBuffers(id, 1, &bid);
 }
 
@@ -124,6 +120,20 @@ void Source::clear_buffers()
        attribute(AL_BUFFER, AL_NONE);
 }
 
+unsigned Source::get_buffers_queued() const
+{
+       int n = 0;
+       get_attribute(AL_BUFFERS_QUEUED, &n);
+       return n;
+}
+
+unsigned Source::get_buffers_processed() const
+{
+       int n = 0;
+       get_attribute(AL_BUFFERS_PROCESSED, &n);
+       return n;
+}
+
 void Source::play()
 {
        alSourcePlay(id);