(Menu) Refactor audio_device setting

This commit is contained in:
twinaphex 2014-08-31 04:42:21 +02:00
parent 5f8b9d743c
commit 9e6f6e45cf
2 changed files with 9 additions and 9 deletions

View File

@ -413,7 +413,7 @@ static void menu_common_entries_init(menu_handle_t *menu, unsigned menu_type)
add_setting_entry(menu,"audio_rate_control_delta", 0, setting_data);
add_setting_entry(menu,"system_bgm_enable", 0, setting_data);
add_setting_entry(menu,"audio_volume", 0, setting_data);
add_setting_entry(menu,"audio_device", MENU_SETTINGS_DRIVER_AUDIO_DEVICE, setting_data);
add_setting_entry(menu,"audio_device", 0, setting_data);
break;
case MENU_SETTINGS_DRIVERS:
file_list_clear(menu->selection_buf);
@ -1297,6 +1297,14 @@ static void handle_setting(rarch_setting_t *setting,
menu_common_setting_set_current_path_selection(setting, setting->default_value.string, id, action);
else if (setting->type == ST_STRING)
{
if (!strcmp(setting->name, "audio_device"))
{
if (action == MENU_ACTION_OK)
menu_key_start_line(driver.menu, "Audio Device Name / IP: ",
"audio_device", st_string_callback);
else if (action == MENU_ACTION_START)
*setting->value.string = '\0';
}
if (!strcmp(setting->name, "video_driver"))
handle_driver(RARCH_DRIVER_VIDEO, g_settings.video.driver,
sizeof(g_settings.video.driver), action);
@ -1748,12 +1756,6 @@ static int menu_common_setting_set(unsigned id, unsigned action)
*g_extern.netplay_server = '\0';
break;
#endif
case MENU_SETTINGS_DRIVER_AUDIO_DEVICE:
if (action == MENU_ACTION_OK)
menu_key_start_line(driver.menu, "Audio Device Name / IP: ", "audio_device", st_string_callback);
else if (action == MENU_ACTION_START)
*g_settings.audio.device = '\0';
break;
case MENU_SETTINGS_NETPLAY_NICKNAME:
if (action == MENU_ACTION_OK)
menu_key_start_line(driver.menu, "Username: ", "netplay_nickname", st_string_callback);

View File

@ -32,7 +32,6 @@ typedef enum
// Shader stuff
MENU_SETTINGS_GENERAL_OPTIONS = MENU_SETTINGS + 1,
MENU_SETTINGS_VIDEO_OPTIONS,
MENU_SETTINGS_VIDEO_OPTIONS_FIRST,
MENU_SETTINGS_VIDEO_RESOLUTION,
MENU_SETTINGS_CUSTOM_VIEWPORT,
MENU_SETTINGS_CUSTOM_VIEWPORT_2,
@ -80,7 +79,6 @@ typedef enum
MENU_SETTINGS_DISK_OPTIONS,
MENU_SETTINGS_DISK_INDEX,
MENU_SETTINGS_DISK_APPEND,
MENU_SETTINGS_DRIVER_AUDIO_DEVICE,
MENU_SCREENSHOT_DIR_PATH,
MENU_BROWSER_DIR_PATH,
MENU_CONTENT_HISTORY_PATH,