(RGUI) Add placeholder rate control option - needs way to be 'enabled'

/ 'disabled' ingame
This commit is contained in:
twinaphex 2013-05-04 22:47:14 +02:00
parent d447dba432
commit 6992ab8943
2 changed files with 14 additions and 1 deletions

View File

@ -158,6 +158,7 @@ typedef enum
RGUI_SETTINGS_RESTART_GAME,
RGUI_SETTINGS_AUDIO_MUTE,
RGUI_SETTINGS_AUDIO_CONTROL_RATE,
RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA,
RGUI_SETTINGS_ZIP_EXTRACT,
RGUI_SETTINGS_SRAM_DIR,
RGUI_SETTINGS_STATE_DIR,

View File

@ -584,6 +584,9 @@ static void render_text(rgui_handle_t *rgui)
strlcpy(type_str, "OFF", sizeof(type_str));
break;
case RGUI_SETTINGS_AUDIO_CONTROL_RATE:
snprintf(type_str, sizeof(type_str), g_settings.audio.rate_control ? "ON" : "OFF");
break;
case RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA:
snprintf(type_str, sizeof(type_str), "%.3f", g_settings.audio.rate_control_delta);
break;
case RGUI_SETTINGS_SRAM_DIR:
@ -911,6 +914,14 @@ static int rgui_settings_toggle_setting(rgui_handle_t *rgui, unsigned setting, r
settings_set(1ULL << S_AUDIO_MUTE);
break;
case RGUI_SETTINGS_AUDIO_CONTROL_RATE:
if (action == RGUI_ACTION_START)
g_settings.audio.rate_control = true;
else if (action == RGUI_ACTION_LEFT ||
action == RGUI_ACTION_RIGHT ||
action == RGUI_ACTION_OK)
g_settings.audio.rate_control = !g_settings.audio.rate_control;
break;
case RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA:
if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_AUDIO_CONTROL_RATE);
else if (action == RGUI_ACTION_LEFT)
@ -1187,7 +1198,8 @@ static void rgui_settings_audio_options_populate_entries(rgui_handle_t *rgui)
{
rgui_list_clear(rgui->selection_buf);
rgui_list_push(rgui->selection_buf, "Mute Audio", RGUI_SETTINGS_AUDIO_MUTE, 0);
rgui_list_push(rgui->selection_buf, "Audio Control Rate", RGUI_SETTINGS_AUDIO_CONTROL_RATE, 0);
rgui_list_push(rgui->selection_buf, "Rate Control", RGUI_SETTINGS_AUDIO_CONTROL_RATE, 0);
rgui_list_push(rgui->selection_buf, "Rate Control Delta", RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA, 0);
}
static void rgui_settings_disc_options_populate_entries(rgui_handle_t *rgui)