mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 18:20:27 +00:00
(audio driver) Refactor
This commit is contained in:
parent
13998f583a
commit
8b714d2932
@ -891,6 +891,17 @@ bool audio_driver_disable_callback(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Sets audio monitor rate to new value. */
|
||||
void audio_driver_monitor_set_rate(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
double new_src_ratio = (double)settings->audio.out_rate /
|
||||
audio_driver_data.audio_rate.input;
|
||||
|
||||
audio_driver_data.audio_rate.source_ratio.original = new_src_ratio;
|
||||
audio_driver_data.audio_rate.source_ratio.current = new_src_ratio;
|
||||
}
|
||||
|
||||
bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -921,15 +932,6 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
case RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES:
|
||||
audio_monitor_adjust_system_rates();
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE:
|
||||
{
|
||||
double new_src_ratio = (double)settings->audio.out_rate /
|
||||
audio_driver_data.audio_rate.input;
|
||||
|
||||
audio_driver_data.audio_rate.source_ratio.original = new_src_ratio;
|
||||
audio_driver_data.audio_rate.source_ratio.current = new_src_ratio;
|
||||
}
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MUTE_TOGGLE:
|
||||
if (!audio_driver_context_audio_data)
|
||||
return false;
|
||||
|
@ -45,8 +45,6 @@ enum rarch_audio_ctl_state
|
||||
RARCH_AUDIO_CTL_DESTROY_DATA,
|
||||
RARCH_AUDIO_CTL_START,
|
||||
RARCH_AUDIO_CTL_STOP,
|
||||
/* Sets audio monitor refresh rate to new value. */
|
||||
RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE,
|
||||
RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES,
|
||||
RARCH_AUDIO_CTL_MUTE_TOGGLE,
|
||||
RARCH_AUDIO_CTL_UNSET_CALLBACK,
|
||||
@ -181,6 +179,9 @@ void audio_driver_setup_rewind(void);
|
||||
|
||||
bool audio_driver_set_callback(const void *data);
|
||||
|
||||
/* Sets audio monitor rate to new value. */
|
||||
void audio_driver_monitor_set_rate(void);
|
||||
|
||||
bool audio_driver_find_driver(void);
|
||||
|
||||
bool audio_driver_deinit(void);
|
||||
|
Loading…
Reference in New Issue
Block a user