コード例 #1
0
ファイル: MenuPublic.cpp プロジェクト: nemyax/ArxLibertatis
void ARXMenu_Options_Audio_SetDevice(std::string device) {
	
	config.audio.device = device;
	
	/*
	 * TODO This is ugly and doesn't save all currently playing samples - only looping ones,
	 * and those aren't restored at the same playback position. Ideally the audio subsystem
	 * should be able to switch backends internally.
	 */
	
	ARX_SOUND_PushAnimSamples();
	size_t ulSizeAmbiancePlayList;
	char * pAmbiancePlayList = ARX_SOUND_AmbianceSavePlayList(ulSizeAmbiancePlayList);
	
	ARX_SOUND_Release();
	ARX_SOUND_Init();
	
	ARX_SOUND_MixerSwitch(ARX_SOUND_MixerGame, ARX_SOUND_MixerMenu);
	ARX_SOUND_PlayMenuAmbiance(AMB_MENU);
	
	ARXMenu_Options_Audio_SetMasterVolume(config.audio.volume);
	ARXMenu_Options_Audio_SetSfxVolume(config.audio.sfxVolume);
	ARXMenu_Options_Audio_SetSpeechVolume(config.audio.speechVolume);
	ARXMenu_Options_Audio_SetAmbianceVolume(config.audio.ambianceVolume);

	if(pAmbiancePlayList) {
		ARX_SOUND_AmbianceRestorePlayList(pAmbiancePlayList, ulSizeAmbiancePlayList);
		free(pAmbiancePlayList);
	}

	ARX_SOUND_PopAnimSamples();
}
コード例 #2
0
ファイル: MenuPublic.cpp プロジェクト: nemyax/ArxLibertatis
void ARXMenu_Options_Audio_ApplyGameVolumes() {
	ARX_SOUND_MixerSwitch(ARX_SOUND_MixerMenu, ARX_SOUND_MixerGame);
	float volume = config.audio.volume * 0.1f;
	if(config.audio.muteOnFocusLost && !mainApp->getWindow()->hasFocus()) {
		volume = 0.f;
	}
	ARX_SOUND_MixerSetVolume(ARX_SOUND_MixerGame, volume);
	ARX_SOUND_MixerSetVolume(ARX_SOUND_MixerGameSample, config.audio.sfxVolume * 0.1f);
	ARX_SOUND_MixerSetVolume(ARX_SOUND_MixerGameSpeech, config.audio.speechVolume * 0.1f);
	ARX_SOUND_MixerSetVolume(ARX_SOUND_MixerGameAmbiance, config.audio.ambianceVolume * 0.1f);
}
コード例 #3
0
ファイル: Menu.cpp プロジェクト: ptitSeb/ArxLibertatis
void ARX_MENU_Launch() {
	
	arxtime.pause();

	//Synchronize menu mixers with game mixers and switch between them
	ARX_SOUND_MixerSwitch(ARX_SOUND_MixerGame, ARX_SOUND_MixerMenu);

	ARX_SOUND_PlayMenuAmbiance(AMB_MENU);
	ARX_MENU_CLICKSOUND();

	ARXmenu.currentmode = AMCM_MAIN;
	ARX_Menu_Resources_Create();
}
コード例 #4
0
ファイル: Menu.cpp プロジェクト: zhaozw/ArxLibertatis
void ARX_MENU_Launch(bool allowResume) {
	
	REFUSE_GAME_RETURN = !allowResume;

	arxtime.pause();

	//Synchronize menu mixers with game mixers and switch between them
	ARX_SOUND_MixerSwitch(ARX_SOUND_MixerGame, ARX_SOUND_MixerMenu);

	ARX_SOUND_PlayMenuAmbiance(AMB_MENU);
	ARX_MENU_CLICKSOUND();

	ARXmenu.currentmode = AMCM_MAIN;
	ARX_Menu_Resources_Create();
	Menu2_Open();
}