Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

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

Remove mp3info function & remove list_do_action from plugin_api

Change-Id: Ia9a2d6889679832f23b19a989927277ba886cba4

+31 -57
+9 -11
apps/plugin.c
··· 352 352 yesno_pop, 353 353 354 354 /* action handling */ 355 - list_do_action, 356 355 get_custom_action, 357 356 get_action, 358 357 #ifdef HAVE_TOUCHSCREEN ··· 422 421 crc_32, 423 422 crc_32r, 424 423 filetype_get_attr, 424 + filetype_get_plugin, 425 425 426 426 /* dir */ 427 427 FS_PREFIX(opendir), ··· 581 581 utf8encode, 582 582 utf8length, 583 583 utf8seek, 584 + 585 + /* language */ 586 + lang_is_rtl, 584 587 585 588 /* the buflib memory management library */ 586 589 buflib_init, ··· 665 668 666 669 /* metadata */ 667 670 get_metadata, 668 - mp3info, 671 + get_codec_string, 669 672 count_mp3_frames, 670 673 create_xing_header, 671 674 #ifdef HAVE_TAGCACHE ··· 677 680 tagcache_search_finish, 678 681 tagcache_get_numeric, 679 682 tagcache_get_stat, 683 + tagcache_commit_finalize, 680 684 #if defined(HAVE_TC_RAMCACHE) 681 685 tagcache_is_in_ram, 682 686 #if defined(HAVE_DIRCACHE) ··· 694 698 playlist_get_current, 695 699 playlist_get_resume_info, 696 700 playlist_get_track_info, 701 + playlist_get_first_index, 702 + playlist_get_display_index, 703 + playlist_entries_iterate, 697 704 playlist_amount, 698 705 playlist_resume, 699 706 playlist_resume_track, ··· 833 840 834 841 /* new stuff at the end, sort into place next time 835 842 the API gets incompatible */ 836 - #ifdef HAVE_TAGCACHE 837 - tagcache_commit_finalize, 838 - #endif 839 - playlist_get_first_index, 840 - playlist_get_display_index, 841 - filetype_get_plugin, 842 - playlist_entries_iterate, 843 - lang_is_rtl, 844 - get_codec_string, 845 843 }; 846 844 847 845 static int plugin_buffer_handle;
+12 -15
apps/plugin.h
··· 163 163 * when this happens please take the opportunity to sort in 164 164 * any new functions "waiting" at the end of the list. 165 165 */ 166 - #define PLUGIN_API_VERSION 270 166 + #define PLUGIN_API_VERSION 271 167 167 168 168 /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ 169 169 ··· 405 405 bool (*yesno_pop)(const char* text); 406 406 407 407 /* action handling */ 408 - bool (*list_do_action)(int context, int timeout, 409 - struct gui_synclist *lists, int *action); 410 408 int (*get_custom_action)(int context,int timeout, 411 409 const struct button_mapping* (*get_context_map)(int)); 412 410 int (*get_action)(int context, int timeout); ··· 479 477 uint32_t (*crc_32r)(const void *src, uint32_t len, uint32_t crc32); 480 478 481 479 int (*filetype_get_attr)(const char* file); 480 + char* (*filetype_get_plugin)(int attr, char *buffer, size_t buffer_len); 482 481 483 482 /* dir */ 484 483 DIR * (*opendir)(const char *dirname); ··· 662 661 unsigned long (*utf8length)(const unsigned char *utf8); 663 662 int (*utf8seek)(const unsigned char* utf8, int offset); 664 663 664 + /* language */ 665 + int (*lang_is_rtl)(void); 666 + 665 667 /* the buflib memory management library */ 666 668 void (*buflib_init)(struct buflib_context* ctx, void* buf, size_t size); 667 669 size_t (*buflib_available)(struct buflib_context* ctx); ··· 761 763 762 764 /* metadata */ 763 765 bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); 764 - bool (*mp3info)(struct mp3entry *entry, const char *filename); 766 + const char* (*get_codec_string)(int codectype); 765 767 int (*count_mp3_frames)(int fd, int startpos, int filesize, 766 768 void (*progressfunc)(int), 767 769 unsigned char* buf, size_t buflen); ··· 782 784 void (*tagcache_search_finish)(struct tagcache_search *tcs); 783 785 long (*tagcache_get_numeric)(const struct tagcache_search *tcs, int tag); 784 786 struct tagcache_stat* (*tagcache_get_stat)(void); 787 + void (*tagcache_commit_finalize)(void); 785 788 #if defined(HAVE_TC_RAMCACHE) 786 789 bool (*tagcache_is_in_ram)(void); 787 790 #if defined(HAVE_DIRCACHE) ··· 801 804 int (*playlist_get_resume_info)(int *resume_index); 802 805 int (*playlist_get_track_info)(struct playlist_info* playlist, int index, 803 806 struct playlist_track_info* info); 807 + int (*playlist_get_first_index)(const struct playlist_info* playlist); 808 + int (*playlist_get_display_index)(void); 809 + bool (*playlist_entries_iterate)(const char *filename, 810 + struct playlist_insert_context *pl_context, 811 + bool (*action_cb)(const char *file_name)); 804 812 int (*playlist_amount)(void); 805 813 int (*playlist_resume)(void); 806 814 void (*playlist_resume_track)(int start_index, unsigned int crc, ··· 969 977 #endif 970 978 /* new stuff at the end, sort into place next time 971 979 the API gets incompatible */ 972 - #ifdef HAVE_TAGCACHE 973 - void (*tagcache_commit_finalize)(void); 974 - #endif 975 - int (*playlist_get_first_index)(const struct playlist_info* playlist); 976 - int (*playlist_get_display_index)(void); 977 - char* (*filetype_get_plugin)(int attr, char *buffer, size_t buffer_len); 978 - bool (*playlist_entries_iterate)(const char *filename, 979 - struct playlist_insert_context *pl_context, 980 - bool (*action_cb)(const char *file_name)); 981 - int (*lang_is_rtl)(void); 982 - const char* (*get_codec_string)(int codectype); 983 980 }; 984 981 985 982 /* plugin header */
+1 -1
apps/plugins/lib/id3.c
··· 35 35 } 36 36 #endif 37 37 38 - return !rb->mp3info(id3, file); 38 + return rb->get_metadata(id3, -1, file); 39 39 }
+1 -1
apps/plugins/pictureflow/pictureflow.c
··· 4040 4040 i = 0; 4041 4041 do { 4042 4042 file_name = i == 0 ? selected_file : get_track_filename(i); 4043 - if (rb->mp3info(&id3, file_name)) 4043 + if (!rb->get_metadata(&id3, -1, file_name)) 4044 4044 return 0; 4045 4045 4046 4046 if (is_multiple_tracks)
+3 -2
apps/plugins/playing_time.c
··· 350 350 continue; 351 351 352 352 if (rb->playlist_get_track_info(NULL, index, &pltrack) < 0 353 - || rb->mp3info(&id3, pltrack.filename)) 353 + || !rb->get_metadata(&id3, -1, pltrack.filename)) 354 354 { 355 355 error_count++; 356 356 continue; ··· 392 392 rb->gui_synclist_draw(&pt_lists); 393 393 rb->gui_synclist_speak_item(&pt_lists); 394 394 while (true) { 395 - if (rb->list_do_action(CONTEXT_LIST, HZ/2, &pt_lists, &key) == 0 395 + key = rb->get_action(CONTEXT_LIST, HZ/2); 396 + if (rb->gui_synclist_do_button(&pt_lists, &key) == 0 396 397 && key!=ACTION_NONE && key!=ACTION_UNKNOWN) 397 398 { 398 399 bool usb = rb->default_event_handler(key) == SYS_USB_CONNECTED;
+2 -2
apps/plugins/properties.c
··· 130 130 rb->snprintf(str_time, sizeof str_time, "%02d:%02d:%02d", 131 131 tm.tm_hour, tm.tm_min, tm.tm_sec); 132 132 133 - if (props_type != PROPS_PLAYLIST && !rb->mp3info(&id3, selected_file)) 133 + if (props_type != PROPS_PLAYLIST && rb->get_metadata(&id3, -1, selected_file)) 134 134 props_type = PROPS_ID3; 135 135 found = true; 136 136 break; ··· 416 416 417 417 bool mul_id3_add(const char *file_name) 418 418 { 419 - if (!file_name || rb->mp3info(&id3, file_name)) 419 + if (!file_name || !rb->get_metadata(&id3, -1, file_name)) 420 420 skipped_count++; 421 421 else 422 422 {
+2 -2
apps/plugins/vbrfix.c
··· 155 155 156 156 xingupdate(0); 157 157 158 - rc = rb->mp3info(&entry, selected_file); 159 - if(rc) { 158 + rc = rb->get_metadata(&entry, -1, selected_file); 159 + if(!rc) { 160 160 fileerror(rc); 161 161 return true; 162 162 }
-8
docs/API
··· 197 197 each and returns a pointer to the allocated memory. The memory is set to 198 198 zero. 199 199 200 - ID3 201 - 202 - #include <id3.h> 203 - bool mp3info(mp3entry *entry, char *filename); 204 - 205 - Return FALSE if successful. The given mp3entry is then filled in with 206 - whatever id3 info it could find about the given file. 207 - 208 200 Various 209 201 210 202 #include <kernel.h>
-7
docs/PLUGIN_API
··· 1324 1324 \return 1325 1325 \description 1326 1326 1327 - bool mp3info(struct mp3entry *entry, const char *filename) 1328 - \group misc 1329 - \param entry 1330 - \param filename 1331 - \return FALSE if successfull 1332 - \description The given =entry= is filled in with whatever id3 info it could find about the given =filename= 1333 - 1334 1327 void mutex_init(struct mutex *m) 1335 1328 \group kernel/ system 1336 1329 \param m
+1 -1
lib/rbcodec/metadata/id3tags.c
··· 1200 1200 for(i=1; i<argc; i++) { 1201 1201 struct mp3entry mp3; 1202 1202 mp3.album = "Bogus"; 1203 - if(mp3info(&mp3, argv[i], false)) { 1203 + if(!get_metadata(&mp3, -1, argv[i])) { 1204 1204 printf("Failed to get %s\n", argv[i]); 1205 1205 return 0; 1206 1206 }
-6
lib/rbcodec/metadata/metadata.c
··· 399 399 return AFMT_UNKNOWN; 400 400 } 401 401 402 - /* Note, that this returns false for successful, true for error! */ 403 - bool mp3info(struct mp3entry *entry, const char *filename) 404 - { 405 - return !get_metadata(entry, -1, filename); 406 - } 407 - 408 402 /* Get metadata for track - return false if parsing showed problems with the 409 403 * file that would prevent playback. supply a filedescriptor <0 and the file will be opened 410 404 * and closed automatically within the get_metadata call
-1
lib/rbcodec/metadata/metadata.h
··· 326 326 unsigned int probe_file_format(const char *filename); 327 327 bool get_metadata(struct mp3entry* id3, int fd, const char* trackname); 328 328 bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int flags); 329 - bool mp3info(struct mp3entry *entry, const char *filename); 330 329 void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig); 331 330 void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig); 332 331 void wipe_mp3entry(struct mp3entry *id3);