Get rid of audio_driver_set_volume_gain

This commit is contained in:
twinaphex 2017-06-08 22:24:51 +02:00
parent 65633c93f3
commit 420d0d0607
5 changed files with 8 additions and 11 deletions

View File

@ -727,11 +727,6 @@ size_t audio_driver_sample_batch_rewind(const int16_t *data, size_t frames)
return frames;
}
void audio_driver_set_volume_gain(float gain)
{
audio_driver_volume_gain = gain;
}
void audio_driver_dsp_filter_free(void)
{
if (audio_driver_dsp)
@ -1244,6 +1239,9 @@ void audio_set_float(enum audio_action action, float val)
{
switch (action)
{
case AUDIO_ACTION_VOLUME_GAIN:
audio_driver_volume_gain = val;
break;
case AUDIO_ACTION_RATE_CONTROL_DELTA:
audio_driver_rate_control_delta = val;
break;

View File

@ -39,6 +39,7 @@ enum audio_action
AUDIO_ACTION_NONE = 0,
AUDIO_ACTION_RATE_CONTROL_DELTA,
AUDIO_ACTION_MUTE_ENABLE,
AUDIO_ACTION_VOLUME_GAIN,
AUDIO_ACTION_MIXER
};
@ -201,8 +202,6 @@ size_t audio_driver_sample_batch_rewind(const int16_t *data, size_t frames);
bool audio_driver_mixer_extension_supported(const char *ext);
void audio_driver_set_volume_gain(float gain);
void audio_driver_dsp_filter_free(void);
void audio_driver_dsp_filter_init(const char *device);

View File

@ -930,7 +930,7 @@ static void command_event_set_volume(float gain)
runloop_msg_queue_push(msg, 1, 180, true);
RARCH_LOG("%s\n", msg);
audio_driver_set_volume_gain(db_to_gain(new_volume));
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, new_volume);
}
/**

View File

@ -1531,7 +1531,7 @@ static void config_set_defaults(void)
settings->uints.audio_latency = g_defaults.settings.out_latency;
audio_driver_set_volume_gain(db_to_gain(settings->floats.audio_volume));
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
settings->rewind_buffer_size = rewind_buffer_size;
@ -2440,7 +2440,7 @@ static bool config_load_file(const char *path, bool set_defaults,
settings->uints.video_swap_interval = MAX(settings->uints.video_swap_interval, 1);
settings->uints.video_swap_interval = MIN(settings->uints.video_swap_interval, 4);
audio_driver_set_volume_gain(db_to_gain(settings->floats.audio_volume));
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
if (string_is_empty(settings->paths.path_content_history))
{

View File

@ -1686,7 +1686,7 @@ void general_write_handler(void *data)
}
break;
case MENU_ENUM_LABEL_AUDIO_VOLUME:
audio_driver_set_volume_gain(db_to_gain(*setting->value.target.fraction));
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, db_to_gain(*setting->value.target.fraction));
break;
case MENU_ENUM_LABEL_AUDIO_LATENCY:
case MENU_ENUM_LABEL_AUDIO_DEVICE: