(Menu widgets) Refactor

This commit is contained in:
twinaphex 2020-02-16 23:34:49 +01:00
parent 31a7e5628c
commit 5d5200d20b
3 changed files with 10 additions and 7 deletions

View File

@ -2227,10 +2227,9 @@ static void menu_widgets_volume_timer_end(void *userdata)
gfx_animation_push(&entry);
}
void menu_widgets_volume_update_and_show(float new_volume)
void menu_widgets_volume_update_and_show(float new_volume, bool mute)
{
gfx_timer_ctx_entry_t entry;
bool mute = *(audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE));
gfx_animation_kill_by_tag(&volume_tag);
@ -2273,8 +2272,7 @@ bool menu_widgets_ai_service_overlay_load(
{
if (ai_service_overlay_state == 0)
{
bool res;
res = gfx_display_reset_textures_list_buffer(
bool res = gfx_display_reset_textures_list_buffer(
&ai_service_overlay_texture,
TEXTURE_FILTER_MIPMAP_LINEAR,
(void *) buffer, buffer_len, image_type,

View File

@ -48,7 +48,8 @@ void menu_widgets_msg_queue_push(
enum message_queue_category category,
unsigned prio, bool flush);
void menu_widgets_volume_update_and_show(float new_volume);
void menu_widgets_volume_update_and_show(float new_volume,
bool mute);
void menu_widgets_iterate(
unsigned width, unsigned height,

View File

@ -5428,7 +5428,9 @@ static void command_event_set_volume(float gain)
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (menu_widgets_inited)
menu_widgets_volume_update_and_show(settings->floats.audio_volume);
menu_widgets_volume_update_and_show(settings->floats.audio_volume,
audio_driver_mute_enable
);
else
#endif
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
@ -6912,7 +6914,9 @@ TODO: Add a setting for these tweaks */
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (menu_widgets_inited)
menu_widgets_volume_update_and_show(configuration_settings->floats.audio_volume);
menu_widgets_volume_update_and_show(
configuration_settings->floats.audio_volume,
audio_driver_mute_enable);
else
#endif
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);