static void pipe_Exit(void) { #if defined unix || (defined __APPLE__ && defined __MACH__) int pstat; pid_t pid2; #endif VC_Exit(); MikMod_free(audiobuffer); if(pipeout) { _mm_delete_file_writer(pipeout); pipeout=NULL; } if(pipefile) { #if !defined unix && (!defined __APPLE__ || !defined __MACH__) #ifdef __WATCOMC__ _pclose(pipefile); #else pclose(pipefile); #endif #ifdef __EMX__ _fsetmode(stdout,"t"); #endif #else fclose(pipefile); do { pid2=waitpid(pid,&pstat,0); } while (pid2==-1 && errno==EINTR); #endif pipefile=NULL; } }
static void NS_Exit(void) { VC_Exit(); #ifndef SDL_MIXER_ONLY _mm_free(zerobuf); #endif }
static void Sun_Exit(void) { VC_Exit(); _mm_free(audiobuffer); if (sndfd >= 0) { close(sndfd); sndfd = -1; } }
static void ESD_Exit_internal(void) { VC_Exit(); if (sndfd>=0) { esd_closestream(sndfd); sndfd=-1; signal(SIGPIPE,SIG_DFL); } }
static void NDS_SW_Exit(void) { MikMod9_SendCommand(NDS_SW_CMD_EXIT << 28); VC_Exit(); _mm_free(ipc->buffer); ipc->buffer = NULL; _mm_free(ipc); ipc = NULL; }
static void RAW_Exit(void) { VC_Exit(); if (rawout!=-1) { close(rawout); rawout=-1; } _mm_free(audiobuffer); }
static void stdout_Exit(void) { VC_Exit(); #ifdef __EMX__ _fsetmode(stdout,"t"); #endif MikMod_free(audiobuffer); audiobuffer=NULL; }
static void AIX_Exit(void) { VC_Exit(); if (fd>=0) { close(fd); fd=-1; } MikMod_free(audiobuffer); }
void MD_Exit(void) { // if (md_driver) // { // md_driver->Exit(); // } VC_Exit(); mod_free(sl_buffer); sl_buffer = NULL; }
static void ALSA_Exit_internal(void) { VC_Exit(); if (pcm_h) { alsa_pcm_drain_playback(pcm_h); alsa_pcm_close(pcm_h); pcm_h=NULL; } MikMod_free(audiobuffer); }
static void ALSA_Exit_internal(void) { enabled = 0; VC_Exit(); if (pcm_h) { alsa_pcm_drain(pcm_h); alsa_pcm_close(pcm_h); pcm_h = NULL; } MikMod_free(audiobuffer); audiobuffer = NULL; }
static void HP_Exit(void) { VC_Exit(); if (fd>=0) { ioctl(fd,AUDIO_DRAIN,0); close(fd); fd=-1; } if (audiobuffer) { free(audiobuffer); audiobuffer=NULL; } }
static void ALSA_Exit_internal(void) { VC_Exit(); if (pcm_h) { #ifdef OLD_ALSA alsa_pcm_drain_playback(pcm_h); #else alsa_pcm_drain(pcm_h); #endif alsa_pcm_close(pcm_h); pcm_h=NULL; } MikMod_free(audiobuffer); }
static void WAV_Exit(void) { VC_Exit(); /* write in the actual sizes now */ if(wavout) { putheader(); _mm_delete_file_writer(wavout); fclose(wavfile); wavfile=NULL;wavout=NULL; } MikMod_free(audiobuffer); audiobuffer=NULL; }
static void DS_Exit(void) { DWORD statusInfo; if(updateBufferHandle) { /* Signal thread to exit and wait for the exit */ if (threadInUse) { threadInUse = 0; MUTEX_UNLOCK(vars); SetEvent (notifyUpdateHandle); WaitForSingleObject (updateBufferHandle, INFINITE); MUTEX_LOCK(vars); } CloseHandle(updateBufferHandle), updateBufferHandle = NULL; } if (notifyUpdateHandle) { CloseHandle(notifyUpdateHandle), notifyUpdateHandle = NULL; } if (pSoundBufferNotify) { IDirectSoundNotify_Release(pSoundBufferNotify); pSoundBufferNotify = NULL; } if(pSoundBuffer) { if(IDirectSoundBuffer_GetStatus(pSoundBuffer,&statusInfo)==DS_OK) if(statusInfo&DSBSTATUS_PLAYING) IDirectSoundBuffer_Stop(pSoundBuffer); IDirectSoundBuffer_Release(pSoundBuffer); pSoundBuffer = NULL; } if(pPrimarySoundBuffer) { if(IDirectSoundBuffer_GetStatus(pPrimarySoundBuffer,&statusInfo)==DS_OK) if(statusInfo&DSBSTATUS_PLAYING) IDirectSoundBuffer_Stop(pPrimarySoundBuffer); IDirectSoundBuffer_Release(pPrimarySoundBuffer); pPrimarySoundBuffer = NULL; } if (pSoundCard) { IDirectSound_Release(pSoundCard); pSoundCard = NULL; } VC_Exit(); }
static void WIN_Exit(void) { int n; VC_Exit(); if (hwaveout) { for (n=0;n<NUMBUFFERS;n++) { if (header[n].dwFlags&WHDR_PREPARED) waveOutUnprepareHeader(hwaveout,&header[n],sizeof(WAVEHDR)); _mm_free(buffer[n]); } while (waveOutClose(hwaveout)==WAVERR_STILLPLAYING) Sleep(10); hwaveout=NULL; } }
static void DS_Exit(void) { DWORD statusInfo; if(updateBufferHandle) { /* Signal thread to exit and wait for the exit */ if (threadInUse) { threadInUse = 0; MUTEX_UNLOCK(vars); SetEvent (notifyUpdateHandle); WaitForSingleObject (updateBufferHandle, INFINITE); MUTEX_LOCK(vars); } CloseHandle(updateBufferHandle), updateBufferHandle = 0; } if (notifyUpdateHandle) { CloseHandle(notifyUpdateHandle), notifyUpdateHandle = 0; } SAFE_RELEASE(pSoundBufferNotify); if(pSoundBuffer) { if(pSoundBuffer->lpVtbl->GetStatus(pSoundBuffer,&statusInfo)==DS_OK) if(statusInfo&DSBSTATUS_PLAYING) pSoundBuffer->lpVtbl->Stop(pSoundBuffer); SAFE_RELEASE(pSoundBuffer); } if(pPrimarySoundBuffer) { if(pPrimarySoundBuffer->lpVtbl->GetStatus (pPrimarySoundBuffer,&statusInfo)==DS_OK) if(statusInfo&DSBSTATUS_PLAYING) pPrimarySoundBuffer->lpVtbl->Stop(pPrimarySoundBuffer); SAFE_RELEASE(pPrimarySoundBuffer); } SAFE_RELEASE(pSoundCard); VC_Exit(); }
static void XAudio2_Exit(void) { if (UpdateBufferHandle != NULL) { /* signal thread to exit and wait for the exit */ if (threadInUse) { threadInUse = 0; MUTEX_UNLOCK(vars); SetEvent(hBufferEvent); WaitForSingleObject(UpdateBufferHandle, INFINITE); MUTEX_LOCK(vars); } CloseHandle(UpdateBufferHandle); UpdateBufferHandle = NULL; } IXAudio2SourceVoice_Stop(pSourceVoice, 0, 0); if (pSourceVoice) { IXAudio2SourceVoice_DestroyVoice(pSourceVoice); pSourceVoice = NULL; } if (pMasterVoice) { IXAudio2MasteringVoice_DestroyVoice(pMasterVoice); pMasterVoice = NULL; } if (pXAudio2) { IXAudio2_Release(pXAudio2); pXAudio2 = NULL; } #ifndef __cplusplus if (hBufferEvent != NULL) { CloseHandle(hBufferEvent); hBufferEvent = NULL; } #endif #ifndef _XBOX CoUninitialize(); #endif VC_Exit(); }
static void OSLES_Exit(void) { int n; VC_Exit(); for (n=0;n<NUMBUFFERS;n++) { _mm_free(buffer[n]); } // destroy buffer queue audio player object, and invalidate all associated interfaces if (bqPlayerObject != NULL) { SLuint32 state; (*bqPlayerPlay)->GetPlayState(bqPlayerPlay, &state); if (state == SL_PLAYSTATE_PLAYING) (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_STOPPED); (*bqPlayerObject)->Destroy(bqPlayerObject); bqPlayerObject = NULL; bqPlayerPlay = NULL; bqPlayerBufferQueue = NULL; bqPlayerEffectSend = NULL; } // destroy output mix object, and invalidate all associated interfaces if (outputMixObject != NULL) { (*outputMixObject)->Destroy(outputMixObject); outputMixObject = NULL; outputMixEnvironmentalReverb = NULL; } // destroy engine object, and invalidate all associated interfaces if (engineObject != NULL) { (*engineObject)->Destroy(engineObject); engineObject = NULL; engineEngine = NULL; } }
static void mod_mpd_Exit() { VC_Exit(); }
static void NS_Exit(void) { VC_Exit(); _mm_free(zerobuf); }
static BOOL ANDROID_Reset(void) { VC_Exit(); return VC_Init(); }
static void GP32_Exit(void) { gp_clearRingbuffer(); MikMod_free(GP32_buffer); GP32_buffer=NULL; VC_Exit(); }
static BOOL stdout_Reset(void) { VC_Exit(); return VC_Init(); }
static void NS_Exit(void) { VC_Exit(); MikMod_free(zerobuf); }
static void ANDROID_Exit(void) { audio_ready = 0; playing = 0; VC_Exit(); }
static BOOL WSS_Reset(void) { wss_reset(); VC_Exit(); return VC_Init(); }
static void PSP_Exit(void) { // pspAudioEndPre(); // pspAudioEnd(); VC_Exit(); }
static BOOL PSP_Reset(void) { VC_Exit(); return VC_Init(); }
static void WSS_Exit(void) { VC_Exit(); wss_close(); }