Change audio_resampler_driver to 'OPTIONS'

This commit is contained in:
twinaphex 2014-12-31 20:17:53 +01:00
parent 3ee3e5a1a5
commit 1e3686df40
3 changed files with 32 additions and 1 deletions

View File

@ -46,6 +46,7 @@ static int find_resampler_driver_index(const char *drv)
}
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
#include <string/string_list.h>
#include "../../general.h"
void find_prev_resampler_driver(void)
@ -69,6 +70,33 @@ void find_next_resampler_driver(void)
RARCH_WARN("Couldn't find any next resampler driver (current one: \"%s\").\n",
driver.resampler->ident);
}
const char* config_get_audio_resampler_driver_options(void)
{
union string_list_elem_attr attr;
char *options = NULL;
int option_k = 0;
int options_len = 0;
struct string_list *options_l = string_list_new();
attr.i = 0;
for (option_k = 0; resampler_drivers[option_k]; option_k++)
{
const char *opt = resampler_drivers[option_k]->ident;
options_len += strlen(opt) + 1;
string_list_append(options_l, opt, attr);
}
options = (char*)calloc(options_len, sizeof(char));
string_list_join_concat(options, options_len, options_l, "|");
string_list_free(options_l);
options_l = NULL;
return options;
}
#endif
/* Resampler is used by multiple modules so avoid

View File

@ -570,6 +570,8 @@ void uninit_drivers(int flags);
void find_prev_driver(const char *label, char *str, size_t sizeof_str);
void find_next_driver(const char *label, char *str, size_t sizeof_str);
const char* config_get_audio_resampler_driver_options(void);
void find_prev_resampler_driver(void);
void find_next_resampler_driver(void);

View File

@ -3066,11 +3066,12 @@ static bool setting_data_append_list_driver_options(
NULL);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
CONFIG_STRING(
CONFIG_STRING_OPTIONS(
g_settings.audio.resampler,
"audio_resampler_driver",
"Audio Resampler Driver",
config_get_default_audio_resampler(),
config_get_audio_resampler_driver_options(),
group_info.name,
subgroup_info.name,
NULL,