2013-01-05 04:04:58 +00:00
|
|
|
//
|
|
|
|
|
// KRAudioBuffer.h
|
|
|
|
|
// KREngine
|
|
|
|
|
//
|
|
|
|
|
// Created by Kearwood Gilbert on 2013-01-04.
|
|
|
|
|
// Copyright (c) 2013 Kearwood Software. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#ifndef KRAUDIO_BUFFER_H
|
|
|
|
|
#define KRAUDIO_BUFFER_H
|
|
|
|
|
|
|
|
|
|
#include "KREngine-common.h"
|
|
|
|
|
#include "KRDataBlock.h"
|
|
|
|
|
|
|
|
|
|
class KRAudioManager;
|
|
|
|
|
class KRAudioSample;
|
|
|
|
|
|
|
|
|
|
class KRAudioBuffer
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
KRAudioBuffer(KRAudioManager *manager, KRAudioSample *sound, int index, ALenum dataFormat, int frameCount, int frameRate, int bytesPerFrame, void (*fn_populate)(KRAudioSample *, int, void *));
|
|
|
|
|
~KRAudioBuffer();
|
|
|
|
|
|
|
|
|
|
unsigned int getBufferID();
|
2013-02-07 13:00:51 -08:00
|
|
|
int getFrameCount();
|
|
|
|
|
int getFrameRate();
|
|
|
|
|
signed short *getFrameData();
|
2013-02-08 17:28:17 -08:00
|
|
|
|
|
|
|
|
KRAudioSample *getAudioSample();
|
|
|
|
|
int getIndex();
|
2013-01-05 04:04:58 +00:00
|
|
|
private:
|
|
|
|
|
KRAudioManager *m_pSoundManager;
|
|
|
|
|
|
2013-02-08 17:28:17 -08:00
|
|
|
int m_index;
|
2013-01-05 04:04:58 +00:00
|
|
|
ALenum m_dataFormat;
|
|
|
|
|
int m_frameCount;
|
|
|
|
|
int m_frameRate;
|
|
|
|
|
int m_bytesPerFrame;
|
|
|
|
|
KRDataBlock *m_pData;
|
|
|
|
|
|
|
|
|
|
unsigned int m_bufferID;
|
2013-02-08 17:28:17 -08:00
|
|
|
|
|
|
|
|
KRAudioSample *m_audioSample;
|
2013-01-05 04:04:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* defined(KRAUDIO_BUFFER_H) */
|