mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
(Settings data) Add default audio resampler option
This commit is contained in:
parent
1c1c92f38a
commit
dbf239f8d4
@ -45,7 +45,7 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident)
|
||||
if (!ident)
|
||||
return backends[0];
|
||||
|
||||
int i = find_resampler_driver_index(ident);
|
||||
int i = find_resampler_driver_index(g_settings.audio.resampler);
|
||||
if (i >= 0)
|
||||
return backends[i];
|
||||
else
|
||||
@ -86,9 +86,8 @@ bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend, const
|
||||
(*backend)->free(*re);
|
||||
|
||||
*re = NULL;
|
||||
*backend = NULL;
|
||||
|
||||
*backend = find_resampler_driver(ident);
|
||||
|
||||
if (!*backend)
|
||||
return false;
|
||||
|
||||
|
15
config.def.h
15
config.def.h
@ -68,6 +68,9 @@ enum
|
||||
AUDIO_PSP1,
|
||||
AUDIO_NULL,
|
||||
|
||||
AUDIO_RESAMPLER_CC,
|
||||
AUDIO_RESAMPLER_SINC,
|
||||
|
||||
INPUT_ANDROID,
|
||||
INPUT_SDL,
|
||||
INPUT_X,
|
||||
@ -170,6 +173,12 @@ enum
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_NULL
|
||||
#endif
|
||||
|
||||
#ifdef PSP
|
||||
#define AUDIO_DEFAULT_RESAMPLER_DRIVER AUDIO_RESAMPLER_CC
|
||||
#else
|
||||
#define AUDIO_DEFAULT_RESAMPLER_DRIVER AUDIO_RESAMPLER_SINC
|
||||
#endif
|
||||
|
||||
#if defined(XENON)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_XENON360
|
||||
#elif defined(_XBOX360) || defined(_XBOX) || defined(HAVE_XINPUT2) || defined(HAVE_XINPUT_XBOX1)
|
||||
@ -465,12 +474,6 @@ static const int out_latency = 64;
|
||||
// Will sync audio. (recommended)
|
||||
static const bool audio_sync = true;
|
||||
|
||||
// Default resampler
|
||||
#if defined(PSP)
|
||||
static const char *audio_resampler = "CC";
|
||||
#else
|
||||
static const char *audio_resampler = "sinc";
|
||||
#endif
|
||||
|
||||
// Audio rate control
|
||||
#if defined(GEKKO) || !defined(RARCH_CONSOLE)
|
||||
|
@ -734,6 +734,7 @@ const char *config_get_default_osk(void);
|
||||
#endif
|
||||
const char *config_get_default_video(void);
|
||||
const char *config_get_default_audio(void);
|
||||
const char *config_get_default_audio_resampler(void);
|
||||
const char *config_get_default_input(void);
|
||||
|
||||
#include "conf/config_file.h"
|
||||
|
16
settings.c
16
settings.c
@ -80,6 +80,18 @@ const char *config_get_default_audio(void)
|
||||
}
|
||||
}
|
||||
|
||||
const char *config_get_default_audio_resampler(void)
|
||||
{
|
||||
switch (AUDIO_DEFAULT_RESAMPLER_DRIVER)
|
||||
{
|
||||
case AUDIO_RESAMPLER_CC:
|
||||
return "cc";
|
||||
case AUDIO_RESAMPLER_SINC:
|
||||
default:
|
||||
return "sinc";
|
||||
}
|
||||
}
|
||||
|
||||
const char *config_get_default_video(void)
|
||||
{
|
||||
switch (VIDEO_DEFAULT_DRIVER)
|
||||
@ -230,6 +242,7 @@ void config_set_defaults(void)
|
||||
unsigned i, j;
|
||||
const char *def_video = config_get_default_video();
|
||||
const char *def_audio = config_get_default_audio();
|
||||
const char *def_audio_resampler = config_get_default_audio_resampler();
|
||||
const char *def_input = config_get_default_input();
|
||||
#ifdef HAVE_MENU
|
||||
const char *def_menu = config_get_default_menu();
|
||||
@ -258,6 +271,8 @@ void config_set_defaults(void)
|
||||
strlcpy(g_settings.video.driver, def_video, sizeof(g_settings.video.driver));
|
||||
if (def_audio)
|
||||
strlcpy(g_settings.audio.driver, def_audio, sizeof(g_settings.audio.driver));
|
||||
if (def_audio_resampler)
|
||||
strlcpy(g_settings.audio.resampler, def_audio, sizeof(g_settings.audio.resampler));
|
||||
if (def_input)
|
||||
strlcpy(g_settings.input.driver, def_input, sizeof(g_settings.input.driver));
|
||||
#ifdef HAVE_MENU
|
||||
@ -333,7 +348,6 @@ void config_set_defaults(void)
|
||||
g_settings.audio.volume = audio_volume;
|
||||
g_extern.audio_data.volume_db = g_settings.audio.volume;
|
||||
g_extern.audio_data.volume_gain = db_to_gain(g_settings.audio.volume);
|
||||
strlcpy(g_settings.audio.resampler, audio_resampler, sizeof(g_settings.audio.resampler));
|
||||
|
||||
g_settings.rewind_enable = rewind_enable;
|
||||
g_settings.rewind_buffer_size = rewind_buffer_size;
|
||||
|
@ -816,6 +816,7 @@ rarch_setting_t* setting_data_get_list(void)
|
||||
CONFIG_STRING(g_settings.video.gl_context, "video_gl_context", "OpenGL Context Driver", "", GROUP_NAME, SUBGROUP_NAME, NULL)
|
||||
#endif
|
||||
CONFIG_STRING(g_settings.audio.driver, "audio_driver", "Audio Driver", config_get_default_audio(), GROUP_NAME, SUBGROUP_NAME, NULL)
|
||||
CONFIG_STRING(g_settings.audio.resampler, "audio_driver", "Audio Resampler Driver", config_get_default_audio_resampler(), GROUP_NAME, SUBGROUP_NAME, NULL)
|
||||
CONFIG_STRING(g_settings.input.driver, "input_driver", "Input Driver", config_get_default_input(), GROUP_NAME, SUBGROUP_NAME, NULL)
|
||||
#ifdef HAVE_CAMERA
|
||||
CONFIG_STRING(g_settings.camera.device, "camera_device", "Camera Driver", config_get_default_camera(), GROUP_NAME, SUBGROUP_NAME, NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user