summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugin.c20
-rw-r--r--apps/plugin.h27
-rw-r--r--apps/plugins/lib/id3.c2
-rw-r--r--apps/plugins/pictureflow/pictureflow.c2
-rw-r--r--apps/plugins/playing_time.c5
-rw-r--r--apps/plugins/properties.c4
-rw-r--r--apps/plugins/vbrfix.c4
-rw-r--r--docs/API8
-rw-r--r--docs/PLUGIN_API7
-rw-r--r--lib/rbcodec/metadata/id3tags.c2
-rw-r--r--lib/rbcodec/metadata/metadata.c6
-rw-r--r--lib/rbcodec/metadata/metadata.h1
12 files changed, 31 insertions, 57 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index bd849dad50..20b438999b 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -352,7 +352,6 @@ static const struct plugin_api rockbox_api = {
352 yesno_pop, 352 yesno_pop,
353 353
354 /* action handling */ 354 /* action handling */
355 list_do_action,
356 get_custom_action, 355 get_custom_action,
357 get_action, 356 get_action,
358#ifdef HAVE_TOUCHSCREEN 357#ifdef HAVE_TOUCHSCREEN
@@ -422,6 +421,7 @@ static const struct plugin_api rockbox_api = {
422 crc_32, 421 crc_32,
423 crc_32r, 422 crc_32r,
424 filetype_get_attr, 423 filetype_get_attr,
424 filetype_get_plugin,
425 425
426 /* dir */ 426 /* dir */
427 FS_PREFIX(opendir), 427 FS_PREFIX(opendir),
@@ -582,6 +582,9 @@ static const struct plugin_api rockbox_api = {
582 utf8length, 582 utf8length,
583 utf8seek, 583 utf8seek,
584 584
585 /* language */
586 lang_is_rtl,
587
585 /* the buflib memory management library */ 588 /* the buflib memory management library */
586 buflib_init, 589 buflib_init,
587 buflib_available, 590 buflib_available,
@@ -665,7 +668,7 @@ static const struct plugin_api rockbox_api = {
665 668
666 /* metadata */ 669 /* metadata */
667 get_metadata, 670 get_metadata,
668 mp3info, 671 get_codec_string,
669 count_mp3_frames, 672 count_mp3_frames,
670 create_xing_header, 673 create_xing_header,
671#ifdef HAVE_TAGCACHE 674#ifdef HAVE_TAGCACHE
@@ -677,6 +680,7 @@ static const struct plugin_api rockbox_api = {
677 tagcache_search_finish, 680 tagcache_search_finish,
678 tagcache_get_numeric, 681 tagcache_get_numeric,
679 tagcache_get_stat, 682 tagcache_get_stat,
683 tagcache_commit_finalize,
680#if defined(HAVE_TC_RAMCACHE) 684#if defined(HAVE_TC_RAMCACHE)
681 tagcache_is_in_ram, 685 tagcache_is_in_ram,
682#if defined(HAVE_DIRCACHE) 686#if defined(HAVE_DIRCACHE)
@@ -694,6 +698,9 @@ static const struct plugin_api rockbox_api = {
694 playlist_get_current, 698 playlist_get_current,
695 playlist_get_resume_info, 699 playlist_get_resume_info,
696 playlist_get_track_info, 700 playlist_get_track_info,
701 playlist_get_first_index,
702 playlist_get_display_index,
703 playlist_entries_iterate,
697 playlist_amount, 704 playlist_amount,
698 playlist_resume, 705 playlist_resume,
699 playlist_resume_track, 706 playlist_resume_track,
@@ -833,15 +840,6 @@ static const struct plugin_api rockbox_api = {
833 840
834 /* new stuff at the end, sort into place next time 841 /* new stuff at the end, sort into place next time
835 the API gets incompatible */ 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
847static int plugin_buffer_handle; 845static int plugin_buffer_handle;
diff --git a/apps/plugin.h b/apps/plugin.h
index 66c895d0db..135a068898 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -163,7 +163,7 @@ int plugin_open(const char *plugin, const char *parameter);
163 * when this happens please take the opportunity to sort in 163 * when this happens please take the opportunity to sort in
164 * any new functions "waiting" at the end of the list. 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/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ 168/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */
169 169
@@ -405,8 +405,6 @@ struct plugin_api {
405 bool (*yesno_pop)(const char* text); 405 bool (*yesno_pop)(const char* text);
406 406
407 /* action handling */ 407 /* action handling */
408 bool (*list_do_action)(int context, int timeout,
409 struct gui_synclist *lists, int *action);
410 int (*get_custom_action)(int context,int timeout, 408 int (*get_custom_action)(int context,int timeout,
411 const struct button_mapping* (*get_context_map)(int)); 409 const struct button_mapping* (*get_context_map)(int));
412 int (*get_action)(int context, int timeout); 410 int (*get_action)(int context, int timeout);
@@ -479,6 +477,7 @@ struct plugin_api {
479 uint32_t (*crc_32r)(const void *src, uint32_t len, uint32_t crc32); 477 uint32_t (*crc_32r)(const void *src, uint32_t len, uint32_t crc32);
480 478
481 int (*filetype_get_attr)(const char* file); 479 int (*filetype_get_attr)(const char* file);
480 char* (*filetype_get_plugin)(int attr, char *buffer, size_t buffer_len);
482 481
483 /* dir */ 482 /* dir */
484 DIR * (*opendir)(const char *dirname); 483 DIR * (*opendir)(const char *dirname);
@@ -662,6 +661,9 @@ struct plugin_api {
662 unsigned long (*utf8length)(const unsigned char *utf8); 661 unsigned long (*utf8length)(const unsigned char *utf8);
663 int (*utf8seek)(const unsigned char* utf8, int offset); 662 int (*utf8seek)(const unsigned char* utf8, int offset);
664 663
664 /* language */
665 int (*lang_is_rtl)(void);
666
665 /* the buflib memory management library */ 667 /* the buflib memory management library */
666 void (*buflib_init)(struct buflib_context* ctx, void* buf, size_t size); 668 void (*buflib_init)(struct buflib_context* ctx, void* buf, size_t size);
667 size_t (*buflib_available)(struct buflib_context* ctx); 669 size_t (*buflib_available)(struct buflib_context* ctx);
@@ -761,7 +763,7 @@ struct plugin_api {
761 763
762 /* metadata */ 764 /* metadata */
763 bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); 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 int (*count_mp3_frames)(int fd, int startpos, int filesize, 767 int (*count_mp3_frames)(int fd, int startpos, int filesize,
766 void (*progressfunc)(int), 768 void (*progressfunc)(int),
767 unsigned char* buf, size_t buflen); 769 unsigned char* buf, size_t buflen);
@@ -782,6 +784,7 @@ struct plugin_api {
782 void (*tagcache_search_finish)(struct tagcache_search *tcs); 784 void (*tagcache_search_finish)(struct tagcache_search *tcs);
783 long (*tagcache_get_numeric)(const struct tagcache_search *tcs, int tag); 785 long (*tagcache_get_numeric)(const struct tagcache_search *tcs, int tag);
784 struct tagcache_stat* (*tagcache_get_stat)(void); 786 struct tagcache_stat* (*tagcache_get_stat)(void);
787 void (*tagcache_commit_finalize)(void);
785#if defined(HAVE_TC_RAMCACHE) 788#if defined(HAVE_TC_RAMCACHE)
786 bool (*tagcache_is_in_ram)(void); 789 bool (*tagcache_is_in_ram)(void);
787#if defined(HAVE_DIRCACHE) 790#if defined(HAVE_DIRCACHE)
@@ -801,6 +804,11 @@ struct plugin_api {
801 int (*playlist_get_resume_info)(int *resume_index); 804 int (*playlist_get_resume_info)(int *resume_index);
802 int (*playlist_get_track_info)(struct playlist_info* playlist, int index, 805 int (*playlist_get_track_info)(struct playlist_info* playlist, int index,
803 struct playlist_track_info* info); 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 int (*playlist_amount)(void); 812 int (*playlist_amount)(void);
805 int (*playlist_resume)(void); 813 int (*playlist_resume)(void);
806 void (*playlist_resume_track)(int start_index, unsigned int crc, 814 void (*playlist_resume_track)(int start_index, unsigned int crc,
@@ -969,17 +977,6 @@ struct plugin_api {
969#endif 977#endif
970 /* new stuff at the end, sort into place next time 978 /* new stuff at the end, sort into place next time
971 the API gets incompatible */ 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/* plugin header */ 982/* plugin header */
diff --git a/apps/plugins/lib/id3.c b/apps/plugins/lib/id3.c
index b0202b1d9c..6af715b1fb 100644
--- a/apps/plugins/lib/id3.c
+++ b/apps/plugins/lib/id3.c
@@ -35,5 +35,5 @@ bool retrieve_id3(struct mp3entry *id3, const char* file)
35 } 35 }
36#endif 36#endif
37 37
38 return !rb->mp3info(id3, file); 38 return rb->get_metadata(id3, -1, file);
39} 39}
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 87ad1a403f..e5492cf01c 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -4040,7 +4040,7 @@ static int show_id3_info(const char *selected_file)
4040 i = 0; 4040 i = 0;
4041 do { 4041 do {
4042 file_name = i == 0 ? selected_file : get_track_filename(i); 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 return 0; 4044 return 0;
4045 4045
4046 if (is_multiple_tracks) 4046 if (is_multiple_tracks)
diff --git a/apps/plugins/playing_time.c b/apps/plugins/playing_time.c
index f8b4b006a9..1da0d437c0 100644
--- a/apps/plugins/playing_time.c
+++ b/apps/plugins/playing_time.c
@@ -350,7 +350,7 @@ static bool playing_time(void)
350 continue; 350 continue;
351 351
352 if (rb->playlist_get_track_info(NULL, index, &pltrack) < 0 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 error_count++; 355 error_count++;
356 continue; 356 continue;
@@ -392,7 +392,8 @@ static bool playing_time(void)
392 rb->gui_synclist_draw(&pt_lists); 392 rb->gui_synclist_draw(&pt_lists);
393 rb->gui_synclist_speak_item(&pt_lists); 393 rb->gui_synclist_speak_item(&pt_lists);
394 while (true) { 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 && key!=ACTION_NONE && key!=ACTION_UNKNOWN) 397 && key!=ACTION_NONE && key!=ACTION_UNKNOWN)
397 { 398 {
398 bool usb = rb->default_event_handler(key) == SYS_USB_CONNECTED; 399 bool usb = rb->default_event_handler(key) == SYS_USB_CONNECTED;
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index 73ec64be80..dc55b8128b 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -130,7 +130,7 @@ static bool file_properties(const char* selected_file)
130 rb->snprintf(str_time, sizeof str_time, "%02d:%02d:%02d", 130 rb->snprintf(str_time, sizeof str_time, "%02d:%02d:%02d",
131 tm.tm_hour, tm.tm_min, tm.tm_sec); 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 props_type = PROPS_ID3; 134 props_type = PROPS_ID3;
135 found = true; 135 found = true;
136 break; 136 break;
@@ -416,7 +416,7 @@ static bool determine_file_or_dir(void)
416 416
417bool mul_id3_add(const char *file_name) 417bool 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 skipped_count++; 420 skipped_count++;
421 else 421 else
422 { 422 {
diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c
index 5aaf2ffada..622a0a4f07 100644
--- a/apps/plugins/vbrfix.c
+++ b/apps/plugins/vbrfix.c
@@ -155,8 +155,8 @@ static bool vbr_fix(const char *selected_file)
155 155
156 xingupdate(0); 156 xingupdate(0);
157 157
158 rc = rb->mp3info(&entry, selected_file); 158 rc = rb->get_metadata(&entry, -1, selected_file);
159 if(rc) { 159 if(!rc) {
160 fileerror(rc); 160 fileerror(rc);
161 return true; 161 return true;
162 } 162 }
diff --git a/docs/API b/docs/API
index 074e82bbbc..bd2eb22204 100644
--- a/docs/API
+++ b/docs/API
@@ -197,14 +197,6 @@ Memory allocation
197 each and returns a pointer to the allocated memory. The memory is set to 197 each and returns a pointer to the allocated memory. The memory is set to
198 zero. 198 zero.
199 199
200ID3
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
208Various 200Various
209 201
210 #include <kernel.h> 202 #include <kernel.h>
diff --git a/docs/PLUGIN_API b/docs/PLUGIN_API
index 29a7829b32..4760ecede2 100644
--- a/docs/PLUGIN_API
+++ b/docs/PLUGIN_API
@@ -1324,13 +1324,6 @@ time_t mktime(struct tm *t)
1324 \return 1324 \return
1325 \description 1325 \description
1326 1326
1327bool 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
1334void mutex_init(struct mutex *m) 1327void mutex_init(struct mutex *m)
1335 \group kernel/ system 1328 \group kernel/ system
1336 \param m 1329 \param m
diff --git a/lib/rbcodec/metadata/id3tags.c b/lib/rbcodec/metadata/id3tags.c
index ba7695d569..1e792d9122 100644
--- a/lib/rbcodec/metadata/id3tags.c
+++ b/lib/rbcodec/metadata/id3tags.c
@@ -1200,7 +1200,7 @@ int main(int argc, char **argv)
1200 for(i=1; i<argc; i++) { 1200 for(i=1; i<argc; i++) {
1201 struct mp3entry mp3; 1201 struct mp3entry mp3;
1202 mp3.album = "Bogus"; 1202 mp3.album = "Bogus";
1203 if(mp3info(&mp3, argv[i], false)) { 1203 if(!get_metadata(&mp3, -1, argv[i])) {
1204 printf("Failed to get %s\n", argv[i]); 1204 printf("Failed to get %s\n", argv[i]);
1205 return 0; 1205 return 0;
1206 } 1206 }
diff --git a/lib/rbcodec/metadata/metadata.c b/lib/rbcodec/metadata/metadata.c
index 670c37fcfd..70179daa2f 100644
--- a/lib/rbcodec/metadata/metadata.c
+++ b/lib/rbcodec/metadata/metadata.c
@@ -399,12 +399,6 @@ unsigned int probe_file_format(const char *filename)
399 return AFMT_UNKNOWN; 399 return AFMT_UNKNOWN;
400} 400}
401 401
402/* Note, that this returns false for successful, true for error! */
403bool mp3info(struct mp3entry *entry, const char *filename)
404{
405 return !get_metadata(entry, -1, filename);
406}
407
408/* Get metadata for track - return false if parsing showed problems with the 402/* Get metadata for track - return false if parsing showed problems with the
409 * file that would prevent playback. supply a filedescriptor <0 and the file will be opened 403 * file that would prevent playback. supply a filedescriptor <0 and the file will be opened
410 * and closed automatically within the get_metadata call 404 * and closed automatically within the get_metadata call
diff --git a/lib/rbcodec/metadata/metadata.h b/lib/rbcodec/metadata/metadata.h
index ce1b153833..8a379ad396 100644
--- a/lib/rbcodec/metadata/metadata.h
+++ b/lib/rbcodec/metadata/metadata.h
@@ -326,7 +326,6 @@ struct mp3entry {
326unsigned int probe_file_format(const char *filename); 326unsigned int probe_file_format(const char *filename);
327bool get_metadata(struct mp3entry* id3, int fd, const char* trackname); 327bool get_metadata(struct mp3entry* id3, int fd, const char* trackname);
328bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int flags); 328bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int flags);
329bool mp3info(struct mp3entry *entry, const char *filename);
330void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig); 329void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig);
331void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig); 330void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig);
332void wipe_mp3entry(struct mp3entry *id3); 331void wipe_mp3entry(struct mp3entry *id3);