comparison src/madplug/plugin.c @ 1065:b3b02e58429f trunk

[svn] - convert madplug to plugin API v2
author nenolod
date Thu, 24 May 2007 12:09:40 -0700
parents 34b998b6e3b2
children 08f28756209c
comparison
equal deleted inserted replaced
1064:ea044f6279b9 1065:b3b02e58429f
36 36
37 /* 37 /*
38 * Global variables 38 * Global variables
39 */ 39 */
40 struct audmad_config_t audmad_config; /**< global configuration */ 40 struct audmad_config_t audmad_config; /**< global configuration */
41 InputPlugin *mad_plugin = NULL;
42 GMutex *mad_mutex; 41 GMutex *mad_mutex;
43 GMutex *pb_mutex; 42 GMutex *pb_mutex;
44 GCond *mad_cond; 43 GCond *mad_cond;
45 44
46 /* 45 /*
741 } 740 }
742 741
743 742
744 static gchar *fmts[] = { "mp3", "mp2", "mpg", NULL }; 743 static gchar *fmts[] = { "mp3", "mp2", "mpg", NULL };
745 744
746 InputPlugin *get_iplugin_info(void) 745 InputPlugin mad_ip = {
747 { 746 .description = "MPEG Audio Plugin",
748 if (mad_plugin != NULL) 747 .init = audmad_init,
749 return mad_plugin; 748 .about = audmad_about,
750 749 .configure = audmad_configure,
751 mad_plugin = g_new0(InputPlugin, 1); 750 .is_our_file = audmad_is_our_file,
752 mad_plugin->description = g_strdup(_("MPEG Audio Plugin")); 751 .play_file = audmad_play_file,
753 mad_plugin->init = audmad_init; 752 .stop = audmad_stop,
754 mad_plugin->about = audmad_about; 753 .pause = audmad_pause,
755 mad_plugin->configure = audmad_configure; 754 .seek = audmad_seek,
756 mad_plugin->is_our_file = audmad_is_our_file; 755 .cleanup = audmad_cleanup,
757 mad_plugin->play_file = audmad_play_file; 756 .get_song_info = audmad_get_song_info,
758 mad_plugin->stop = audmad_stop; 757 .file_info_box = audmad_get_file_info,
759 mad_plugin->pause = audmad_pause; 758 .get_song_tuple = audmad_get_song_tuple,
760 mad_plugin->seek = audmad_seek; 759 .is_our_file_from_vfs = audmad_is_our_fd,
761 mad_plugin->cleanup = audmad_cleanup; 760 .vfs_extensions = fmts,
762 mad_plugin->get_song_info = audmad_get_song_info; 761 .mseek = audmad_mseek
763 mad_plugin->file_info_box = audmad_get_file_info; 762 };
764 mad_plugin->get_song_tuple = audmad_get_song_tuple; 763
765 mad_plugin->is_our_file_from_vfs = audmad_is_our_fd; 764 InputPlugin *madplug_iplist[] = { &mad_ip, NULL };
766 mad_plugin->vfs_extensions = fmts; 765
767 mad_plugin->mseek = audmad_mseek; 766 DECLARE_PLUGIN(madplug, NULL, NULL, madplug_iplist, NULL, NULL, NULL, NULL);
768 767
769 return mad_plugin; 768 InputPlugin *mad_plugin = &mad_ip;
770 }