/* SDL Simple Player : V2.0 frederic.meslin@laposte.net Un lecteur / chargeur de sons simples pour SDL. Mise à jour : 21/06/07 */ #ifndef __SDLSMPPLAYH #define __SDLSMPPLAYH //Constantes #define MAXCANAUX 16 #define TAILLESAMPLE 1024 typedef enum { SMPPLAYBrut, SMPPLAYPause, SMPPLAYLecture } SMPPLAYETATS; //Sructures typedef struct { //Données uint8 * Tampon; uint8 VolumeInit; uint8 Volume; uint8 Balance; uint32 LongueurInit; uint32 Longueur; uint32 Position; //Flags bool Echo; bool Phaser; bool Actif; //Paramêtres des éffets uint16 EchoNB; uint16 EchoDec; uint16 EchoPos; double PhasVit; double PhasAng; double PhasInt; } SMPPLAYCANAL; typedef struct { //Données Uint8 * Tampon; Uint32 Longueur; SDL_AudioSpec AudioSpec; //Flags bool Charge; void * Precedent; } SMPPLAYSON; typedef struct { SMPPLAYCANAL Canaux[MAXCANAUX]; SDL_AudioSpec AudioSpec; SMPPLAYETATS Etat; uint CanauxOcc; } SMPPLAYLECTEUR; //Prototypes //Principaux bool SMPPlay_InitAudio (uint, uint16); void SMPPlay_QuitAudio (); bool SMPPlay_LireSonC (SMPPLAYSON *, uint); bool SMPPlay_LireSonP (SMPPLAYSON *, uint, uint); //Fichiers sonores SMPPLAYSON * SMPPlay_ChargerWAV (char *); void SMPPlay_Decharger (SMPPLAYSON *); //Effets void SMPPlay_ActEchoCanal (uint, bool); void SMPPlay_EchoCanal (uint, uint8, uint8); void SMPPlay_ActPhaserCanal (uint, bool); void SMPPlay_PhaserCanal (uint, uint8, uint8); void SMPPlay_VolumeCanal (uint, uint8); void SMPPlay_BalanceCanal (uint, uint8); //Routines internes void _InitCanal (uint); void _AudioCallBack(void *, Uint8 *, int); SMPPLAYSON * _CreerSon(); void _ViderSons (); #endif