diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2022-10-21 05:57:24 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2022-10-22 09:33:50 +0200 |
commit | 498988d34a50bb5fe32cf1092f11e3c10a0ac821 (patch) | |
tree | b0ad6b0b7a3d05bae278cbe6d14fdc581619a26c | |
parent | 653082ad1d7a5d55cdaf0a1e8071ebecc5aaa5fc (diff) | |
download | rockbox-498988d34a50bb5fe32cf1092f11e3c10a0ac821.tar.gz rockbox-498988d34a50bb5fe32cf1092f11e3c10a0ac821.zip |
PictureFlow: Minor fixes & changed defaults
- Fix FPS counter overlapping
the artist string when
"Show album title" was set to
"Show album and artist at the top"
- Fix disappearance of center album
if certain Settings menus had been
accessed while list of tracks was
showing and you then returned to the
list of albums
- Fix disappearing album artwork after
cache had been created until you started
scrolling
- Enable context menu even if WPS
integration is disabled
- Make splash screen appear only
on first launch and for database
updates, when it is actually on screen
for long enough
- Eliminate 'Loading' splash if tagcache
is in RAM
- Show both album and artist by default on
displays whose height > 100px
Change-Id: Ie70c0d9093789294d288a4f88338ee4a588bf4a5
-rw-r--r-- | apps/plugin.c | 5 | ||||
-rw-r--r-- | apps/plugin.h | 7 | ||||
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 71 | ||||
-rw-r--r-- | apps/tagcache.c | 8 | ||||
-rw-r--r-- | apps/tagcache.h | 1 | ||||
-rw-r--r-- | apps/tagtree.c | 6 |
6 files changed, 66 insertions, 32 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 4016040c5a..128b52ea2d 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -820,6 +820,11 @@ static const struct plugin_api rockbox_api = { | |||
820 | 820 | ||
821 | /* new stuff at the end, sort into place next time | 821 | /* new stuff at the end, sort into place next time |
822 | the API gets incompatible */ | 822 | the API gets incompatible */ |
823 | #ifdef HAVE_TAGCACHE | ||
824 | #ifdef HAVE_TC_RAMCACHE | ||
825 | tagcache_is_in_ram, | ||
826 | #endif | ||
827 | #endif | ||
823 | }; | 828 | }; |
824 | 829 | ||
825 | static int plugin_buffer_handle; | 830 | static int plugin_buffer_handle; |
diff --git a/apps/plugin.h b/apps/plugin.h index 2ac333a19f..e2a821bb57 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -157,7 +157,7 @@ int plugin_open(const char *plugin, const char *parameter); | |||
157 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 157 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
158 | 158 | ||
159 | /* increase this every time the api struct changes */ | 159 | /* increase this every time the api struct changes */ |
160 | #define PLUGIN_API_VERSION 255 | 160 | #define PLUGIN_API_VERSION 256 |
161 | 161 | ||
162 | /* update this to latest version if a change to the api struct breaks | 162 | /* update this to latest version if a change to the api struct breaks |
163 | backwards compatibility (and please take the opportunity to sort in any | 163 | backwards compatibility (and please take the opportunity to sort in any |
@@ -946,6 +946,11 @@ struct plugin_api { | |||
946 | #endif | 946 | #endif |
947 | /* new stuff at the end, sort into place next time | 947 | /* new stuff at the end, sort into place next time |
948 | the API gets incompatible */ | 948 | the API gets incompatible */ |
949 | #ifdef HAVE_TAGCACHE | ||
950 | #ifdef HAVE_TC_RAMCACHE | ||
951 | bool (*tagcache_is_in_ram)(void); | ||
952 | #endif | ||
953 | #endif | ||
949 | }; | 954 | }; |
950 | 955 | ||
951 | /* plugin header */ | 956 | /* plugin header */ |
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index eec8313485..e8c2e070eb 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c | |||
@@ -689,7 +689,7 @@ static void config_set_defaults(struct pf_config_t *cfg) | |||
689 | cfg->resize = true; | 689 | cfg->resize = true; |
690 | cfg->cache_version = CACHE_REBUILD; | 690 | cfg->cache_version = CACHE_REBUILD; |
691 | cfg->show_album_name = (LCD_HEIGHT > 100) | 691 | cfg->show_album_name = (LCD_HEIGHT > 100) |
692 | ? ALBUM_NAME_TOP : ALBUM_NAME_BOTTOM; | 692 | ? ALBUM_AND_ARTIST_BOTTOM : ALBUM_NAME_BOTTOM; |
693 | cfg->sort_albums_by = SORT_BY_ARTIST_AND_NAME; | 693 | cfg->sort_albums_by = SORT_BY_ARTIST_AND_NAME; |
694 | cfg->year_sort_order = ASCENDING; | 694 | cfg->year_sort_order = ASCENDING; |
695 | cfg->show_year = false; | 695 | cfg->show_year = false; |
@@ -2321,6 +2321,8 @@ aa_success: | |||
2321 | configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS, | 2321 | configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS, |
2322 | CONFIG_VERSION); | 2322 | CONFIG_VERSION); |
2323 | free_all_slide_prio(0); | 2323 | free_all_slide_prio(0); |
2324 | if (pf_state == pf_idle) | ||
2325 | rb->queue_post(&thread_q, EV_WAKEUP, 0); | ||
2324 | } | 2326 | } |
2325 | 2327 | ||
2326 | if(verbose)/* direct interaction with user */ | 2328 | if(verbose)/* direct interaction with user */ |
@@ -3492,6 +3494,20 @@ static void cleanup(void) | |||
3492 | #endif | 3494 | #endif |
3493 | } | 3495 | } |
3494 | 3496 | ||
3497 | static void interrupt_cover_in_animation(void); | ||
3498 | static void adjust_album_display_for_setting(int old_val, int new_val) | ||
3499 | { | ||
3500 | if (old_val == new_val) | ||
3501 | return; | ||
3502 | |||
3503 | reset_track_list(); | ||
3504 | recalc_offsets(); | ||
3505 | reset_slides(); | ||
3506 | |||
3507 | if (pf_state == pf_show_tracks) | ||
3508 | interrupt_cover_in_animation(); | ||
3509 | } | ||
3510 | |||
3495 | /** | 3511 | /** |
3496 | Shows the settings menu | 3512 | Shows the settings menu |
3497 | */ | 3513 | */ |
@@ -3547,11 +3563,10 @@ static int settings_menu(void) | |||
3547 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); | 3563 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); |
3548 | switch(selection) { | 3564 | switch(selection) { |
3549 | case 0: | 3565 | case 0: |
3566 | old_val = pf_cfg.show_album_name; | ||
3550 | rb->set_option(rb->str(LANG_SHOW_ALBUM_TITLE), | 3567 | rb->set_option(rb->str(LANG_SHOW_ALBUM_TITLE), |
3551 | &pf_cfg.show_album_name, INT, album_name_options, 5, NULL); | 3568 | &pf_cfg.show_album_name, INT, album_name_options, 5, NULL); |
3552 | reset_track_list(); | 3569 | adjust_album_display_for_setting(old_val, pf_cfg.show_album_name); |
3553 | recalc_offsets(); | ||
3554 | reset_slides(); | ||
3555 | break; | 3570 | break; |
3556 | case 1: | 3571 | case 1: |
3557 | rb->set_bool(rb->str(LANG_SHOW_YEAR_IN_ALBUM_TITLE), &pf_cfg.show_year); | 3572 | rb->set_bool(rb->str(LANG_SHOW_YEAR_IN_ALBUM_TITLE), &pf_cfg.show_year); |
@@ -3573,38 +3588,40 @@ static int settings_menu(void) | |||
3573 | pf_cfg.year_sort_order = old_val; | 3588 | pf_cfg.year_sort_order = old_val; |
3574 | break; | 3589 | break; |
3575 | case 4: | 3590 | case 4: |
3591 | old_val = pf_cfg.show_fps; | ||
3576 | rb->set_bool(rb->str(LANG_DISPLAY_FPS), &pf_cfg.show_fps); | 3592 | rb->set_bool(rb->str(LANG_DISPLAY_FPS), &pf_cfg.show_fps); |
3577 | reset_track_list(); | 3593 | if (old_val != pf_cfg.show_fps) |
3594 | reset_track_list(); | ||
3578 | break; | 3595 | break; |
3579 | 3596 | ||
3580 | case 5: | 3597 | case 5: |
3598 | old_val = pf_cfg.slide_spacing; | ||
3581 | rb->set_int(rb->str(LANG_SPACING), "", 1, | 3599 | rb->set_int(rb->str(LANG_SPACING), "", 1, |
3582 | &pf_cfg.slide_spacing, | 3600 | &pf_cfg.slide_spacing, |
3583 | NULL, 1, 0, 100, NULL ); | 3601 | NULL, 1, 0, 100, NULL ); |
3584 | recalc_offsets(); | 3602 | adjust_album_display_for_setting(old_val, pf_cfg.slide_spacing); |
3585 | reset_slides(); | ||
3586 | break; | 3603 | break; |
3587 | 3604 | ||
3588 | case 6: | 3605 | case 6: |
3606 | old_val = pf_cfg.center_margin; | ||
3589 | rb->set_int(rb->str(LANG_CENTRE_MARGIN), "", 1, | 3607 | rb->set_int(rb->str(LANG_CENTRE_MARGIN), "", 1, |
3590 | &pf_cfg.center_margin, | 3608 | &pf_cfg.center_margin, |
3591 | NULL, 1, 0, 80, NULL ); | 3609 | NULL, 1, 0, 80, NULL ); |
3592 | recalc_offsets(); | 3610 | adjust_album_display_for_setting(old_val, pf_cfg.center_margin); |
3593 | reset_slides(); | ||
3594 | break; | 3611 | break; |
3595 | 3612 | ||
3596 | case 7: | 3613 | case 7: |
3614 | old_val = pf_cfg.num_slides; | ||
3597 | rb->set_int(rb->str(LANG_NUMBER_OF_SLIDES), "", 1, | 3615 | rb->set_int(rb->str(LANG_NUMBER_OF_SLIDES), "", 1, |
3598 | &pf_cfg.num_slides, NULL, 1, 1, MAX_SLIDES_COUNT, NULL ); | 3616 | &pf_cfg.num_slides, NULL, 1, 1, MAX_SLIDES_COUNT, NULL ); |
3599 | recalc_offsets(); | 3617 | adjust_album_display_for_setting(old_val, pf_cfg.num_slides); |
3600 | reset_slides(); | ||
3601 | break; | 3618 | break; |
3602 | 3619 | ||
3603 | case 8: | 3620 | case 8: |
3621 | old_val = pf_cfg.zoom; | ||
3604 | rb->set_int(rb->str(LANG_ZOOM), "", 1, &pf_cfg.zoom, | 3622 | rb->set_int(rb->str(LANG_ZOOM), "", 1, &pf_cfg.zoom, |
3605 | NULL, 1, 10, 300, NULL ); | 3623 | NULL, 1, 10, 300, NULL ); |
3606 | recalc_offsets(); | 3624 | adjust_album_display_for_setting(old_val, pf_cfg.zoom); |
3607 | reset_slides(); | ||
3608 | break; | 3625 | break; |
3609 | 3626 | ||
3610 | case 9: | 3627 | case 9: |
@@ -3895,7 +3912,10 @@ static void show_track_list(void) | |||
3895 | { | 3912 | { |
3896 | mylcd_clear_display(); | 3913 | mylcd_clear_display(); |
3897 | if ( center_slide.slide_index != pf_tracks.cur_idx ) { | 3914 | if ( center_slide.slide_index != pf_tracks.cur_idx ) { |
3898 | show_track_list_loading(); | 3915 | #ifdef HAVE_TC_RAMCACHE |
3916 | if (!rb->tagcache_is_in_ram()) | ||
3917 | #endif | ||
3918 | show_track_list_loading(); | ||
3899 | create_track_index(center_slide.slide_index); | 3919 | create_track_index(center_slide.slide_index); |
3900 | if (pf_tracks.count == 0) | 3920 | if (pf_tracks.count == 0) |
3901 | { | 3921 | { |
@@ -4019,7 +4039,10 @@ static bool track_list_ready(void) | |||
4019 | { | 4039 | { |
4020 | if (pf_state != pf_show_tracks) | 4040 | if (pf_state != pf_show_tracks) |
4021 | { | 4041 | { |
4022 | rb->splash(0, ID2P(LANG_WAIT)); | 4042 | #ifdef HAVE_TC_RAMCACHE |
4043 | if (!rb->tagcache_is_in_ram()) | ||
4044 | #endif | ||
4045 | rb->splash(0, ID2P(LANG_WAIT)); | ||
4023 | create_track_index(center_slide.slide_index); | 4046 | create_track_index(center_slide.slide_index); |
4024 | if (pf_tracks.count == 0) | 4047 | if (pf_tracks.count == 0) |
4025 | { | 4048 | { |
@@ -4271,14 +4294,11 @@ static int pictureflow_main(const char* selected_file) | |||
4271 | config_set_defaults(&pf_cfg); | 4294 | config_set_defaults(&pf_cfg); |
4272 | 4295 | ||
4273 | configfile_load(CONFIG_FILE, config, CONFIG_NUM_ITEMS, CONFIG_VERSION); | 4296 | configfile_load(CONFIG_FILE, config, CONFIG_NUM_ITEMS, CONFIG_VERSION); |
4274 | if(pf_cfg.auto_wps == 0) | 4297 | |
4275 | draw_splashscreen(pf_idx.buf, pf_idx.buf_sz); | ||
4276 | if(pf_cfg.backlight_mode == 0) { | ||
4277 | /* Turn off backlight timeout */ | ||
4278 | #ifdef HAVE_BACKLIGHT | 4298 | #ifdef HAVE_BACKLIGHT |
4299 | if(pf_cfg.backlight_mode == 0) | ||
4279 | backlight_ignore_timeout(); | 4300 | backlight_ignore_timeout(); |
4280 | #endif | 4301 | #endif |
4281 | } | ||
4282 | 4302 | ||
4283 | rb->mutex_init(&buf_ctx_mutex); | 4303 | rb->mutex_init(&buf_ctx_mutex); |
4284 | 4304 | ||
@@ -4454,7 +4474,8 @@ static int pictureflow_main(const char* selected_file) | |||
4454 | rb->snprintf(fpstxt, sizeof(fpstxt), "%d %%", progress_pct); | 4474 | rb->snprintf(fpstxt, sizeof(fpstxt), "%d %%", progress_pct); |
4455 | } | 4475 | } |
4456 | 4476 | ||
4457 | if (pf_cfg.show_album_name == ALBUM_NAME_TOP) | 4477 | if (pf_cfg.show_album_name == ALBUM_NAME_TOP || |
4478 | pf_cfg.show_album_name == ALBUM_AND_ARTIST_TOP) | ||
4458 | fpstxt_y = LCD_HEIGHT - | 4479 | fpstxt_y = LCD_HEIGHT - |
4459 | rb->screens[SCREEN_MAIN]->getcharheight(); | 4480 | rb->screens[SCREEN_MAIN]->getcharheight(); |
4460 | else | 4481 | else |
@@ -4572,15 +4593,15 @@ static int pictureflow_main(const char* selected_file) | |||
4572 | break; | 4593 | break; |
4573 | #if PF_PLAYBACK_CAPABLE | 4594 | #if PF_PLAYBACK_CAPABLE |
4574 | case PF_CONTEXT: | 4595 | case PF_CONTEXT: |
4575 | if (pf_cfg.auto_wps != 0 && | 4596 | if (pf_state == pf_idle || pf_state == pf_scrolling || |
4576 | (pf_state == pf_idle || pf_state == pf_scrolling || | 4597 | pf_state == pf_show_tracks || pf_state == pf_cover_out) { |
4577 | pf_state == pf_show_tracks || pf_state == pf_cover_out)) { | ||
4578 | 4598 | ||
4579 | if ( pf_state == pf_scrolling) | 4599 | if ( pf_state == pf_scrolling) |
4580 | { | 4600 | { |
4581 | set_current_slide(target); | 4601 | set_current_slide(target); |
4582 | pf_state = pf_idle; | 4602 | pf_state = pf_idle; |
4583 | } else if (pf_state == pf_cover_out) | 4603 | } |
4604 | else if (pf_state == pf_cover_out) | ||
4584 | interrupt_cover_out_animation(); | 4605 | interrupt_cover_out_animation(); |
4585 | 4606 | ||
4586 | show_current_playlist_menu(); | 4607 | show_current_playlist_menu(); |
diff --git a/apps/tagcache.c b/apps/tagcache.c index b6c86d7ddb..253e48a6dd 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -170,7 +170,7 @@ static const char * const tag_type_str[] = { | |||
170 | #endif /* ndef LOGF_ENABLE */ | 170 | #endif /* ndef LOGF_ENABLE */ |
171 | 171 | ||
172 | /* Status information of the tagcache. */ | 172 | /* Status information of the tagcache. */ |
173 | struct tagcache_stat tc_stat; | 173 | static struct tagcache_stat tc_stat; |
174 | 174 | ||
175 | /* Queue commands. */ | 175 | /* Queue commands. */ |
176 | enum tagcache_queue { | 176 | enum tagcache_queue { |
@@ -5079,6 +5079,12 @@ bool tagcache_is_usable(void) | |||
5079 | { | 5079 | { |
5080 | return tc_stat.initialized && tc_stat.ready; | 5080 | return tc_stat.initialized && tc_stat.ready; |
5081 | } | 5081 | } |
5082 | #ifdef HAVE_TC_RAMCACHE | ||
5083 | bool tagcache_is_in_ram(void) | ||
5084 | { | ||
5085 | return tc_stat.ramcache; | ||
5086 | } | ||
5087 | #endif | ||
5082 | int tagcache_get_commit_step(void) | 5088 | int tagcache_get_commit_step(void) |
5083 | { | 5089 | { |
5084 | return tc_stat.commit_step; | 5090 | return tc_stat.commit_step; |
diff --git a/apps/tagcache.h b/apps/tagcache.h index 1218e42b42..690506b308 100644 --- a/apps/tagcache.h +++ b/apps/tagcache.h | |||
@@ -246,6 +246,7 @@ void tagcache_screensync_event(void); | |||
246 | void tagcache_screensync_enable(bool state); | 246 | void tagcache_screensync_enable(bool state); |
247 | 247 | ||
248 | #ifdef HAVE_TC_RAMCACHE | 248 | #ifdef HAVE_TC_RAMCACHE |
249 | bool tagcache_is_in_ram(void); | ||
249 | #ifdef HAVE_DIRCACHE | 250 | #ifdef HAVE_DIRCACHE |
250 | bool tagcache_fill_tags(struct mp3entry *id3, const char *filename); | 251 | bool tagcache_fill_tags(struct mp3entry *id3, const char *filename); |
251 | #endif | 252 | #endif |
diff --git a/apps/tagtree.c b/apps/tagtree.c index 0506dd2edd..b6d0c8ac06 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -1411,10 +1411,6 @@ static struct tagentry* get_entries(struct tree_context *tc) | |||
1411 | return core_get_data(tc->cache.entries_handle); | 1411 | return core_get_data(tc->cache.entries_handle); |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | #ifdef HAVE_TC_RAMCACHE | ||
1415 | extern struct tagcache_stat tc_stat; | ||
1416 | #endif | ||
1417 | |||
1418 | static int retrieve_entries(struct tree_context *c, int offset, bool init) | 1414 | static int retrieve_entries(struct tree_context *c, int offset, bool init) |
1419 | { | 1415 | { |
1420 | struct tagcache_search tcs; | 1416 | struct tagcache_search tcs; |
@@ -1434,7 +1430,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init) | |||
1434 | show_search_progress( | 1430 | show_search_progress( |
1435 | #ifdef HAVE_DISK_STORAGE | 1431 | #ifdef HAVE_DISK_STORAGE |
1436 | #ifdef HAVE_TC_RAMCACHE | 1432 | #ifdef HAVE_TC_RAMCACHE |
1437 | tc_stat.ramcache ? true : | 1433 | tagcache_is_in_ram() ? true : |
1438 | #endif | 1434 | #endif |
1439 | storage_disk_is_active() | 1435 | storage_disk_is_active() |
1440 | #else | 1436 | #else |