1 /*************************************************************************** 2 sndsrv.h - description 3 ------------------- 4 begin : Thu Apr 20 2000 5 copyright : (C) 2000 by Michael Speck 6 email : kulkanie@gmx.net 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef SNDSRV_H 19 #define SNDSRV_H 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /* 26 *@author Michael Speck 27 */ 28 29 #ifdef SOUND 30 31 // Wave // 32 typedef struct { 33 unsigned char *buf; 34 unsigned int len; 35 SDL_AudioSpec spc; 36 } Wv; 37 Wv* Wv_Ld(char *fname); 38 void Wv_Fr(Wv *w); 39 void Wv_Fmt(Wv *w, SDL_AudioSpec sp); 40 41 // Track // 42 typedef struct { 43 Wv *wv; 44 unsigned char *a_pos; 45 int len; 46 unsigned char pri; 47 } Trck; 48 49 // Soundserver // 50 typedef struct { 51 SDL_AudioSpec spc; // spec // 52 Dyn_List trks; // tracks // 53 char vol; // volume // 54 int ply; // playing somthing ? // 55 int slp; // sleeping ? // 56 int lmt; // lmt of tracks 57 int ok; // got sound ? // 58 } SSrv; 59 int SSrv_Ini(int fmt, int frq, int ch, int smpls, int lmt); 60 void SSrv_Trm(); 61 void SSrv_Ps(int p); 62 void SSrv_Ply(Wv *w, int p); 63 void SSrv_StV(char v); 64 void SSrv_StA(int s); 65 void SSrv_CB(void *udata, unsigned char *stream, int len); 66 67 #endif 68 69 #ifdef __cplusplus 70 }; 71 #endif 72 73 #endif 74