void BtnIMPFinishVoiceCallback(GUI_BUTTON *btn,INT32 reason) { // btn callback for Main Page Begin Profiling if (!(btn->uiFlags & BUTTON_ENABLED)) return; // if not this far in char generation, don't alot ANY action if( iCurrentProfileMode < 4 ) { btn->uiFlags&=~(BUTTON_CLICKED_ON); fButtonPendingFlag = TRUE; return; } if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN ) { btn->uiFlags|=(BUTTON_CLICKED_ON); } else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP ) { if (btn->uiFlags & BUTTON_CLICKED_ON) { // play voice if( ! SoundIsPlaying( uiVoiceSound ) ) { uiVoiceSound = PlayVoice( ); } btn->uiFlags&=~(BUTTON_CLICKED_ON); fButtonPendingFlag = TRUE; } } }
void BtnIMPVoicesPreviousCallback( GUI_BUTTON *btn, INT32 reason ) { // btn callback for IMP attrbite begin button if ( !(btn->uiFlags & BUTTON_ENABLED) ) return; if ( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN ) { btn->uiFlags |= (BUTTON_CLICKED_ON); } else if ( reason & MSYS_CALLBACK_REASON_LBUTTON_UP ) { if ( btn->uiFlags & BUTTON_CLICKED_ON ) { btn->uiFlags &= ~(BUTTON_CLICKED_ON); // previous voice, please!!! DecrementVoice( ); // play voice if ( !SoundIsPlaying( uiVocVoiceSound ) ) { uiVocVoiceSound = PlayVoice( ); } else { SoundStop( uiVocVoiceSound ); uiVocVoiceSound = PlayVoice( ); } fReDrawVoicesScreenFlag = TRUE; } } }
void SoundManager::TestVolume(short volume, short sound_index) { if (active) { if ((volume = PIN(volume, 0, NUMBER_OF_SOUND_VOLUME_LEVELS)) != 0) { PlaySound(sound_index, 0, NONE); Mixer::instance()->SetVolume(volume * SOUND_VOLUME_DELTA); while (SoundIsPlaying(sound_index)) SDL_Delay(10); Mixer::instance()->SetVolume(parameters.volume * SOUND_VOLUME_DELTA); } } }
void IMPPortraitRegionButtonCallback( MOUSE_REGION * pRegion, INT32 iReason ) { // callback handler for imp portrait region button events if ( iReason & MSYS_CALLBACK_REASON_INIT ) { return; } if ( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP ) { if ( !SoundIsPlaying( uiVocVoiceSound ) ) { uiVocVoiceSound = PlayVoice( ); } } }
void PlayNewMessageSound( void ) { // play a new message sound, if there is one playing, do nothing static UINT32 uiSoundId = NO_SAMPLE; if( uiSoundId != NO_SAMPLE ) { // is sound playing?..don't play new one if( SoundIsPlaying( uiSoundId ) == TRUE ) { return; } } // otherwise no sound playing, play one uiSoundId = PlayJA2SampleFromFile( "Sounds\\newbeep.wav", RATE_11025, MIDVOLUME, 1 , MIDDLEPAN ); return; }