mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
doc and luabinder changes
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user