diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2023-04-12 20:19:58 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2023-04-13 03:55:21 +0200 |
commit | 43b0fba75d4312230793f2747700371362204bb6 (patch) | |
tree | edd51dacc2c0218bf415645708386d938b1a1a56 /apps | |
parent | 6ca57ec389e9dd2141f9c9e73063c7193526dbbd (diff) | |
download | rockbox-43b0fba75d4312230793f2747700371362204bb6.tar.gz rockbox-43b0fba75d4312230793f2747700371362204bb6.zip |
Track Info: Show number of tracks being inspected
Applies to the database and PictureFlow
+ fix red 6ca57ec
Change-Id: If708851ebdfe075e9d6ea3f2e2dd790cc9deac94
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/wps.c | 2 | ||||
-rw-r--r-- | apps/onplay.c | 2 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 2 | ||||
-rw-r--r-- | apps/plugins/lib/mul_id3.c | 2 | ||||
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 2 | ||||
-rw-r--r-- | apps/plugins/properties.c | 8 | ||||
-rw-r--r-- | apps/screens.c | 26 | ||||
-rw-r--r-- | apps/screens.h | 2 |
9 files changed, 30 insertions, 18 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index d87f78de2d..10c971fcc4 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -1035,7 +1035,7 @@ long gui_wps_show(void) | |||
1035 | gwps_leave_wps(true); | 1035 | gwps_leave_wps(true); |
1036 | if (browse_id3(audio_current_track(), | 1036 | if (browse_id3(audio_current_track(), |
1037 | playlist_get_display_index(), | 1037 | playlist_get_display_index(), |
1038 | playlist_amount(), NULL, false)) | 1038 | playlist_amount(), NULL, 1)) |
1039 | return GO_TO_ROOT; | 1039 | return GO_TO_ROOT; |
1040 | restore = true; | 1040 | restore = true; |
1041 | } | 1041 | } |
diff --git a/apps/onplay.c b/apps/onplay.c index 4b6171746c..05046f6e00 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -1569,7 +1569,7 @@ static int browse_id3_wrapper(void) | |||
1569 | 1569 | ||
1570 | if (browse_id3(audio_current_track(), | 1570 | if (browse_id3(audio_current_track(), |
1571 | playlist_get_display_index(), | 1571 | playlist_get_display_index(), |
1572 | playlist_amount(), NULL, false)) | 1572 | playlist_amount(), NULL, 1)) |
1573 | return GO_TO_ROOT; | 1573 | return GO_TO_ROOT; |
1574 | return GO_TO_PREVIOUS; | 1574 | return GO_TO_PREVIOUS; |
1575 | } | 1575 | } |
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index d9bfee343f..e3a3b1bea7 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -526,7 +526,7 @@ static enum pv_onplay_result show_track_info(const struct playlist_entry *curren | |||
526 | 526 | ||
527 | return id3_retrieval_successful && | 527 | return id3_retrieval_successful && |
528 | browse_id3(&id3, current_track->index + 1, | 528 | browse_id3(&id3, current_track->index + 1, |
529 | viewer.num_tracks, NULL, false) ? PV_ONPLAY_USB : PV_ONPLAY_UNCHANGED; | 529 | viewer.num_tracks, NULL, 1) ? PV_ONPLAY_USB : PV_ONPLAY_UNCHANGED; |
530 | } | 530 | } |
531 | 531 | ||
532 | 532 | ||
diff --git a/apps/plugin.h b/apps/plugin.h index 835063e25f..9e94fe697e 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -500,7 +500,7 @@ struct plugin_api { | |||
500 | void (*add_to_pl_cb)); | 500 | void (*add_to_pl_cb)); |
501 | bool (*browse_id3)(struct mp3entry *id3, | 501 | bool (*browse_id3)(struct mp3entry *id3, |
502 | int playlist_display_index, int playlist_amount, | 502 | int playlist_display_index, int playlist_amount, |
503 | struct tm *modified, bool multiple_tracks); | 503 | struct tm *modified, int track_ct); |
504 | 504 | ||
505 | /* talking */ | 505 | /* talking */ |
506 | int (*talk_id)(int32_t id, bool enqueue); | 506 | int (*talk_id)(int32_t id, bool enqueue); |
diff --git a/apps/plugins/lib/mul_id3.c b/apps/plugins/lib/mul_id3.c index c40a495ecd..edf44f7282 100644 --- a/apps/plugins/lib/mul_id3.c +++ b/apps/plugins/lib/mul_id3.c | |||
@@ -135,7 +135,7 @@ void collect_id3(struct mp3entry *id3, bool is_first_track) | |||
135 | * - Unit for length will be s instead of ms | 135 | * - Unit for length will be s instead of ms |
136 | * | 136 | * |
137 | * Use result only as input for browse_id3, | 137 | * Use result only as input for browse_id3, |
138 | * and set multiple_tracks parameter to true. | 138 | * with the track_ct parameter set to > 1. |
139 | */ | 139 | */ |
140 | void finalize_id3(struct mp3entry *id3) | 140 | void finalize_id3(struct mp3entry *id3) |
141 | { | 141 | { |
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index 52f87355b2..b884f3ae0f 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c | |||
@@ -4027,7 +4027,7 @@ static int show_id3_info(const char *selected_file) | |||
4027 | if (is_multiple_tracks) | 4027 | if (is_multiple_tracks) |
4028 | finalize_id3(&id3); | 4028 | finalize_id3(&id3); |
4029 | 4029 | ||
4030 | return rb->browse_id3(&id3, 0, 0, NULL, i > 1) ? PLUGIN_USB_CONNECTED : 0; | 4030 | return rb->browse_id3(&id3, 0, 0, NULL, i) ? PLUGIN_USB_CONNECTED : 0; |
4031 | } | 4031 | } |
4032 | 4032 | ||
4033 | 4033 | ||
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index 638d7380a5..53af4c5bab 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c | |||
@@ -446,9 +446,11 @@ enum plugin_status plugin_start(const void* parameter) | |||
446 | FOR_NB_SCREENS(i) | 446 | FOR_NB_SCREENS(i) |
447 | rb->viewportmanager_theme_enable(i, true, NULL); | 447 | rb->viewportmanager_theme_enable(i, true, NULL); |
448 | 448 | ||
449 | bool usb = props_type == PROPS_ID3 ? rb->browse_id3(&id3, 0, 0, &tm, false) : | 449 | bool usb = props_type == PROPS_ID3 ? rb->browse_id3(&id3, 0, 0, &tm, 1) : |
450 | (props_type == PROPS_MUL_ID3 ? rb->browse_id3(&id3, 0, 0, NULL, mul_id3_count > 1) : | 450 | #ifdef HAVE_TAGCACHE |
451 | browse_file_or_dir(&stats)); | 451 | props_type == PROPS_MUL_ID3 ? rb->browse_id3(&id3, 0, 0, NULL, mul_id3_count) : |
452 | #endif | ||
453 | browse_file_or_dir(&stats); | ||
452 | 454 | ||
453 | FOR_NB_SCREENS(i) | 455 | FOR_NB_SCREENS(i) |
454 | rb->viewportmanager_theme_undo(i, false); | 456 | rb->viewportmanager_theme_undo(i, false); |
diff --git a/apps/screens.c b/apps/screens.c index c519da9353..d359267d8d 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -367,6 +367,7 @@ bool set_time_screen(const char* title, struct tm *tm, bool set_date) | |||
367 | 367 | ||
368 | static const int id3_headers[]= | 368 | static const int id3_headers[]= |
369 | { | 369 | { |
370 | LANG_TAGNAVI_ALL_TRACKS, | ||
370 | LANG_ID3_TITLE, | 371 | LANG_ID3_TITLE, |
371 | LANG_ID3_ARTIST, | 372 | LANG_ID3_ARTIST, |
372 | LANG_ID3_COMPOSER, | 373 | LANG_ID3_COMPOSER, |
@@ -394,7 +395,7 @@ static const int id3_headers[]= | |||
394 | struct id3view_info { | 395 | struct id3view_info { |
395 | struct mp3entry* id3; | 396 | struct mp3entry* id3; |
396 | struct tm *modified; | 397 | struct tm *modified; |
397 | bool multiple_tracks; | 398 | int track_ct; |
398 | int count; | 399 | int count; |
399 | int playlist_display_index; | 400 | int playlist_display_index; |
400 | int playlist_amount; | 401 | int playlist_amount; |
@@ -502,7 +503,8 @@ static const char * id3_get_or_speak_info(int selected_item, void* data, | |||
502 | if(say_it) | 503 | if(say_it) |
503 | talk_id(id3_headers[info->info_id[info_no]], false); | 504 | talk_id(id3_headers[info->info_id[info_no]], false); |
504 | snprintf(buffer, buffer_len, | 505 | snprintf(buffer, buffer_len, |
505 | "[%s]", str(id3_headers[info->info_id[info_no]])); | 506 | info->info_id[info_no] > 0 ? "[%s]" : "%s", |
507 | str(id3_headers[info->info_id[info_no]])); | ||
506 | return buffer; | 508 | return buffer; |
507 | } | 509 | } |
508 | else | 510 | else |
@@ -511,6 +513,14 @@ static const char * id3_get_or_speak_info(int selected_item, void* data, | |||
511 | char * val=NULL; | 513 | char * val=NULL; |
512 | switch(id3_headers[info->info_id[info_no]]) | 514 | switch(id3_headers[info->info_id[info_no]]) |
513 | { | 515 | { |
516 | case LANG_TAGNAVI_ALL_TRACKS: | ||
517 | if (info->track_ct <= 1) | ||
518 | return NULL; | ||
519 | snprintf(buffer, buffer_len, "%d", info->track_ct); | ||
520 | val = buffer; | ||
521 | if(say_it) | ||
522 | talk_number(info->track_ct, true); | ||
523 | break; | ||
514 | case LANG_ID3_TITLE: | 524 | case LANG_ID3_TITLE: |
515 | val=id3->title; | 525 | val=id3->title; |
516 | if(say_it && val) | 526 | if(say_it && val) |
@@ -597,7 +607,7 @@ static const char * id3_get_or_speak_info(int selected_item, void* data, | |||
597 | } | 607 | } |
598 | break; | 608 | break; |
599 | case LANG_ID3_LENGTH: | 609 | case LANG_ID3_LENGTH: |
600 | length = info->multiple_tracks ? id3->length : id3->length / 1000; | 610 | length = info->track_ct > 1 ? id3->length : id3->length / 1000; |
601 | 611 | ||
602 | format_time_auto(buffer, buffer_len, | 612 | format_time_auto(buffer, buffer_len, |
603 | length, UNIT_SEC | UNIT_TRIM_ZERO, true); | 613 | length, UNIT_SEC | UNIT_TRIM_ZERO, true); |
@@ -674,7 +684,7 @@ static const char * id3_get_or_speak_info(int selected_item, void* data, | |||
674 | case LANG_FILESIZE: /* not LANG_ID3_FILESIZE because the string is shared */ | 684 | case LANG_FILESIZE: /* not LANG_ID3_FILESIZE because the string is shared */ |
675 | if (!id3->filesize) | 685 | if (!id3->filesize) |
676 | return NULL; | 686 | return NULL; |
677 | if (info->multiple_tracks) | 687 | if (info->track_ct > 1) |
678 | { | 688 | { |
679 | unit = kibyte_units; | 689 | unit = kibyte_units; |
680 | unit_ct = 3; | 690 | unit_ct = 3; |
@@ -737,11 +747,11 @@ static int id3_speak_item(int selected_item, void* data) | |||
737 | return 0; | 747 | return 0; |
738 | } | 748 | } |
739 | 749 | ||
740 | /* Note: Setting multiple_tracks parameter to true causes filesize value | 750 | /* Note: If track_ct > 1, filesize value will be treated as |
741 | * to be treated as KiB (instead of Bytes), and length as s instead of ms. | 751 | * KiB (instead of Bytes), and length as s instead of ms. |
742 | */ | 752 | */ |
743 | bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount, | 753 | bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount, |
744 | struct tm *modified, bool multiple_tracks) | 754 | struct tm *modified, int track_ct) |
745 | { | 755 | { |
746 | struct gui_synclist id3_lists; | 756 | struct gui_synclist id3_lists; |
747 | int key; | 757 | int key; |
@@ -750,7 +760,7 @@ bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_a | |||
750 | info.count = 0; | 760 | info.count = 0; |
751 | info.id3 = id3; | 761 | info.id3 = id3; |
752 | info.modified = modified; | 762 | info.modified = modified; |
753 | info.multiple_tracks = multiple_tracks; | 763 | info.track_ct = track_ct; |
754 | info.playlist_display_index = playlist_display_index; | 764 | info.playlist_display_index = playlist_display_index; |
755 | info.playlist_amount = playlist_amount; | 765 | info.playlist_amount = playlist_amount; |
756 | bool ret = false; | 766 | bool ret = false; |
diff --git a/apps/screens.h b/apps/screens.h index 2dc0530f3a..bcd06655ad 100644 --- a/apps/screens.h +++ b/apps/screens.h | |||
@@ -40,7 +40,7 @@ bool set_time_screen(const char* title, struct tm *tm, bool set_date); | |||
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount, | 42 | bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount, |
43 | struct tm *modified, bool multiple_tracks); | 43 | struct tm *modified, int track_ct); |
44 | int view_runtime(void); | 44 | int view_runtime(void); |
45 | 45 | ||
46 | #ifdef HAVE_TOUCHSCREEN | 46 | #ifdef HAVE_TOUCHSCREEN |