void osd_stop_audio_stream(void) { if(sound_stream) sound_stream_destroy(sound_stream); if(sound_dsp) sysdep_dsp_destroy(sound_dsp); if(sound_mixer) sysdep_mixer_destroy(sound_mixer); }
void osd_sound_enable (int enable_it) { if (sound_stream && enable_it) { sound_enabled = 1; xmame_func_set(sound_enabled); /* for QUASI88 */ if (!sound_dsp) { if (!(sound_dsp = sysdep_dsp_create(NULL, sound_dsp_device, &options_samplerate, &type, sound_bufsize * (1 / Machine__drv__frames_per_second), SYSDEP_DSP_EMULATE_TYPE | SYSDEP_DSP_O_NONBLOCK))) { sound_enabled = 0; xmame_func_set(sound_enabled); /* for QUASI88 */ } else { sound_stream_destroy(sound_stream); if (!(sound_stream = sound_stream_create(sound_dsp, type, sound_samples_per_frame, 3))) { osd_stop_audio_stream(); sound_enabled = 0; xmame_func_set(sound_enabled); /* for QUASI88 */ } } } } else { if (sound_dsp) { sysdep_dsp_destroy(sound_dsp); sound_dsp = NULL; } sound_enabled = 0; xmame_func_set(sound_enabled); /* for QUASI88 */ } }
void osd_sound_enable (int enable_it) { if (sound_stream && enable_it) { sound_enabled = 1; if (!sound_dsp) { if (!(sound_dsp = sysdep_dsp_create(NULL, sound_dsp_device, &options.samplerate, &type, sound_bufsize * (1 / Machine->drv->frames_per_second), SYSDEP_DSP_EMULATE_TYPE | SYSDEP_DSP_O_NONBLOCK))) sound_enabled = 0; else { sound_stream_destroy(sound_stream); if (!(sound_stream = sound_stream_create(sound_dsp, type, sound_samples_per_frame, 3))) { osd_stop_audio_stream(); sound_enabled = 0; } } } } else { if (sound_dsp) { sysdep_dsp_destroy(sound_dsp); sound_dsp = NULL; } sound_enabled = 0; } }