From bc5a6385949c9f0a17173f3512aa9a6db9175803 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Fri, 19 Nov 2021 05:11:13 +0100 Subject: Option to switch off album art or to prefer file over embedded Large embedded album art can cause pauses during playback or when skipping between tracks, especially on older devices, but embedded art is currently loaded even when separately stored smaller image files would be available. A workaround is to remove large album art from the metadata of files. This now adds a setting to either turn off loading of album art completely, or to prefer loading the album art from a separate image file and thus ignore the embedded versions. Change-Id: I22fb581abf56072e35e6c29d72e553747ec1a96a --- apps/menus/playback_menu.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'apps/menus/playback_menu.c') diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c index 5f9479fae3..fe319d6027 100644 --- a/apps/menus/playback_menu.c +++ b/apps/menus/playback_menu.c @@ -201,6 +201,28 @@ MENUITEM_SETTING(pause_rewind, &global_settings.pause_rewind, NULL); MENUITEM_SETTING(play_frequency, &global_settings.play_frequency, playback_callback); #endif +#ifdef HAVE_ALBUMART +static int albumart_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) +{ + (void)this_item; + (void)this_list; + static int initial_aa_setting; + switch (action) + { + case ACTION_ENTER_MENUITEM: + initial_aa_setting = global_settings.album_art; + break; + case ACTION_EXIT_MENUITEM: /* on exit */ + if (initial_aa_setting != global_settings.album_art) + set_albumart_mode(global_settings.album_art); + } + return action; +} +MENUITEM_SETTING(album_art, &global_settings.album_art, + albumart_callback); +#endif MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0, Icon_Playback_menu, @@ -230,6 +252,9 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0, ,&pause_rewind #ifdef HAVE_PLAY_FREQ ,&play_frequency +#endif +#ifdef HAVE_ALBUMART + ,&album_art #endif ); -- cgit v1.2.3