Index: apps/recorder/radio.c =================================================================== --- apps/recorder/radio.c (revision 25966) +++ apps/recorder/radio.c (working copy) @@ -69,6 +69,7 @@ #include "viewport.h" #include "skin_engine/skin_engine.h" #include "statusbar-skinned.h" +#include "buffering.h" #if CONFIG_TUNER @@ -504,6 +505,39 @@ static struct wps_data fms_skin_data[NB_SCREENS] = {{ .wps_loaded = 0 }}; static struct wps_sync_data fms_skin_sync_data = { .do_full_update = false }; +#ifdef HAVE_ALBUMART +static int radio_art_handle; +static char current_art_name[MAX_FMPRESET_LEN+1]; +int radio_get_art_hid(void) +{ + int preset = radio_current_preset(); + static struct dim aa_dim; + if (radio_art_handle >= 0) + { + if (preset>= 0 && !strcmp(current_art_name, presets[preset].name)) + return radio_art_handle; + else + bufclose(radio_art_handle); + } + if (radio_mode == RADIO_PRESET_MODE) + { + char path[MAX_PATH]; + snprintf(path, sizeof(path), FMPRESET_PATH "/%s.bmp",presets[preset].name); + strlcpy(current_art_name, presets[preset].name, sizeof(current_art_name)); + aa_dim.height = fms_skin_data[0].albumart->height; + aa_dim.width = fms_skin_data[0].albumart->width; + radio_art_handle = bufopen(path, 0, TYPE_BITMAP, &aa_dim); + } + return radio_art_handle; +} +void playback_restarting_handler(void *data) +{ + (void)data; + if (radio_art_handle >= 0) + bufclose(radio_art_handle); + radio_art_handle = -1; +} +#endif void fms_data_load(enum screen_type screen, const char *buf, bool isfile) { @@ -616,6 +650,9 @@ if(radio_status == FMRADIO_OFF) audio_stop(); + + radio_art_handle = -1; + add_event(PLAYBACK_EVENT_START_PLAYBACK, true, playback_restarting_handler); #ifndef SIMULATOR #if CONFIG_CODEC != SWCODEC Index: apps/gui/skin_engine/skin_display.c =================================================================== --- apps/gui/skin_engine/skin_display.c (revision 25966) +++ apps/gui/skin_engine/skin_display.c (working copy) @@ -443,8 +443,12 @@ if (data->albumart && data->albumart->vp == vp && data->albumart->draw) { - draw_album_art(gwps, playback_current_aa_hid(data->playback_aa_slot), - false); + int handle = playback_current_aa_hid(data->playback_aa_slot); +#if CONFIG_TUNER + if (in_radio_screen()) + handle = radio_get_art_hid(); +#endif + draw_album_art(gwps, handle, false); data->albumart->draw = false; } #endif Index: apps/appevents.h =================================================================== --- apps/appevents.h (revision 25963) +++ apps/appevents.h (working copy) @@ -31,7 +31,8 @@ /** Playback events **/ enum { - PLAYBACK_EVENT_TRACK_BUFFER = (EVENT_CLASS_PLAYBACK|1), + PLAYBACK_EVENT_START_PLAYBACK = (EVENT_CLASS_PLAYBACK|1), + PLAYBACK_EVENT_TRACK_BUFFER, PLAYBACK_EVENT_TRACK_FINISH, PLAYBACK_EVENT_TRACK_CHANGE, PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, Index: apps/playback.c =================================================================== --- apps/playback.c (revision 25964) +++ apps/playback.c (working copy) @@ -1709,6 +1709,7 @@ { int i; + send_event(PLAYBACK_EVENT_START_PLAYBACK, NULL); #if INPUT_SRC_CAPS != 0 audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK); audio_set_output_source(AUDIO_SRC_PLAYBACK); Index: apps/buffering.c =================================================================== --- apps/buffering.c (revision 25963) +++ apps/buffering.c (working copy) @@ -1007,7 +1007,6 @@ } /* Other cases: there is a little more work. */ - int fd = open(file, O_RDONLY); if (fd < 0) return ERR_FILE_ERROR;