Esempio n. 1
0
static void
QSA_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        if (this->hidden->audio_handle != NULL) {
            if (!this->hidden->iscapture) {
                /* Finish playing available samples */
                snd_pcm_plugin_flush(this->hidden->audio_handle,
                                     SND_PCM_CHANNEL_PLAYBACK);
            } else {
                /* Cancel unread samples during capture */
                snd_pcm_plugin_flush(this->hidden->audio_handle,
                                     SND_PCM_CHANNEL_CAPTURE);
            }
            snd_pcm_close(this->hidden->audio_handle);
            this->hidden->audio_handle = NULL;
        }

        SDL_FreeAudioMem(this->hidden->pcm_buf);
        this->hidden->pcm_buf = NULL;

        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 2
0
static void
PULSEAUDIO_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        if (this->hidden->mixbuf != NULL) {
            SDL_FreeAudioMem(this->hidden->mixbuf);
            this->hidden->mixbuf = NULL;
        }
        if (this->hidden->stream) {
            PULSEAUDIO_pa_stream_disconnect(this->hidden->stream);
            PULSEAUDIO_pa_stream_unref(this->hidden->stream);
            this->hidden->stream = NULL;
        }
        if (this->hidden->context != NULL) {
            PULSEAUDIO_pa_context_disconnect(this->hidden->context);
            PULSEAUDIO_pa_context_unref(this->hidden->context);
            this->hidden->context = NULL;
        }
        if (this->hidden->mainloop != NULL) {
            PULSEAUDIO_pa_mainloop_free(this->hidden->mainloop);
            this->hidden->mainloop = NULL;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 3
0
static void DUMMYAUD_CloseAudio(_THIS)
{
	if ( this->hidden->mixbuf != NULL ) {
		SDL_FreeAudioMem(this->hidden->mixbuf);
		this->hidden->mixbuf = NULL;
	}
}
Esempio n. 4
0
static void MPFAUD_CloseAudio(_THIS)
{
	if ( this->hidden->mixbuf != NULL ) {
		SDL_FreeAudioMem(this->hidden->mixbuf);
		this->hidden->mixbuf = NULL;
	}
	sys_sound_deinit();
}
Esempio n. 5
0
static void DCAUD_CloseAudio(_THIS)
{
	aica_stop(0);
	if (this->spec.channels==2) aica_stop(1);
	if ( this->hidden->mixbuf != NULL ) {
		SDL_FreeAudioMem(this->hidden->mixbuf);
		this->hidden->mixbuf = NULL;
	}
}
Esempio n. 6
0
static void ANDROIDAUDIOTRACK_CloseAudio(_THIS)
{
	if ( this->hidden->mixbuf != NULL ) {
		SDL_FreeAudioMem(this->hidden->mixbuf);
		this->hidden->mixbuf = NULL;
	}

	deinitAndroidAudio(this);
}
Esempio n. 7
0
static void ARTSC_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( stream ) {
		arts_close_stream(stream);
		stream = 0;
	}
}
Esempio n. 8
0
static void DISKAUD_CloseAudio(_THIS)
{
	if ( this->hidden->mixbuf != NULL ) {
		SDL_FreeAudioMem(this->hidden->mixbuf);
		this->hidden->mixbuf = NULL;
	}
	if ( this->hidden->audio_fd >= 0 ) {
		close(this->hidden->audio_fd);
		this->hidden->audio_fd = -1;
	}
}
Esempio n. 9
0
static void DSP_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( audio_fd >= 0 ) {
		close(audio_fd);
		audio_fd = -1;
	}
}
Esempio n. 10
0
static void ESD_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( audio_fd >= 0 ) {
		SDL_NAME(esd_close)(audio_fd);
		audio_fd = -1;
	}
}
Esempio n. 11
0
static void DISKAUD_CloseAudio(_THIS)
{
	if ( this->hidden->mixbuf != NULL ) {
		SDL_FreeAudioMem(this->hidden->mixbuf);
		this->hidden->mixbuf = NULL;
	}
	if ( this->hidden->output != NULL ) {
		SDL_RWclose(this->hidden->output);
		this->hidden->output = NULL;
	}
}
Esempio n. 12
0
static void NAS_CloseAudio(_THIS)
{
	if ( this->hidden->mixbuf != NULL ) {
		SDL_FreeAudioMem(this->hidden->mixbuf);
		this->hidden->mixbuf = NULL;
	}
	if ( this->hidden->aud ) {
		AuCloseServer(this->hidden->aud);
		this->hidden->aud = 0;
	}
}
Esempio n. 13
0
static void SNDIO_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( hdl != NULL ) {
		sio_close(hdl);
		hdl = NULL;
	}
}
Esempio n. 14
0
static void AL_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( audio_port != NULL ) {
		alClosePort(audio_port);
		audio_port = NULL;
	}
}
Esempio n. 15
0
static void ALSA_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( pcm_handle ) {
		SDL_NAME(snd_pcm_drain)(pcm_handle);
		SDL_NAME(snd_pcm_close)(pcm_handle);
		pcm_handle = NULL;
	}
}
Esempio n. 16
0
void DSP_CloseAudio(_THIS)
{
    if ( mixbuf != NULL ) {
        SDL_FreeAudioMem(mixbuf);
        mixbuf = NULL;
    }
    if ( ulaw_buf != NULL ) {
        free(ulaw_buf);
        ulaw_buf = NULL;
    }
    close(audio_fd);
}
Esempio n. 17
0
static void PULSE_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( stream != NULL ) {
		SDL_NAME(pa_simple_drain)(stream, NULL);
		SDL_NAME(pa_simple_free)(stream);
		stream = NULL;
	}
}
Esempio n. 18
0
static void ARTS_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( stream ) {
		SDL_NAME(arts_close_stream)(stream);
		stream = 0;
	}
	SDL_NAME(arts_free)();
}
Esempio n. 19
0
static void DSP_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( audio_fd >= 0 ) {
		int value;
		ioctl(audio_fd, SNDCTL_DSP_RESET, &value);
		close(audio_fd);
		audio_fd = -1;
	}
}
Esempio n. 20
0
static void
DISKAUD_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        this->hidden->mixbuf = NULL;
        if (this->hidden->output != NULL) {
            SDL_RWclose(this->hidden->output);
            this->hidden->output = NULL;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 21
0
static void
NAS_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        this->hidden->mixbuf = NULL;
        if (this->hidden->aud) {
            NAS_AuCloseServer(this->hidden->aud);
            this->hidden->aud = 0;
        }
        SDL_free(this->hidden);
        this2 = this->hidden = NULL;
    }
}
Esempio n. 22
0
static void
SNDIO_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        this->hidden->mixbuf = NULL;
        if ( this->hidden->dev != NULL ) {
            SNDIO_sio_close(this->hidden->dev);
            this->hidden->dev = NULL;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 23
0
static void
PAUDIO_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        this->hidden->mixbuf = NULL;
        if (this->hidden->audio_fd >= 0) {
            close(this->hidden->audio_fd);
            this->hidden->audio_fd = -1;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
static void
PULSEAUDIO_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        SDL_free(this->hidden->device_name);
        if (this->hidden->stream) {
            PULSEAUDIO_pa_stream_disconnect(this->hidden->stream);
            PULSEAUDIO_pa_stream_unref(this->hidden->stream);
        }
        DisconnectFromPulseServer(this->hidden->mainloop, this->hidden->context);
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 25
0
static void
ALSA_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        this->hidden->mixbuf = NULL;
        if (this->hidden->pcm_handle) {
            ALSA_snd_pcm_drain(this->hidden->pcm_handle);
            ALSA_snd_pcm_close(this->hidden->pcm_handle);
            this->hidden->pcm_handle = NULL;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 26
0
static void
ESD_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        this->hidden->mixbuf = NULL;
        if (this->hidden->audio_fd >= 0) {
            SDL_NAME(esd_close) (this->hidden->audio_fd);
            this->hidden->audio_fd = -1;
        }

        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 27
0
static void
IRIXAUDIO_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        if (this->hidden->mixbuf != NULL) {
            SDL_FreeAudioMem(this->hidden->mixbuf);
            this->hidden->mixbuf = NULL;
        }
        if (this->hidden->audio_port != NULL) {
            alClosePort(this->hidden->audio_port);
            this->hidden->audio_port = NULL;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 28
0
static void
SDL_FS_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        SDL_FreeAudioMem(this->hidden->mixbuf);
        this->hidden->mixbuf = NULL;
        if (this->hidden->stream) {
            this->hidden->stream->Release(this->hidden->stream);
            this->hidden->stream = NULL;
        }
        if (this->hidden->fs) {
            this->hidden->fs->Release(this->hidden->fs);
            this->hidden->fs = NULL;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;
    }
}
Esempio n. 29
0
static void
DCAUD_CloseDevice(_THIS)
{
    if (this->hidden != NULL) {
        aica_stop(0);
        if (this->spec.channels == 2) {
            aica_stop(1);
        }
        if (this->hidden->mixbuf != NULL) {
            SDL_FreeAudioMem(this->hidden->mixbuf);
            this->hidden->mixbuf = NULL;
        }
        SDL_free(this->hidden);
        this->hidden = NULL;

        /* !!! FIXME: is there a reverse of spu_init()? */
    }
}
Esempio n. 30
0
static void PULSE_CloseAudio(_THIS)
{
	if ( mixbuf != NULL ) {
		SDL_FreeAudioMem(mixbuf);
		mixbuf = NULL;
	}
	if ( stream != NULL ) {
		SDL_NAME(pa_stream_disconnect)(stream);
		SDL_NAME(pa_stream_unref)(stream);
		stream = NULL;
	}
	if (context != NULL) {
		SDL_NAME(pa_context_disconnect)(context);
		SDL_NAME(pa_context_unref)(context);
		context = NULL;
	}
	if (mainloop != NULL) {
		SDL_NAME(pa_mainloop_free)(mainloop);
		mainloop = NULL;
	}
}