A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

album art setting: use settings callback

Since even Shuffle and Repeat are now immediately applied
from the Quickscreen, I suppose it makes sense to do the
same for the album art setting as the remaining holdout.

Change-Id: Ib1b56c31f28d8197e001901296d9897a23134564

+14 -41
-12
apps/gui/quickscreen.c
··· 39 39 #include "option_select.h" 40 40 #include "debug.h" 41 41 #include "shortcuts.h" 42 - #ifdef HAVE_ALBUMART 43 - #include "playback.h" 44 - #endif 45 42 #include "appevents.h" 46 43 47 44 /* 1 top, 1 bottom, 2 on either side, 1 for the icons ··· 438 435 int quick_screen_quick(int button_enter) 439 436 { 440 437 struct gui_quickscreen qs; 441 - #ifdef HAVE_ALBUMART 442 - int old_album_art = global_settings.album_art; 443 - #endif 444 438 bool usb = false; 445 439 446 440 for (int i = 0; i < 4; ++i) ··· 453 447 454 448 int ret = gui_syncquickscreen_run(&qs, button_enter, &usb); 455 449 if (ret & QUICKSCREEN_CHANGED) 456 - { 457 450 settings_save(); 458 - #ifdef HAVE_ALBUMART 459 - if (old_album_art != global_settings.album_art) 460 - set_albumart_mode(global_settings.album_art); 461 - #endif 462 - } 463 451 if (usb) 464 452 return QUICKSCREEN_IN_USB; 465 453 return ret & QUICKSCREEN_GOTO_SHORTCUTS_MENU ? QUICKSCREEN_GOTO_SHORTCUTS_MENU :
+1 -20
apps/menus/playback_menu.c
··· 177 177 MENUITEM_SETTING(play_frequency, &global_settings.play_frequency, NULL); 178 178 #endif 179 179 #ifdef HAVE_ALBUMART 180 - static int albumart_callback(int action, 181 - const struct menu_item_ex *this_item, 182 - struct gui_synclist *this_list) 183 - { 184 - (void)this_item; 185 - (void)this_list; 186 - static int initial_aa_setting; 187 - switch (action) 188 - { 189 - case ACTION_ENTER_MENUITEM: 190 - initial_aa_setting = global_settings.album_art; 191 - break; 192 - case ACTION_EXIT_MENUITEM: /* on exit */ 193 - if (initial_aa_setting != global_settings.album_art) 194 - set_albumart_mode(global_settings.album_art); 195 - } 196 - return action; 197 - } 198 - MENUITEM_SETTING(album_art, &global_settings.album_art, 199 - albumart_callback); 180 + MENUITEM_SETTING(album_art, &global_settings.album_art, NULL); 200 181 #endif 201 182 202 183 MENUITEM_SETTING(playback_log, &global_settings.playback_log, NULL);
+13 -6
apps/settings_list.c
··· 656 656 } 657 657 #endif /* HAVE_PLAY_FREQ */ 658 658 659 + #ifdef HAVE_ALBUMART 660 + static void albumart_callback(int mode) 661 + { 662 + set_albumart_mode(mode); 663 + } 664 + #endif 665 + 659 666 /* perform shuffle/unshuffle of the current playlist based on the boolean provided */ 660 667 static void shuffle_playlist_callback(bool shuffle) 661 668 { ··· 1032 1039 #endif /* HAVE_PLAY_FREQ */ 1033 1040 1034 1041 #ifdef HAVE_ALBUMART 1035 - CHOICE_SETTING(0, album_art, LANG_ALBUM_ART, 1, 1036 - "album art", "off,prefer embedded,prefer image file", 1037 - NULL, 3, 1038 - ID2P(LANG_OFF), 1039 - ID2P(LANG_PREFER_EMBEDDED), 1040 - ID2P(LANG_PREFER_IMAGE_FILE)), 1042 + CHOICE_SETTING(F_CB_ON_SELECT_ONLY|F_CB_ONLY_IF_CHANGED, album_art, 1043 + LANG_ALBUM_ART, 1, "album art", 1044 + "off,prefer embedded,prefer image file", 1045 + albumart_callback, 3, 1046 + ID2P(LANG_OFF), ID2P(LANG_PREFER_EMBEDDED), 1047 + ID2P(LANG_PREFER_IMAGE_FILE)), 1041 1048 #endif 1042 1049 1043 1050 /* LCD */
-3
apps/shortcuts.c
··· 47 47 #include "screens.h" 48 48 #include "talk.h" 49 49 #include "yesno.h" 50 - #ifdef HAVE_ALBUMART 51 - #include "playback.h" 52 - #endif 53 50 54 51 #define MAX_SHORTCUT_NAME 64 55 52 #define SHORTCUTS_HDR "[shortcut]"