#include <ExManagerSound.h>
Graphe d'héritage de la classe ExManagerSound

Membres publics | |
| void | Init (void) |
| void | Reset (void) |
| ExCAction | InputCommand (ExCCommand Command) |
| ExCAction | InputAction (ExCAction Action) |
| void | DisplayAviableInput (void) |
| bool | LoadSound (std::string) |
| bool | RemoveSound (std::string) |
| void | PlaySound (std::string) |
| void | StopSound (std::string) |
| void | PauseSound (std::string) |
| void | SetRepeatSound (std::string) |
| int | GetSound (std::string) |
| void | SetManagerId (ExManagerId *Id) |
| void | Init (std::string FileName) |
| void | Reload (void) |
| void | List (void) |
| virtual void | Draw (void) |
| bool | Add (ExCSoundobject) |
| bool | Add (std::string FileName) |
| bool | Load (std::string FileName) |
| bool | Remove (ExNihilo::ExId id) |
| bool | Remove (std::string Name) |
| bool | RemoveCurrentObject (void) |
| ExCSound * | GetObject (ExNihilo::ExId id) |
| ExCSound * | GetObject (std::string Name) |
| ExCSound * | GetCurrentObject (void) |
| ExCSound * | GetFirstObject (void) |
| ExCSound * | GetLastObject (void) |
| ExNihilo::ExId | GetFirstObjectId (void) |
| ExNihilo::ExId | GetLasstObjectId (void) |
| bool | SetCurrentObject (ExNihilo::ExId id) |
| bool | SetCurrentObject (std::string Name) |
| ExNihilo::ExId | NextObject (void) |
| ExNihilo::ExId | PreviousObject (void) |
| unsigned int | GetNumberObject (void) |
| void | SetFlux (std::ostrstream *consol, ExCFluxAction *action) |
| bool | GetStatus (void) |
| void | SetStatus (bool status) |
| void | SetAskForCommand (bool status) |
| void | SetAskForExclusifCommand (bool status) |
| bool | AskForCommand (void) |
| bool | AskForExclusifCommand (void) |
Membres publics statiques | |
| ExManagerSound * | CreateSingleton (void) |
Attributs Publics | |
| std::ostrstream * | Consol |
| ExCFluxAction * | FluxAction |
Attributs Protégés | |
| std::map< ExNihilo::ExId, ExCSound, std::less< ExNihilo::ExId > > * | m_Map |
| std::map< ExNihilo::ExId, ExCSound, std::less< ExNihilo::ExId > >::iterator | m_ItMap |
| ExManagerId * | ManagerId |
| ExNihilo::ExId | m_CurrentObjectId |
| bool | m_Status |
| bool | m_AskForCommand |
| bool | m_Exclusif |
Membres privés | |
| ExManagerSound (void) | |
| ~ExManagerSound (void) | |
Attributs Privés | |
| bool | m_initok |
| ALCcontext * | context |
| ALCdevice * | device |
| ALuint | buffer_index |
| ALuint | buffer [100] |
| ALint | error |
| ALboolean | loop |
| ALuint | source_index |
| ALuint | source_available |
| ALuint | source [64] |
Attributs Privés Statiques | |
| bool | m_flag = false |
| ExManagerSound * | m_instance = NULL |
|
|
Définition à la ligne 43 du fichier ExManagerSound.cpp. Références buffer_index, m_initok, source_available, et source_index.
00044 {
00045 buffer_index = 0;
00046 source_index = 0;
00047 source_available = 0;
00048 m_initok=false;
00049 }
|
|
|
Définition à la ligne 51 du fichier ExManagerSound.cpp. Références context.
00052 {
00053 alcDestroyContext (context);
00054 }
|
|
|
|
|
|
Référencé par LoadSound(). |
|
|
Définition à la ligne 89 du fichier ExManager.h. Références ExManager::m_AskForCommand. Référencé par ExManagerCommand::InputCommand().
00089 {return m_AskForCommand;}
|
|
|
Définition à la ligne 90 du fichier ExManager.h. Références ExManager::m_Exclusif. Référencé par ExManagerCommand::InputCommand().
00090 {return m_Exclusif;}
|
|
|
Définition à la ligne 29 du fichier ExManagerSound.cpp. Références CreateSingleton(), Guard, m_flag, m_instance, et UnGuard. Référencé par CreateManager(), et CreateSingleton().
00029 {
00030 Guard(ExManagerSound* ExManagerSound::CreateSingleton(void))
00031 if(!m_flag)
00032 {
00033 m_flag = true; // We are creating the error log now, so set flag to true
00034 m_instance = new ExManagerSound; // Create the error log
00035 }else
00036 {
00037 std::cout<<"Error singleton already created"<<std::endl;
00038 }
00039 return m_instance;
00040 UnGuard
00041 }
|
|
|
Définition à la ligne 109 du fichier ExManagerSound.cpp. Références ExManager::Consol, DisplayAviableInput(), Guard, m_initok, et UnGuard. Référencé par DisplayAviableInput(), et PreInitManager().
00109 {
00110 Guard (void ExManagerSound::DisplayAviableInput (void))
00111 if(!m_initok)return;
00112 *Consol<<"****************************************"<<std::endl;
00113 *Consol<<"* Soundsystem init success *"<<std::endl;
00114 *Consol<<"****************************************"<<std::endl;
00115 *Consol<<"Company : "<<alGetString (AL_VENDOR)<<std::endl;
00116 *Consol<<"Version : "<<alGetString (AL_VERSION)<<std::endl;
00117 *Consol<<"Renderer : "<<alGetString (AL_RENDERER)<<std::endl;
00118 *Consol<<"Extensions : "<<alGetString (AL_EXTENSIONS)<<std::endl;
00119 *Consol<<"****************************************"<<std::endl;
00120 UnGuard
00121 }
|
|
|
Définition à la ligne 101 du fichier ExManagerObject.h.
00101 {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Définition à la ligne 124 du fichier ExManagerObject.h.
00124 {return m_Map->size();}
|
|
|
|
|
|
|
|
|
Définition à la ligne 283 du fichier ExManagerSound.cpp. Références GetSound(), Guard, et UnGuard. Référencé par GetSound().
|
|
|
Définition à la ligne 85 du fichier ExManager.h. Références ExManager::m_Status. Référencé par ExManagerInterface::Draw(), ExManagerConsole::Draw(), et ExManagerOutput::DrawScene().
00085 {return m_Status;}
|
|
|
|
|
|
Redéfinie à partir de ExManagerObject< ExCSound >. Définition à la ligne 56 du fichier ExManagerSound.cpp. Références buffer, ExManager::Consol, context, device, error, Guard, ExManagerObject< TypeA >::Init(), LoadSound(), m_initok, MAX_BUFFER, MAX_SOURCE, source, source_available, et UnGuard. Référencé par PreInitManager().
00057 {
00058 Guard (void ExManagerSound::init (void))
00059 ExManagerObject<ExCSound>::Init();
00060 device = alcOpenDevice(NULL);
00061 if(device == NULL)
00062 {
00063 *Consol <<"ExManagerSound:: alcOpenDevice error "<<std::endl;
00064 return ;
00065 }
00066 context=alcCreateContext(device,NULL);
00067 alcMakeContextCurrent(context);
00068 //Generate buffers
00069 alGenBuffers(MAX_BUFFER,buffer);
00070 if ((error = alGetError()) != AL_NO_ERROR)
00071 {
00072 *Consol<<"ExManagerSound:: alGenBuffers error:"<<error<<std::endl;
00073 return ;
00074 }
00075 //Generate sources
00076 for(int i = 0; i < MAX_SOURCE ; i++)
00077 {
00078 alGenSources(1 , &source[i]);
00079 if ((error = alGetError()) != AL_NO_ERROR)
00080 {
00081 *Consol<<"ExManagerSound:: alGenSources error:"<<error<<std::endl;
00082 return ;
00083 }
00084 else source_available++;
00085 }
00086 m_initok=true;
00087
00088 LoadSound("DebutKarminaBas.wav");
00089 LoadSound("MilieuBas.wav");
00090 LoadSound("FinKarminaBas.wav");
00091
00092 UnGuard
00093 }
|
|
|
Redéfinie à partir de ExManager. Définition à la ligne 302 du fichier ExManagerSound.cpp. Références ADD_SOUND, ExManager::Consol, GET_REPEATS_SOUND, Guard, InputAction(), ExManagerObject< ExCSound >::List(), LIST_SOUND, LoadSound(), ExCAction::m_Action, ExCAction::m_NextAction, ExCAction::m_Param, NOTHING, PAUSE_SOUND, PauseSound(), PLAY_SOUND, PlaySound(), REMOVE_SOUND, RemoveSound(), SET_REPEATS_SOUND, SetRepeatSound(), STOP_SOUND, StopSound(), et UnGuard. Référencé par InputAction(), et ExManagerCommand::ProcesExCAction().
00303 {
00304 Guard(ExCAction ExManagerSound::InputAction(ExCAction Action))
00305
00306 switch(Action.m_Action)
00307 {
00308 case LIST_SOUND:List(); break;
00309 case REMOVE_SOUND:RemoveSound(Action.m_Param);break;
00310 case PLAY_SOUND:PlaySound(Action.m_Param);break;
00311 case STOP_SOUND:StopSound(Action.m_Param);break;
00312 case PAUSE_SOUND:PauseSound(Action.m_Param);break;
00313 case ADD_SOUND:LoadSound(Action.m_Param);break;
00314 case SET_REPEATS_SOUND: SetRepeatSound(Action.m_Param);break;
00315 case GET_REPEATS_SOUND: //ManagerSound->GetRepeats(Action.m_Param);break;
00316
00317 default:
00318 *Consol<<"Can not file action in SOUND_ACTION_MAP"<<std::endl;
00319 break;
00320 }
00321
00322 if(Action.m_NextAction){return *Action.m_NextAction;}
00323 else{return NOTHING;}
00324 UnGuard
00325 }
|
|
|
Redéfinie à partir de ExManager. Définition à la ligne 295 du fichier ExManagerSound.cpp. Références Guard, InputCommand(), NOTHING, et UnGuard. Référencé par InputCommand().
00296 {
00297 Guard(ExCAction ExManagerSound::InputCommand(ExCCommand Command))
00298 return NOTHING;
00299 UnGuard
00300 }
|
|
|
Référencé par InputAction(). |
|
|
|
|
|
Définition à la ligne 123 du fichier ExManagerSound.cpp. Références ExManagerObject< ExCSound >::Add(), buffer, buffer_index, ExManager::Consol, error, Guard, LoadSound(), loop, ExManagerObject< ExCSound >::m_ItMap, ExManagerObject< ExCSound >::m_Map, ExCSound::SetIdent(), ExCObject::SetName(), source, source_index, et UnGuard. Référencé par Init(), InputAction(), ExManagerLoad::InputAction(), ExManagerLoad::LoadSetOfFile(), LoadSound(), et Reset().
00123 {
00124 Guard (bool ExManagerSound::LoadSound(std::string file))
00125 //We check if the file already exist
00126 //For wav file
00127 ALsizei size,freq;
00128 ALenum format;
00129 ALvoid *data;
00130 bool found = false;
00131
00132 for(m_ItMap=m_Map->begin();m_ItMap!=m_Map->end();m_ItMap++)
00133 {
00134 if(m_ItMap->second.GetName()==file)
00135 {
00136 found = true;
00137 break;
00138 }
00139 }
00140 if(found)
00141 {
00142 *Consol << " ***************************************" << std::endl;
00143 *Consol << " ** File " << file.c_str() << " already load" << std::endl;
00144 return -1;
00145 }
00146
00147 // Load the wav file
00148 std::string bufferload("../Data/sound/");
00149 bufferload+=file;
00150 alutLoadWAVFile((ALbyte*)bufferload.c_str(),&format,&data,&size,&freq,&loop);
00151 //alutLoadWAVFile((ALbyte*)file.c_str(),&format,&data,&size,&freq,&loop);
00152 *Consol << " ***************************************" << std::endl;
00153 *Consol << " ** Loading " << file.c_str() << std::endl;
00154 *Consol << " - Format " << format << std::endl;
00155 *Consol << " - Data " << data << std::endl;
00156 *Consol << " - Size " << size << std::endl;
00157 *Consol << " - Freq " << freq << std::endl;
00158 if(loop) *Consol << " - Loop ON";
00159 else *Consol << " - Loop OFF";
00160
00161 if ((error = alGetError()) != AL_NO_ERROR)
00162 {
00163 *Consol<<"ExManagerSound:: LoadWavFile error:"<<error<<std::endl;
00164 return -1;
00165 }
00166 // Copy wav file into the buffer
00167 alBufferData(buffer[buffer_index],format,data,size,freq);
00168 if ((error = alGetError()) != AL_NO_ERROR)
00169 {
00170 *Consol<<"ExManagerSound:: alBufferData error:"<<error<<std::endl;
00171 return -1;
00172 }
00173 else
00174 {
00175 ExCSound Sound;
00176 Sound.SetName(file.c_str());
00177 Sound.SetIdent(buffer_index);
00178 Add(Sound);
00179 *Consol << " - ident " << buffer_index << std::endl;
00180 }
00181
00182 // Unload the wav file
00183 alutUnloadWAV(format,data,size,freq);
00184 if ((error = alGetError()) != AL_NO_ERROR)
00185 {
00186 *Consol<<"ExManagerSound:: alutUnloadWAV error:"<<error<<std::endl;
00187 return -1;
00188 }
00189
00190 // Generate source for this wav file
00191 alSourcei(source[source_index],AL_BUFFER,buffer[buffer_index]);
00192 if ((error = alGetError()) != AL_NO_ERROR)
00193 {
00194 *Consol<<"ExManagerSound:: alSourcei error:"<<error<<std::endl;
00195 return -1;
00196 }
00197
00198 source_index++;
00199 buffer_index++;
00200
00201 *Consol << " ----> " << file.c_str() << " load ok :-)" << std::endl;
00202
00203
00204
00205 return true;
00206
00207 UnGuard
00208 }
|
|
|
|
|
|
Définition à la ligne 247 du fichier ExManagerSound.cpp. Références ExManager::Consol, error, Guard, ExManagerObject< ExCSound >::m_ItMap, ExManagerObject< ExCSound >::m_Map, PauseSound(), source, et UnGuard. Référencé par InputAction(), et PauseSound().
00247 {
00248 Guard (void ExManagerSound::PauseSound (std::string file))
00249 for(m_ItMap=m_Map->begin();m_ItMap!=m_Map->end();m_ItMap++)
00250 {
00251 if(m_ItMap->second.GetName()==file)
00252 {
00253 alSourceStop(source[m_ItMap->second.GetIdent()]);
00254 *Consol<<"stop sound :"<<file<<" ident:"<<m_ItMap->second.GetIdent()<<std::endl;
00255 if ((error = alGetError()) != AL_NO_ERROR)
00256 {
00257 *Consol<<"ExManagerSound:: alSourcePlay error:"<<error<<std::endl;
00258 }
00259 return;
00260 }
00261 }
00262 UnGuard
00263 }
|
|
|
Définition à la ligne 210 du fichier ExManagerSound.cpp. Références ExManager::Consol, error, Guard, ExManagerObject< ExCSound >::m_ItMap, ExManagerObject< ExCSound >::m_Map, PlaySound(), source, et UnGuard. Référencé par InputAction(), et PlaySound().
00210 {
00211 Guard (void ExManagerSound::PlaySound (std::string file))
00212
00213 for(m_ItMap=m_Map->begin();m_ItMap!=m_Map->end();m_ItMap++)
00214 {
00215 if(m_ItMap->second.GetName()==file)
00216 {
00217 alSourcePlay(source[m_ItMap->second.GetIdent()]);
00218 *Consol<<"Play sound :"<<file<<" ident:"<<m_ItMap->second.GetIdent()<<std::endl;
00219 if ((error = alGetError()) != AL_NO_ERROR)
00220 {
00221 *Consol<<"ExManagerSound:: alSourcePlay error:"<<error<<std::endl;
00222 }
00223 return;
00224 }
00225 }
00226 UnGuard
00227 }
|
|
|
|
|
|
Redéfinie à partir de ExManager. Référencé par ExManagerCommand::ProcesExCAction(). |
|
|
|
|
|
|
|
|
|
|
|
Définition à la ligne 289 du fichier ExManagerSound.cpp. Références Guard, RemoveSound(), et UnGuard. Référencé par InputAction(), et RemoveSound().
|
|
|
Redéfinie à partir de ExManagerObject< ExCSound >. Définition à la ligne 95 du fichier ExManagerSound.cpp. Références Guard, LoadSound(), ExManagerObject< ExCSound >::m_ItMap, ExManagerObject< ExCSound >::m_Map, ExManagerObject< TypeA >::Reset(), Reset(), StopSound(), et UnGuard. Référencé par ExManagerCommand::ProcesExCAction(), et Reset().
00096 {
00097 Guard (void ExManagerSound::Reset (void))
00098 for(m_ItMap=m_Map->begin();m_ItMap!=m_Map->end();m_ItMap++)
00099 {
00100 StopSound(m_ItMap->second.GetName());
00101 }
00102 ExManagerObject<ExCSound>::Reset();
00103 LoadSound("DebutKarminaBas.wav");
00104 LoadSound("MilieuBas.wav");
00105 LoadSound("FinKarminaBas.wav");
00106 UnGuard
00107 }
|
|
|
Définition à la ligne 87 du fichier ExManager.h. Références ExManager::m_AskForCommand. Référencé par ExManagerConsole::ExManagerConsole(), ExManagerModel::ExManagerModel(), ExManagerObjectWindow::Init(), ExManagerNetwork::Init(), ExManagerConsole::InputAction(), ExManagerNetwork::InputCommand(), ExManagerLoad::LoadSetOfFile(), et ExManagerNetwork::Say().
00087 {m_AskForCommand=status;}
|
|
|
Définition à la ligne 88 du fichier ExManager.h. Références ExManager::m_Exclusif. Référencé par ExManagerConsole::ExManagerConsole(), ExManagerModel::ExManagerModel(), ExManagerObjectWindow::Init(), ExManagerNetwork::Init(), ExManagerConsole::InputAction(), ExManagerNetwork::InputCommand(), et ExManagerNetwork::Say().
00088 {m_Exclusif=status;}
|
|
|
|
|
|
|
|
||||||||||||
|
Définition à la ligne 35 du fichier ExManager.cpp. Références ExManager::Consol, et ExManager::FluxAction. Référencé par SetManagerLink().
00036 {
00037 Consol=consol;
00038 FluxAction=action;
00039 }
|
|
|
Définition à la ligne 94 du fichier ExManagerObject.h. Référencé par SetManagerLink().
00094 {ManagerId = Id;}
|
|
|
Définition à la ligne 265 du fichier ExManagerSound.cpp. Références ExManager::Consol, error, Guard, ExManagerObject< ExCSound >::m_ItMap, ExManagerObject< ExCSound >::m_Map, SetRepeatSound(), source, et UnGuard. Référencé par InputAction(), et SetRepeatSound().
00266 {
00267 Guard (void ExManagerSound::SetRepeatSound (std::string file ))
00268 for(m_ItMap=m_Map->begin();m_ItMap!=m_Map->end();m_ItMap++)
00269 {
00270 if(m_ItMap->second.GetName()==file)
00271 {
00272 alSourcei(source[m_ItMap->second.GetIdent()],AL_LOOPING,AL_TRUE);
00273 *Consol<<"stop sound :"<<file<<" ident:"<<m_ItMap->second.GetIdent()<<std::endl;
00274 if ((error = alGetError()) != AL_NO_ERROR)
00275 {
00276 *Consol<<"ExManagerSound:: alSourcePlay error:"<<error<<std::endl;
00277 }
00278 return;
00279 }
00280 }
00281 UnGuard
00282 }
|
|
|
Définition à la ligne 86 du fichier ExManager.h. Références ExManager::m_Status. Référencé par ExManagerConsole::Draw(), ExManagerConsole::ExManagerConsole(), ExManagerObjectWindow::Init(), ExManagerInterface::Init(), ExManagerConsole::InputAction(), ExManagerLoad::LoadSetOfFile(), et ExManagerConsole::SetConsoleState().
00086 {m_Status=status;}
|
|
|
Définition à la ligne 229 du fichier ExManagerSound.cpp. Références ExManager::Consol, error, Guard, ExManagerObject< ExCSound >::m_ItMap, ExManagerObject< ExCSound >::m_Map, source, StopSound(), et UnGuard. Référencé par InputAction(), Reset(), et StopSound().
00229 {
00230 Guard (void ExManagerSound::StopSound (std::string file))
00231 for(m_ItMap=m_Map->begin();m_ItMap!=m_Map->end();m_ItMap++)
00232 {
00233 if(m_ItMap->second.GetName()==file)
00234 {
00235 alSourceStop(source[m_ItMap->second.GetIdent()]);
00236 *Consol<<"stop sound :"<<file<<" ident:"<<m_ItMap->second.GetIdent()<<std::endl;
00237 if ((error = alGetError()) != AL_NO_ERROR)
00238 {
00239 *Consol<<"ExManagerSound:: alSourcePlay error:"<<error<<std::endl;
00240 }
00241 return;
00242 }
00243 }
00244 UnGuard
00245 }
|
|
|
Définition à la ligne 81 du fichier ExManagerSound.h. Référencé par Init(), et LoadSound(). |
|
|
Définition à la ligne 80 du fichier ExManagerSound.h. Référencé par ExManagerSound(), et LoadSound(). |
|
|
|
Définition à la ligne 76 du fichier ExManagerSound.h. Référencé par Init(), et ~ExManagerSound(). |
|
|
Définition à la ligne 77 du fichier ExManagerSound.h. Référencé par Init(). |
|
|
Définition à la ligne 82 du fichier ExManagerSound.h. Référencé par Init(), LoadSound(), PauseSound(), PlaySound(), SetRepeatSound(), et StopSound(). |
|
|
Définition à la ligne 74 du fichier ExManager.h. Référencé par ExManagerWindow::Apply(), ExManagerCommand::ApplyAction(), ExManagerCommand::LoadExecFile(), ExManagerId::RecordObject(), ExManager::SetFlux(), et ExManagerSpecialEffect::Specialeffect(). |
|
|
Définition à la ligne 85 du fichier ExManagerSound.h. Référencé par LoadSound(). |
|
|
Définition à la ligne 70 du fichier ExManager.h. Référencé par ExManager::AskForCommand(), ExManagerConsole::ExManagerConsole(), et ExManager::SetAskForCommand(). |
|
|
Définition à la ligne 79 du fichier ExManagerObject.h. |
|
|
Définition à la ligne 71 du fichier ExManager.h. Référencé par ExManager::AskForExclusifCommand(), et ExManager::SetAskForExclusifCommand(). |
|
|
Définition à la ligne 26 du fichier ExManagerSound.cpp. Référencé par CreateSingleton(). |
|
|
Définition à la ligne 75 du fichier ExManagerSound.h. Référencé par DisplayAviableInput(), ExManagerSound(), et Init(). |
|
|
Définition à la ligne 27 du fichier ExManagerSound.cpp. Référencé par CreateSingleton(). |
|
|
Définition à la ligne 76 du fichier ExManagerObject.h. Référencé par LoadSound(), PauseSound(), PlaySound(), Reset(), SetRepeatSound(), et StopSound(). |
|
|
Définition à la ligne 75 du fichier ExManagerObject.h. Référencé par LoadSound(), PauseSound(), PlaySound(), Reset(), SetRepeatSound(), et StopSound(). |
|
|
Définition à la ligne 69 du fichier ExManager.h. Référencé par ExManager::GetStatus(), et ExManager::SetStatus(). |
|
|
Définition à la ligne 78 du fichier ExManagerObject.h. |
|
|
Définition à la ligne 88 du fichier ExManagerSound.h. Référencé par Init(), LoadSound(), PauseSound(), PlaySound(), SetRepeatSound(), et StopSound(). |
|
|
Définition à la ligne 87 du fichier ExManagerSound.h. Référencé par ExManagerSound(), et Init(). |
|
|
Définition à la ligne 86 du fichier ExManagerSound.h. Référencé par ExManagerSound(), et LoadSound(). |
1.3.4