From 5cf8b6041be8576c119b6d777d158a76f367aa0f Mon Sep 17 00:00:00 2001 From: Themaister Date: Wed, 2 May 2012 18:16:45 +0200 Subject: [PATCH] Add convenience functions to start/stop RSound on consoles. --- console/console_ext.c | 20 ++++++++++++++++++++ console/console_ext.h | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/console/console_ext.c b/console/console_ext.c index 5a521ad8fb..4ad0217ca4 100644 --- a/console/console_ext.c +++ b/console/console_ext.c @@ -706,3 +706,23 @@ void rarch_exec (void) } #endif + +#ifdef HAVE_RSOUND +bool rarch_console_rsound_start(const char *ip) +{ + uninit_audio(); + strlcpy(g_settings.audio.device, ip, sizeof(g_settings.audio.device)); + driver.audio = &audio_rsound; + driver.audio_data = NULL; + init_audio(); + return g_extern.audio_active; +} + +void rarch_console_rsound_stop(void) +{ + uninit_audio(); + init_drivers_pre(); + init_audio(); +} +#endif + diff --git a/console/console_ext.h b/console/console_ext.h index 4fba0e4b1c..95bd85aa44 100644 --- a/console/console_ext.h +++ b/console/console_ext.h @@ -119,4 +119,9 @@ void rarch_startup (const char * config_path); void rarch_exec (void); #endif +#ifdef HAVE_RSOUND +bool rarch_console_rsound_start(const char *ip); +void rarch_console_rsound_stop(void); +#endif + #endif