NXEngine v1.0.0.6
[NXEngine.git] / sound / sslib.h
blob494a3774fdf16ca02c4ce5cf35c2221bce3870f7
2 #ifndef _SSLIB_H
3 #define _SSLIB_H
5 #define SAMPLE_RATE 22050
6 #define MAX_QUEUED_CHUNKS (180 +1)
7 #define SS_NUM_CHANNELS 16
9 struct SSChunk
11 signed short *buffer;
12 int length;
14 signed char *bytebuffer; // same as bytebuffer but in BYTES
15 int bytelength; // TOTAL length in BYTES
17 // current read position. this is within bytebuffer and is in BYTES.
18 int bytepos;
20 int userdata; // user data to be sent to FinishedCallback when finished
24 struct SSChannel
26 SSChunk chunks[MAX_QUEUED_CHUNKS];
27 int head, tail;
29 int volume;
30 char reserved; // if 1, can only be played on explicitly, not by passing -1
32 int FinishedChunkUserdata[MAX_QUEUED_CHUNKS];
33 int nFinishedChunks;
35 void (*FinishedCB)(int channel, int chunkid);
38 #endif