ported TYPE_QUEUE Source from default to minor

--HG--
branch : minor
This commit is contained in:
raidho36
2016-10-11 06:30:30 +03:00
parent e969f541ba
commit 7934bfaf7f
15 changed files with 432 additions and 112 deletions
+14 -1
View File
@@ -86,6 +86,7 @@ public:
Source(Pool *pool, love::sound::SoundData *soundData);
Source(Pool *pool, love::sound::Decoder *decoder);
Source(Pool *pool, int sampleRate, int bitDepth, int channels);
Source(const Source &s);
virtual ~Source();
@@ -130,6 +131,10 @@ public:
virtual float getMaxDistance() const;
virtual int getChannels() const;
virtual bool isQueueable() const;
virtual void queueData(void *data, int length, int dataSampleRate, int dataBitDepth, int dataChannels);
virtual void queueDataAtomic(void *data, ALsizei length);
void prepareAtomic();
void teardownAtomic();
@@ -159,13 +164,21 @@ private:
int streamAtomic(ALuint buffer, love::sound::Decoder *d);
ALuint unusedBufferPeek();
ALuint *unusedBufferPop();
void unusedBufferPush(ALuint buffer);
Pool *pool;
ALuint source;
bool valid;
static const unsigned int MAX_BUFFERS = 8;
ALuint streamBuffers[MAX_BUFFERS];
ALuint unusedBuffers[MAX_BUFFERS];
int unusedBufferTop;
ALsizei bufferedBytes;
StrongRef<StaticDataBuffer> staticBuffer;
float pitch;