rarch_console_rsound.c code moved to audio/utils.c

This commit is contained in:
twinaphex 2013-01-17 14:21:49 +01:00
parent d21e778c94
commit 3b43155b06
8 changed files with 52 additions and 94 deletions

View File

@ -161,3 +161,37 @@ void audio_convert_float_to_s16_neon(int16_t *out, const float *in, size_t sampl
}
#endif
#ifdef HAVE_RSOUND
bool rarch_rsound_start(const char *ip)
{
strlcpy(g_settings.audio.driver, "rsound", sizeof(g_settings.audio.driver));
strlcpy(g_settings.audio.device, ip, sizeof(g_settings.audio.device));
driver.audio_data = NULL;
// If driver already has started, it must be reinited.
if (driver.audio_data)
{
uninit_audio();
driver.audio_data = NULL;
init_drivers_pre();
init_audio();
}
return g_extern.audio_active;
}
void rarch_rsound_stop(void)
{
strlcpy(g_settings.audio.driver, config_get_default_audio(), sizeof(g_settings.audio.driver));
// If driver already has started, it must be reinited.
if (driver.audio_data)
{
uninit_audio();
driver.audio_data = NULL;
init_drivers_pre();
init_audio();
}
}
#endif

View File

@ -63,5 +63,10 @@ void audio_convert_s16_to_float_C(float *out,
void audio_convert_float_to_s16_C(int16_t *out,
const float *in, size_t samples);
#ifdef HAVE_RSOUND
bool rarch_rsound_start(const char *ip);
void rarch_rsound_stop(void);
#endif
#endif

View File

@ -181,6 +181,16 @@ enum
#define DEFAULT_SHADER_TYPE RARCH_SHADER_AUTO
#endif
#if defined(__CELLOS_LV2__)
#define EXT_EXECUTABLES "self|SELF|bin|BIN"
#elif defined(_XBOX1)
#define EXT_EXECUTABLES "xbe|XBE"
#elif defined(_XBOX360)
#define EXT_EXECUTABLES "xex|XEX"
#elif defined(GEKKO)
#define EXT_EXECUTABLES "dol|DOL"
#endif
////////////////
// Video
////////////////

View File

@ -40,10 +40,6 @@ CONSOLE EXTENSIONS
#include "../../ngc/sidestep.c"
#endif
#ifdef HAVE_RSOUND
#include "../rarch_console_rsound.c"
#endif
#ifdef HAVE_DEFAULT_RETROPAD_INPUT
#include "../rarch_console_input.c"
#endif

View File

@ -17,16 +17,6 @@
#ifndef CONSOLE_EXT_H__
#define CONSOLE_EXT_H__
#if defined(__CELLOS_LV2__)
#define EXT_EXECUTABLES "self|SELF|bin|BIN"
#elif defined(_XBOX1)
#define EXT_EXECUTABLES "xbe|XBE"
#elif defined(_XBOX360)
#define EXT_EXECUTABLES "xex|XEX"
#elif defined(GEKKO)
#define EXT_EXECUTABLES "dol|DOL"
#endif
#define EXT_IMAGES "png|PNG|jpg|JPG|JPEG|jpeg"
#define EXT_SHADERS "cg|CG"
#define EXT_CGP_PRESETS "cgp|CGP"

View File

@ -1,50 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
* Copyright (C) 2011-2013 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include "rarch_console_rsound.h"
bool rarch_console_rsound_start(const char *ip)
{
strlcpy(g_settings.audio.driver, "rsound", sizeof(g_settings.audio.driver));
strlcpy(g_settings.audio.device, ip, sizeof(g_settings.audio.device));
driver.audio_data = NULL;
// If driver already has started, it must be reinited.
if (driver.audio_data)
{
uninit_audio();
driver.audio_data = NULL;
init_drivers_pre();
init_audio();
}
return g_extern.audio_active;
}
void rarch_console_rsound_stop(void)
{
strlcpy(g_settings.audio.driver, config_get_default_audio(), sizeof(g_settings.audio.driver));
// If driver already has started, it must be reinited.
if (driver.audio_data)
{
uninit_audio();
driver.audio_data = NULL;
init_drivers_pre();
init_audio();
}
}

View File

@ -1,23 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
* Copyright (C) 2011-2013 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RARCH_CONSOLE_RSOUND_H
#define RARCH_CONSOLE_RSOUND_H
bool rarch_console_rsound_start(const char *ip);
void rarch_console_rsound_stop(void);
#endif

View File

@ -33,10 +33,6 @@
#include "../../gfx/image.h"
#ifdef HAVE_RSOUND
#include "../../console/rarch_console_rsound.h"
#endif
#include "../../console/rarch_console_video.h"
#include "../../gfx/gfx_context.h"
@ -1339,16 +1335,16 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
{
#ifdef HAVE_RSOUND
if(g_extern.console.sound.mode != SOUND_MODE_RSOUND)
rarch_console_rsound_stop();
rarch_rsound_stop();
else
rarch_console_rsound_start(g_settings.audio.device);
rarch_rsound_start(g_settings.audio.device);
#endif
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
g_extern.console.sound.mode = SOUND_MODE_NORMAL;
#ifdef HAVE_RSOUND
rarch_console_rsound_stop();
rarch_rsound_stop();
#endif
}
break;