doc and luabinder changes

This commit is contained in:
Eduardo Bart
2012-06-22 00:14:13 -03:00
parent c5674d10ba
commit aed779a2c8
60 changed files with 348 additions and 126 deletions

View File

@@ -36,10 +36,10 @@ public:
bool fillBuffer(const SoundFilePtr& soundFile);
bool fillBuffer(ALenum sampleFormat, const DataBuffer<char>& data, int size, int rate);
ALuint getBufferId() { return m_bufferId; }
uint getBufferId() { return m_bufferId; }
private:
ALuint m_bufferId;
uint m_bufferId;
};
#endif

View File

@@ -25,6 +25,7 @@
#include "declarations.h"
//@bindsingleton g_sounds
class SoundManager
{
enum {
@@ -53,7 +54,7 @@ public:
private:
StreamSoundSourcePtr createStreamSoundSource(const std::string& filename);
SoundSourcePtr createSoundSource(const std::string& filename);
ALuint loadFileIntoBuffer(const SoundFilePtr& soundFile);
uint loadFileIntoBuffer(const SoundFilePtr& soundFile);
std::map<std::string, SoundBufferPtr> m_buffers;
std::vector<SoundSourcePtr> m_sources;

View File

@@ -65,7 +65,7 @@ void SoundSource::stop()
bool SoundSource::isPlaying()
{
ALint state = AL_PLAYING;
int state = AL_PLAYING;
alGetSourcei(m_sourceId, AL_SOURCE_STATE, &state);
return state != AL_STOPPED;
}

View File

@@ -28,7 +28,7 @@
class SoundSource
{
protected:
SoundSource(ALuint sourceId) : m_sourceId(sourceId) { }
SoundSource(uint sourceId) : m_sourceId(sourceId) { }
public:
enum FadeState { NoFading, FadingOn, FadingOff };
@@ -56,7 +56,7 @@ protected:
friend class SoundManager;
friend class CombinedSoundSource;
ALuint m_sourceId;
uint m_sourceId;
SoundBufferPtr m_buffer;
FadeState m_fadeState;
float m_fadeStartTime;

View File

@@ -63,7 +63,7 @@ void StreamSoundSource::stop()
void StreamSoundSource::queueBuffers()
{
ALint queued;
int queued;
alGetSourcei(m_sourceId, AL_BUFFERS_QUEUED, &queued);
for(int i = 0; i < STREAM_FRAGMENTS - queued; ++i) {
if(!fillBufferAndQueue(m_buffers[i]->getBufferId()))
@@ -73,10 +73,10 @@ void StreamSoundSource::queueBuffers()
void StreamSoundSource::unqueueBuffers()
{
ALint queued;
int queued;
alGetSourcei(m_sourceId, AL_BUFFERS_QUEUED, &queued);
for(int i = 0; i < queued; ++i) {
ALuint buffer;
uint buffer;
alSourceUnqueueBuffers(m_sourceId, 1, &buffer);
}
}
@@ -85,10 +85,10 @@ void StreamSoundSource::update()
{
SoundSource::update();
ALint processed = 0;
int processed = 0;
alGetSourcei(m_sourceId, AL_BUFFERS_PROCESSED, &processed);
for(ALint i = 0; i < processed; ++i) {
ALuint buffer;
for(int i = 0; i < processed; ++i) {
uint buffer;
alSourceUnqueueBuffers(m_sourceId, 1, &buffer);
//SoundManager::check_al_error("Couldn't unqueue audio buffer: ");
@@ -105,7 +105,7 @@ void StreamSoundSource::update()
}
}
bool StreamSoundSource::fillBufferAndQueue(ALuint buffer)
bool StreamSoundSource::fillBufferAndQueue(uint buffer)
{
// fill buffer
static DataBuffer<char> bufferData(2*STREAM_FRAGMENT_SIZE);

View File

@@ -51,7 +51,7 @@ public:
private:
void queueBuffers();
void unqueueBuffers();
bool fillBufferAndQueue(ALuint buffer);
bool fillBufferAndQueue(uint buffer);
SoundFilePtr m_soundFile;
std::array<SoundBufferPtr,STREAM_FRAGMENTS> m_buffers;