-/* $Id$
-
-This file is part of libmspal
-Copyright © 2008 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#include "buffer.h"
#include "source.h"
return static_cast<SourceState>(state);
}
-unsigned Source::get_buffers_queued() const
-{
- int n;
- get_attribute(AL_BUFFERS_QUEUED, &n);
- return n;
-}
-
-unsigned Source::get_buffers_processed() const
-{
- int n;
- get_attribute(AL_BUFFERS_PROCESSED, &n);
- return n;
-}
-
void Source::set_position(float x, float y, float z)
{
attribute(AL_POSITION, x, y, z);
void Source::queue_buffer(const Buffer &buffer)
{
- uint bid=buffer.get_id();
+ uint bid = buffer.get_id();
alSourceQueueBuffers(id, 1, &bid);
}
void Source::unqueue_buffer(const Buffer &buffer)
{
- uint bid=buffer.get_id();
+ uint bid = buffer.get_id();
alSourceUnqueueBuffers(id, 1, &bid);
}
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);