Mercurial > audlegacy
comparison src/audacious/pluginenum.c @ 2763:637359219e10 trunk
[svn] Reverted the modifications that were initially needed for DBus support.
| author | magma |
|---|---|
| date | Sat, 12 May 2007 15:22:58 -0700 |
| parents | cf080b11c3fa |
| children | fa6c339cce38 |
comparison
equal
deleted
inserted
replaced
| 2762:c89362b15525 | 2763:637359219e10 |
|---|---|
| 34 #include <glib.h> | 34 #include <glib.h> |
| 35 #include <gmodule.h> | 35 #include <gmodule.h> |
| 36 #include <glib/gprintf.h> | 36 #include <glib/gprintf.h> |
| 37 #include <string.h> | 37 #include <string.h> |
| 38 | 38 |
| 39 | |
| 40 #ifdef USE_DBUS | |
| 41 #include "dbus.h" | |
| 42 #include "dbus-service.h" | |
| 43 #endif | |
| 44 | |
| 45 #include "main.h" | 39 #include "main.h" |
| 46 #include "ui_main.h" | 40 #include "ui_main.h" |
| 47 #include "playback.h" | 41 #include "playback.h" |
| 48 #include "playlist.h" | 42 #include "playlist.h" |
| 49 #include "strings.h" | 43 #include "strings.h" |
| 60 NULL | 54 NULL |
| 61 }; | 55 }; |
| 62 | 56 |
| 63 GHashTable *plugin_matrix = NULL; | 57 GHashTable *plugin_matrix = NULL; |
| 64 GList *lowlevel_list = NULL; | 58 GList *lowlevel_list = NULL; |
| 65 | |
| 66 #ifdef USE_DBUS | |
| 67 static DBusGProxy *dbus_proxy = NULL; | |
| 68 static DBusGConnection *connection = NULL; | |
| 69 #endif | |
| 70 | 59 |
| 71 extern GList *vfs_transports; | 60 extern GList *vfs_transports; |
| 72 | 61 |
| 73 static gint | 62 static gint |
| 74 inputlist_compare_func(gconstpointer a, gconstpointer b) | 63 inputlist_compare_func(gconstpointer a, gconstpointer b) |
| 182 static void | 171 static void |
| 183 general_plugin_init(Plugin * plugin) | 172 general_plugin_init(Plugin * plugin) |
| 184 { | 173 { |
| 185 GeneralPlugin *p = GENERAL_PLUGIN(plugin); | 174 GeneralPlugin *p = GENERAL_PLUGIN(plugin); |
| 186 p->xmms_session = -1; | 175 p->xmms_session = -1; |
| 187 #ifdef USE_DBUS | |
| 188 p->dbus_proxy = dbus_proxy; | |
| 189 #endif | |
| 190 gp_data.general_list = g_list_append(gp_data.general_list, p); | 176 gp_data.general_list = g_list_append(gp_data.general_list, p); |
| 191 } | 177 } |
| 192 | 178 |
| 193 static void | 179 static void |
| 194 vis_plugin_init(Plugin * plugin) | 180 vis_plugin_init(Plugin * plugin) |
| 195 { | 181 { |
| 196 VisPlugin *p = VIS_PLUGIN(plugin); | 182 VisPlugin *p = VIS_PLUGIN(plugin); |
| 197 p->xmms_session = -1; | 183 p->xmms_session = -1; |
| 198 #ifdef USE_DBUS | |
| 199 p->dbus_proxy = dbus_proxy; | |
| 200 #endif | |
| 201 p->disable_plugin = vis_disable_plugin; | 184 p->disable_plugin = vis_disable_plugin; |
| 202 vp_data.vis_list = g_list_append(vp_data.vis_list, p); | 185 vp_data.vis_list = g_list_append(vp_data.vis_list, p); |
| 203 } | 186 } |
| 204 | 187 |
| 205 static void | 188 static void |
| 289 GList *node; | 272 GList *node; |
| 290 OutputPlugin *op; | 273 OutputPlugin *op; |
| 291 InputPlugin *ip; | 274 InputPlugin *ip; |
| 292 LowlevelPlugin *lp; | 275 LowlevelPlugin *lp; |
| 293 gint dirsel = 0, i = 0; | 276 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 | |
| 311 | 277 |
| 312 if (!g_module_supported()) { | 278 if (!g_module_supported()) { |
| 313 report_error("Module loading not supported! Plugins will not be loaded.\n"); | 279 report_error("Module loading not supported! Plugins will not be loaded.\n"); |
| 314 return; | 280 return; |
| 315 } | 281 } |
