comparison src/madplug/plugin.c @ 1332:b77c70a82d33

Automated merge with ssh://majeru@hg.atheme.org//hg/audacious-plugins
author Cristi Magherusan <majeru@atheme-project.org>
date Sat, 21 Jul 2007 12:46:58 +0300
parents e3c991e485ed
children f7b7dfaf1e33
comparison
equal deleted inserted replaced
1331:392ca3811f49 1332:b77c70a82d33
595 extern void audmad_get_file_info(char *filename); 595 extern void audmad_get_file_info(char *filename);
596 extern void audmad_configure(); 596 extern void audmad_configure();
597 597
598 598
599 // tuple stuff 599 // tuple stuff
600 static TitleInput *audmad_get_song_tuple(char *filename) 600 static TitleInput *__audmad_get_song_tuple(char *filename, VFSFile *fd)
601 { 601 {
602 TitleInput *tuple = NULL; 602 TitleInput *tuple = NULL;
603 gchar *string = NULL; 603 gchar *string = NULL;
604 gchar *realfn = NULL; 604 gchar *realfn = NULL;
605 605
655 return NULL; 655 return NULL;
656 } 656 }
657 657
658 tuple = bmp_title_input_new(); 658 tuple = bmp_title_input_new();
659 659
660 id3file = id3_file_open(filename, ID3_FILE_MODE_READONLY); 660 if (!fd)
661 id3file = id3_file_open(filename, ID3_FILE_MODE_READONLY);
662 else
663 id3file = id3_file_vfsopen(fd, ID3_FILE_MODE_READONLY);
664
661 if (id3file) { 665 if (id3file) {
662 666
663 tag = id3_file_tag(id3file); 667 tag = id3_file_tag(id3file);
664 if (tag) { 668 if (tag) {
665 tuple->performer = 669 tuple->performer =
745 g_message("e: mad: audmad_get_song_tuple"); 749 g_message("e: mad: audmad_get_song_tuple");
746 #endif 750 #endif
747 return tuple; 751 return tuple;
748 } 752 }
749 753
754 static TitleInput *audmad_get_song_tuple(char *filename)
755 {
756 return __audmad_get_song_tuple(filename, NULL);
757 }
758
759 static TitleInput *audmad_probe_for_tuple(char *filename, VFSFile *fd)
760 {
761 if (!audmad_is_our_fd(filename, fd))
762 return NULL;
763
764 return __audmad_get_song_tuple(filename, fd);
765 }
750 766
751 static gchar *fmts[] = { "mp3", "mp2", "mpg", NULL }; 767 static gchar *fmts[] = { "mp3", "mp2", "mpg", NULL };
752 768
753 InputPlugin mad_ip = { 769 InputPlugin mad_ip = {
754 .description = "MPEG Audio Plugin", 770 .description = "MPEG Audio Plugin",
764 .get_song_info = audmad_get_song_info, 780 .get_song_info = audmad_get_song_info,
765 .file_info_box = audmad_get_file_info, 781 .file_info_box = audmad_get_file_info,
766 .get_song_tuple = audmad_get_song_tuple, 782 .get_song_tuple = audmad_get_song_tuple,
767 .is_our_file_from_vfs = audmad_is_our_fd, 783 .is_our_file_from_vfs = audmad_is_our_fd,
768 .vfs_extensions = fmts, 784 .vfs_extensions = fmts,
769 .mseek = audmad_mseek 785 .mseek = audmad_mseek,
786 .probe_for_tuple = audmad_probe_for_tuple
770 }; 787 };
771 788
772 InputPlugin *madplug_iplist[] = { &mad_ip, NULL }; 789 InputPlugin *madplug_iplist[] = { &mad_ip, NULL };
773 790
774 DECLARE_PLUGIN(madplug, NULL, NULL, madplug_iplist, NULL, NULL, NULL, NULL); 791 DECLARE_PLUGIN(madplug, NULL, NULL, madplug_iplist, NULL, NULL, NULL, NULL);