1 // (_||_/ 2 // ( ) Classe Audio 3 // ( o 0 ) 4 //-OOO�--(_)---�OOO--------------------------------------- 5 // Copyright (C) 2006 By Dominique Roux-Serret 6 // .OOOo oOOO. roux-serret@ifrance.com 7 //-( )------( )--------------------------------------- 8 // ( ( ) / Le 27/05/2006 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 or version 3 of the License. 14 15 // This program is distributed in the hope that it will be useful, 16 // but WITHOUT ANY WARRANTY; without even the implied warranty of 17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 // GNU General Public License for more details. 19 20 // You should have received a copy of the GNU General Public License along 21 // with this program; if not, write to the Free Software Foundation, Inc., 22 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 23 24 #ifndef _AUDIO_DOM_ 25 #define _AUDIO_DOM_ 26 27 #include <SDL/SDL.h> 28 #include <SDL/SDL_mixer.h> 29 30 /*** Enum�ration des sons ***/ 31 /****************************/ 32 enum eSon { 33 sClic=0, 34 sSpeed, 35 sCrash, 36 sEnd, 37 sLose, 38 sEtire, 39 sWagon, 40 sReduit, 41 sLive, 42 sFin 43 }; 44 45 /*** D�finition de la classe Audio ***/ 46 /*************************************/ 47 class Audio { 48 public: 49 Audio(void); 50 ~Audio(void); 51 52 /*** Fonctions ***/ 53 bool Init(void); // Initialise et charge les fichiers audio 54 void LoadMusic(int Num); // Charge une music, 0 = music du menu 1,2,3,4=Jeu 55 void NextMusic(void); // Passe � la music suivante 56 57 void Play(eSon); // Joue un son 58 void PlayMusic(void); // Joue la music 59 60 void Pause(bool Etat); // Met ou non en pause 61 void PauseMusic(bool Etat); // Met ou no la music en pause 62 63 void DoVolume(void); // Valide les volumes audio 64 65 /*** Variables ***/ 66 int N; // Nombre d'�chantillon audio 67 int NMus; // Num�ro de la music en cours 68 int MemoHorloge; // M�morise l'horloge pour les clics 69 Mix_Chunk **Son; // Pointe sur les sons 70 Mix_Music *Music; // Pointe sur les musics 71 }; 72 73 #endif 74