comparison src/audacious/pluginenum.c @ 2733:cf080b11c3fa trunk

[svn] Implemented more of the stubs in audctrl; Added more methods to objects.xml with implementations in dbus.c. I'm still trying to get plugins working with libaudclient.
author magma
date Fri, 11 May 2007 11:52:56 -0700
parents c35913222440
children 637359219e10
comparison
equal deleted inserted replaced
2732:2227e8955391 2733:cf080b11c3fa
36 #include <glib/gprintf.h> 36 #include <glib/gprintf.h>
37 #include <string.h> 37 #include <string.h>
38 38
39 39
40 #ifdef USE_DBUS 40 #ifdef USE_DBUS
41 #include "dbus.h"
41 #include "dbus-service.h" 42 #include "dbus-service.h"
42 #endif 43 #endif
43 44
44 #include "main.h" 45 #include "main.h"
45 #include "ui_main.h" 46 #include "ui_main.h"
59 NULL 60 NULL
60 }; 61 };
61 62
62 GHashTable *plugin_matrix = NULL; 63 GHashTable *plugin_matrix = NULL;
63 GList *lowlevel_list = NULL; 64 GList *lowlevel_list = NULL;
65
66 #ifdef USE_DBUS
67 static DBusGProxy *dbus_proxy = NULL;
68 static DBusGConnection *connection = NULL;
69 #endif
64 70
65 extern GList *vfs_transports; 71 extern GList *vfs_transports;
66 72
67 static gint 73 static gint
68 inputlist_compare_func(gconstpointer a, gconstpointer b) 74 inputlist_compare_func(gconstpointer a, gconstpointer b)
177 general_plugin_init(Plugin * plugin) 183 general_plugin_init(Plugin * plugin)
178 { 184 {
179 GeneralPlugin *p = GENERAL_PLUGIN(plugin); 185 GeneralPlugin *p = GENERAL_PLUGIN(plugin);
180 p->xmms_session = -1; 186 p->xmms_session = -1;
181 #ifdef USE_DBUS 187 #ifdef USE_DBUS
182 p->dbus_proxy = audacious_get_dbus_proxy(); 188 p->dbus_proxy = dbus_proxy;
183 #endif 189 #endif
184 gp_data.general_list = g_list_append(gp_data.general_list, p); 190 gp_data.general_list = g_list_append(gp_data.general_list, p);
185 } 191 }
186 192
187 static void 193 static void
188 vis_plugin_init(Plugin * plugin) 194 vis_plugin_init(Plugin * plugin)
189 { 195 {
190 VisPlugin *p = VIS_PLUGIN(plugin); 196 VisPlugin *p = VIS_PLUGIN(plugin);
191 p->xmms_session = -1; 197 p->xmms_session = -1;
192 #ifdef USE_DBUS 198 #ifdef USE_DBUS
193 p->dbus_proxy = audacious_get_dbus_proxy(); 199 p->dbus_proxy = dbus_proxy;
194 #endif 200 #endif
195 p->disable_plugin = vis_disable_plugin; 201 p->disable_plugin = vis_disable_plugin;
196 vp_data.vis_list = g_list_append(vp_data.vis_list, p); 202 vp_data.vis_list = g_list_append(vp_data.vis_list, p);
197 } 203 }
198 204
283 GList *node; 289 GList *node;
284 OutputPlugin *op; 290 OutputPlugin *op;
285 InputPlugin *ip; 291 InputPlugin *ip;
286 LowlevelPlugin *lp; 292 LowlevelPlugin *lp;
287 gint dirsel = 0, i = 0; 293 gint dirsel = 0, i = 0;
294
295 #ifdef USE_DBUS
296 GError *error = NULL;
297 connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
298
299 if (connection == NULL)
300 {
301 g_printerr("audtool: D-Bus error: %s", error->message);
302 g_error_free(error);
303
304 exit(EXIT_FAILURE);
305 }
306
307 dbus_proxy = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE,
308 AUDACIOUS_DBUS_PATH,
309 AUDACIOUS_DBUS_INTERFACE);
310 #endif
288 311
289 if (!g_module_supported()) { 312 if (!g_module_supported()) {
290 report_error("Module loading not supported! Plugins will not be loaded.\n"); 313 report_error("Module loading not supported! Plugins will not be loaded.\n");
291 return; 314 return;
292 } 315 }