comparison src/madplug/fileinfo.c @ 645:e0d131145768 trunk

[svn] - revise input_id3_get_string(). - make audmad_get_file_info() use mad_parse_genre() to obtain genre description.
author yaz
date Tue, 13 Feb 2007 22:10:05 -0800
parents dc0d35d888d2
children 74a46ac77c97
comparison
equal deleted inserted replaced
644:94ab06db73fa 645:e0d131145768
46 #endif /* !NOGUI */ 46 #endif /* !NOGUI */
47 47
48 static GList *genre_list = 0; 48 static GList *genre_list = 0;
49 static struct mad_info_t info; 49 static struct mad_info_t info;
50 struct id3_frame *id3_frame_new(const char *str); 50 struct id3_frame *id3_frame_new(const char *str);
51 id3_ucs4_t *mad_parse_genre(const id3_ucs4_t *string);
51 52
52 #ifndef NOGUI 53 #ifndef NOGUI
53 static void 54 static void
54 update_id3_frame(struct id3_tag *tag, const char *frame_name, 55 update_id3_frame(struct id3_tag *tag, const char *frame_name,
55 const char *data) 56 const char *data)
668 669
669 670
670 /* work out the index of the genre in the list */ 671 /* work out the index of the genre in the list */
671 { 672 {
672 const id3_ucs4_t *string; 673 const id3_ucs4_t *string;
674 id3_ucs4_t *genre;
673 struct id3_frame *frame; 675 struct id3_frame *frame;
674 union id3_field *field; 676 union id3_field *field;
675 frame = id3_tag_findframe(info.tag, ID3_FRAME_GENRE, 0); 677 frame = id3_tag_findframe(info.tag, ID3_FRAME_GENRE, 0);
676 if (frame) { 678 if (frame) {
677 field = id3_frame_field(frame, 1); 679 field = id3_frame_field(frame, 1);
678 string = id3_field_getstrings(field, 0); 680 string = id3_field_getstrings(field, 0);
679 string = id3_genre_name(string); 681 genre = mad_parse_genre(string);
680 if (string) 682 if (genre) {
681 gtk_list_select_item(GTK_LIST 683 gtk_list_select_item(GTK_LIST
682 (GTK_COMBO(genre_combo)->list), 684 (GTK_COMBO(genre_combo)->list),
683 id3_genre_number(string)); 685 id3_genre_number(genre));
686 g_free((void *)genre);
687 }
684 } 688 }
685 } 689 }
686 690
687 gtk_widget_set_sensitive(id3_frame, TRUE); 691 gtk_widget_set_sensitive(id3_frame, TRUE);
688 692