Ejemplo n.º 1
0
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;
	}
}
Ejemplo n.º 2
0
Archivo: drv_nos.c Proyecto: jjgod/SDL
static void NS_Exit(void)
{
	VC_Exit();
#ifndef SDL_MIXER_ONLY
	_mm_free(zerobuf);
#endif
}
Ejemplo n.º 3
0
static void Sun_Exit(void)
{
	VC_Exit();
	_mm_free(audiobuffer);
	if (sndfd >= 0) {
		close(sndfd);
		sndfd = -1;
	}
}
Ejemplo n.º 4
0
static void ESD_Exit_internal(void)
{
	VC_Exit();
	if (sndfd>=0) {
		esd_closestream(sndfd);
		sndfd=-1;
		signal(SIGPIPE,SIG_DFL);
	}
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 6
0
static void RAW_Exit(void)
{
	VC_Exit();
	if (rawout!=-1) {
		close(rawout);
		rawout=-1;
	}
	_mm_free(audiobuffer);
}
Ejemplo n.º 7
0
static void stdout_Exit(void)
{
	VC_Exit();
#ifdef __EMX__
	_fsetmode(stdout,"t");
#endif
	MikMod_free(audiobuffer);
	audiobuffer=NULL;
}
Ejemplo n.º 8
0
static void AIX_Exit(void)
{
	VC_Exit();
	if (fd>=0) {
		close(fd);
		fd=-1;
	}
	MikMod_free(audiobuffer);
}
Ejemplo n.º 9
0
void MD_Exit(void)
{
    //	if (md_driver)
    //	{
    //		md_driver->Exit();
    //	}
    VC_Exit();
    mod_free(sl_buffer); 
    sl_buffer = NULL;
}
Ejemplo n.º 10
0
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);
}
Ejemplo n.º 11
0
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;
}
Ejemplo n.º 12
0
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;
	}
}
Ejemplo n.º 13
0
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);
}
Ejemplo n.º 14
0
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;
}
Ejemplo n.º 15
0
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();
}
Ejemplo n.º 16
0
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;
	}
}
Ejemplo n.º 17
0
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();
}
Ejemplo n.º 18
0
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();
}
Ejemplo n.º 19
0
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;
    }
}
Ejemplo n.º 20
0
static void mod_mpd_Exit() {
	VC_Exit();
}
Ejemplo n.º 21
0
static void NS_Exit(void)
{
	VC_Exit();
	_mm_free(zerobuf);
}
Ejemplo n.º 22
0
static BOOL ANDROID_Reset(void)
{
	VC_Exit();
	return VC_Init();
}
Ejemplo n.º 23
0
static void GP32_Exit(void) {
	gp_clearRingbuffer();
	MikMod_free(GP32_buffer);
	GP32_buffer=NULL;
	VC_Exit();
}
Ejemplo n.º 24
0
static BOOL stdout_Reset(void)
{
	VC_Exit();
	return VC_Init();
}
Ejemplo n.º 25
0
static void NS_Exit(void)
{
	VC_Exit();
	MikMod_free(zerobuf);
}
Ejemplo n.º 26
0
static void ANDROID_Exit(void)
{
	audio_ready = 0;
	playing = 0;
	VC_Exit();
}
Ejemplo n.º 27
0
static BOOL WSS_Reset(void)
{
	wss_reset();
	VC_Exit();
	return VC_Init();
}
Ejemplo n.º 28
0
static void PSP_Exit(void)
{
//	pspAudioEndPre();
//	pspAudioEnd();
    VC_Exit();
}
Ejemplo n.º 29
0
static BOOL PSP_Reset(void)
{
    VC_Exit();
    return VC_Init();
}
Ejemplo n.º 30
0
static void WSS_Exit(void)
{
	VC_Exit();
	wss_close();
}