Mercurial > audlegacy
changeset 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 | 2227e8955391 |
children | eda1f3186687 |
files | ChangeLog src/audacious/Makefile src/audacious/build_stamp.c src/audacious/dbus-service.h src/audacious/dbus.c src/audacious/main.c src/audacious/objects.xml src/audacious/pluginenum.c src/libaudclient/audctrl.c |
diffstat | 9 files changed, 268 insertions(+), 106 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri May 11 08:59:22 2007 -0700 +++ b/ChangeLog Fri May 11 11:52:56 2007 -0700 @@ -1,3 +1,11 @@ +2007-05-11 15:59:22 +0000 William Pitcock <nenolod@sacredspiral.co.uk> + revision [4490] + - build audtool if libaudclient will be built. + + trunk/configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + 2007-05-11 08:42:32 +0000 Ben Tucker <bnt@interchange.ubc.ca> revision [4488] Added stubs in audctrl.c for the unimplemented functions defined in audctrl.h.
--- a/src/audacious/Makefile Fri May 11 08:59:22 2007 -0700 +++ b/src/audacious/Makefile Fri May 11 11:52:56 2007 -0700 @@ -136,14 +136,14 @@ @printf "%10s %-20s\n" LINK $@ dbus-server-bindings.h: $(DBUS_BINDINGS_SOURCES) - $(DBUS_BINDING_TOOL) --mode=glib-server --prefix=audacious_remote objects.xml > $@ + $(DBUS_BINDING_TOOL) --mode=glib-server --prefix=audacious_rc objects.xml > $@ # $(DBUS_BINDING_TOOL) --mode=glib-server --prefix=mpris_root mpris_root.xml >> $@ # $(DBUS_BINDING_TOOL) --mode=glib-server --prefix=mpris_tracklist mpris_tracklist.xml >> $@ # $(DBUS_BINDING_TOOL) --mode=glib-server --prefix=mpris_player mpris_player.xml >> $@ @printf "%10s %-20s\n" DBUS-BIND $@ dbus-client-bindings.h: $(DBUS_BINDINGS_SOURCES) - $(DBUS_BINDING_TOOL) --mode=glib-client --prefix=audacious_remote objects.xml > $@ + $(DBUS_BINDING_TOOL) --mode=glib-client --prefix=audacious_rc objects.xml > $@ @printf "%10s %-20s\n" DBUS-BIND $@ OBJECTIVE_DATA = audacious.desktop:$(datadir)/applications
--- a/src/audacious/build_stamp.c Fri May 11 08:59:22 2007 -0700 +++ b/src/audacious/build_stamp.c Fri May 11 11:52:56 2007 -0700 @@ -1,2 +1,2 @@ #include <glib.h> -const gchar *svn_stamp = "20070511-4488"; +const gchar *svn_stamp = "20070511-4490";
--- a/src/audacious/dbus-service.h Fri May 11 08:59:22 2007 -0700 +++ b/src/audacious/dbus-service.h Fri May 11 11:52:56 2007 -0700 @@ -39,53 +39,68 @@ DBusGProxy *audacious_get_dbus_proxy(); // Audacious General Information -gboolean audacious_remote_version(RemoteObject *obj, gchar **version, +gboolean audacious_rc_version(RemoteObject *obj, gchar **version, GError **error); +gboolean audacious_rc_quit(RemoteObject *obj, GError **error); +gboolean audacious_rc_eject(RemoteObject *obj, GError **error); +gboolean audacious_rc_main_win_visible(RemoteObject *obj, + gboolean *is_main_win, GError **error); +gboolean audacious_rc_show_main_win(RemoteObject *obj, gboolean show, + GError **error); +gboolean audacious_rc_equalizer_visible(RemoteObject *obj, + gboolean *is_eq_win, GError **error); +gboolean audacious_rc_show_equalizer(RemoteObject *obj, gboolean show, + GError **error); +gboolean audacious_rc_playlist_visible(RemoteObject *obj, + gboolean *is_pl_win, + GError **error); +gboolean audacious_rc_show_playlist(RemoteObject *obj, gboolean show, + GError **error); // Playback Information/Manipulation -gboolean audacious_remote_play(RemoteObject *obj, GError **error); -gboolean audacious_remote_pause(RemoteObject *obj, GError **error); -gboolean audacious_remote_stop(RemoteObject *obj, GError **error); -gboolean audacious_remote_playing(RemoteObject *obj, gboolean *is_playing, +gboolean audacious_rc_play(RemoteObject *obj, GError **error); +gboolean audacious_rc_pause(RemoteObject *obj, GError **error); +gboolean audacious_rc_stop(RemoteObject *obj, GError **error); +gboolean audacious_rc_playing(RemoteObject *obj, gboolean *is_playing, GError **error); -gboolean audacious_remote_paused(RemoteObject *obj, gboolean *is_paused, +gboolean audacious_rc_paused(RemoteObject *obj, gboolean *is_paused, GError **error); -gboolean audacious_remote_stopped(RemoteObject *obj, gboolean *is_stopped, +gboolean audacious_rc_stopped(RemoteObject *obj, gboolean *is_stopped, GError **error); -gboolean audacious_remote_status(RemoteObject *obj, gchar **status, +gboolean audacious_rc_status(RemoteObject *obj, gchar **status, GError **error); -gboolean audacious_remote_time(RemoteObject *obj, gint *time, GError **error); -gboolean audacious_remote_seek(RemoteObject *obj, guint pos, GError **error); -gboolean audacious_remote_volume(RemoteObject *obj, gint *vl, gint *vr, +gboolean audacious_rc_time(RemoteObject *obj, gint *time, GError **error); +gboolean audacious_rc_seek(RemoteObject *obj, guint pos, GError **error); +gboolean audacious_rc_volume(RemoteObject *obj, gint *vl, gint *vr, GError **error); -gboolean audacious_remote_set_volume(RemoteObject *obj, gint vl, gint vr, +gboolean audacious_rc_set_volume(RemoteObject *obj, gint vl, gint vr, GError **error); -gboolean audacious_remote_balance(RemoteObject *obj, gint *balance, +gboolean audacious_rc_balance(RemoteObject *obj, gint *balance, GError **error); // Playlist Information/Manipulation -gboolean audacious_remote_position(RemoteObject *obj, int *pos, GError **error); -gboolean audacious_remote_advance(RemoteObject *obj, GError **error); -gboolean audacious_remote_reverse(RemoteObject *obj, GError **error); -gboolean audacious_remote_length(RemoteObject *obj, int *length, +gboolean audacious_rc_position(RemoteObject *obj, int *pos, GError **error); +gboolean audacious_rc_advance(RemoteObject *obj, GError **error); +gboolean audacious_rc_reverse(RemoteObject *obj, GError **error); +gboolean audacious_rc_length(RemoteObject *obj, int *length, GError **error); -gboolean audacious_remote_song_title(RemoteObject *obj, int pos, +gboolean audacious_rc_song_title(RemoteObject *obj, int pos, gchar **title, GError **error); -gboolean audacious_remote_song_filename(RemoteObject *obj, int pos, +gboolean audacious_rc_song_filename(RemoteObject *obj, int pos, gchar **filename, GError **error); -gboolean audacious_remote_song_length(RemoteObject *obj, int pos, int *length, +gboolean audacious_rc_song_length(RemoteObject *obj, int pos, int *length, GError **error); -gboolean audacious_remote_song_frames(RemoteObject *obj, int pos, int *length, +gboolean audacious_rc_song_frames(RemoteObject *obj, int pos, int *length, GError **error); -gboolean audacious_remote_jump(RemoteObject *obj, int pos, GError **error); -gboolean audacious_remote_add_url(RemoteObject *obj, gchar *url, +gboolean audacious_rc_jump(RemoteObject *obj, int pos, GError **error); +gboolean audacious_rc_add_url(RemoteObject *obj, gchar *url, GError **error); -gboolean audacious_remote_delete(RemoteObject *obj, int pos, GError **error); -gboolean audacious_remote_clear(RemoteObject *obj, GError **error); -gboolean audacious_remote_repeating(RemoteObject *obj, gboolean *is_repeating, +gboolean audacious_rc_delete(RemoteObject *obj, int pos, GError **error); +gboolean audacious_rc_clear(RemoteObject *obj, GError **error); +gboolean audacious_rc_repeating(RemoteObject *obj, gboolean *is_repeating, GError **error); -gboolean audacious_remote_repeat(RemoteObject *obj, GError **error); -gboolean audacious_remote_shuffling(RemoteObject *obj, gboolean *is_shuffling, +gboolean audacious_rc_repeat(RemoteObject *obj, GError **error); +gboolean audacious_rc_shuffling(RemoteObject *obj, gboolean *is_shuffling, GError **error); -gboolean audacious_remote_shuffle(RemoteObject *obj, GError **error); +gboolean audacious_rc_shuffle(RemoteObject *obj, GError **error); #endif // !_DBUS_SERVICE_H
--- a/src/audacious/dbus.c Fri May 11 08:59:22 2007 -0700 +++ b/src/audacious/dbus.c Fri May 11 11:52:56 2007 -0700 @@ -39,14 +39,13 @@ #include "titlestring.h" #include "ui_jumptotrack.h" -static DBusGProxy *dbproxy = NULL; +G_DEFINE_TYPE(RemoteObject, audacious_rc, G_TYPE_OBJECT); -G_DEFINE_TYPE(RemoteObject, audacious_remote, G_TYPE_OBJECT); +void audacious_rc_class_init(RemoteObjectClass *klass) {} -void audacious_remote_class_init(RemoteObjectClass *klass) {} - -void audacious_remote_init(RemoteObject *object) { +void audacious_rc_init(RemoteObject *object) { GError *error = NULL; + DBusGProxy *driver_proxy; unsigned int request_ret; // Initialize the DBus connection @@ -57,8 +56,8 @@ return; } - dbus_g_object_type_install_info(audacious_remote_get_type(), - &dbus_glib_audacious_remote_object_info); + dbus_g_object_type_install_info(audacious_rc_get_type(), + &dbus_glib_audacious_rc_object_info); // Register DBUS path dbus_g_connection_register_g_object(object->connection, @@ -66,41 +65,91 @@ // Register the service name, the constants here are defined in // dbus-glib-bindings.h - dbproxy = dbus_g_proxy_new_for_name(object->connection, + driver_proxy = dbus_g_proxy_new_for_name(object->connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); - if (!org_freedesktop_DBus_request_name(dbproxy, + if (!org_freedesktop_DBus_request_name(driver_proxy, AUDACIOUS_DBUS_SERVICE, 0, &request_ret, &error)) { g_warning("Unable to register service: %s", error->message); g_error_free(error); } + + g_object_unref(driver_proxy); } void init_dbus() { g_type_init(); - g_object_new(audacious_remote_get_type(), NULL); + g_object_new(audacious_rc_get_type(), NULL); g_message("D-Bus support has been activated"); } -void free_dbus() { - if (dbproxy != NULL) - g_object_unref(dbproxy); -} - -DBusGProxy *audacious_get_dbus_proxy() { - return dbproxy; -} - // Audacious General Information -gboolean audacious_remote_version(RemoteObject *obj, gchar **version, +gboolean audacious_rc_version(RemoteObject *obj, gchar **version, GError **error) { *version = g_strdup(VERSION); return TRUE; } +gboolean audacious_rc_quit(RemoteObject *obj, GError **error) { + mainwin_quit_cb(); + return TRUE; +} + +gboolean audacious_rc_eject(RemoteObject *obj, GError **error) { + if (has_x11_connection) + mainwin_eject_pushed(); + return TRUE; +} + +gboolean audacious_rc_main_win_visible(RemoteObject *obj, + gboolean *is_main_win, GError **error) { + *is_main_win = cfg.player_visible; + g_message("main win %s\n", (cfg.player_visible? "visible" : "hidden")); + return TRUE; +} + +gboolean audacious_rc_show_main_win(RemoteObject *obj, gboolean show, + GError **error) { + g_message("%s main win\n", (show? "showing": "hiding")); + if (has_x11_connection) + mainwin_show(show); + return TRUE; +} + +gboolean audacious_rc_equalizer_visible(RemoteObject *obj, + gboolean *is_eq_win, GError **error) { + *is_eq_win = cfg.playlist_visible; + return TRUE; +} + +gboolean audacious_rc_show_equalizer(RemoteObject *obj, gboolean show, + GError **error) { + if (has_x11_connection) + equalizerwin_show(show); + return TRUE; +} + +gboolean audacious_rc_playlist_visible(RemoteObject *obj, + gboolean *is_pl_win, + GError **error) { + *is_pl_win = cfg.equalizer_visible; + return TRUE; +} + +gboolean audacious_rc_show_playlist(RemoteObject *obj, gboolean show, + GError **error) { + if (has_x11_connection) { + if (show) + playlistwin_show(); + else + playlistwin_hide(); + } + return TRUE; +} + // Playback Information/Manipulation -gboolean audacious_remote_play(RemoteObject *obj, GError **error) { +gboolean audacious_rc_play(RemoteObject *obj, GError **error) { if (playback_get_paused()) playback_pause(); else if (playlist_get_length(playlist_get_active())) @@ -110,12 +159,12 @@ return TRUE; } -gboolean audacious_remote_pause(RemoteObject *obj, GError **error) { +gboolean audacious_rc_pause(RemoteObject *obj, GError **error) { playback_pause(); return TRUE; } -gboolean audacious_remote_stop(RemoteObject *obj, GError **error) { +gboolean audacious_rc_stop(RemoteObject *obj, GError **error) { ip_data.stop = TRUE; playback_stop(); ip_data.stop = FALSE; @@ -123,25 +172,25 @@ return TRUE; } -gboolean audacious_remote_playing(RemoteObject *obj, gboolean *is_playing, +gboolean audacious_rc_playing(RemoteObject *obj, gboolean *is_playing, GError **error) { *is_playing = playback_get_playing(); return TRUE; } -gboolean audacious_remote_paused(RemoteObject *obj, gboolean *is_paused, +gboolean audacious_rc_paused(RemoteObject *obj, gboolean *is_paused, GError **error) { *is_paused = playback_get_paused(); return TRUE; } -gboolean audacious_remote_stopped(RemoteObject *obj, gboolean *is_stopped, +gboolean audacious_rc_stopped(RemoteObject *obj, gboolean *is_stopped, GError **error) { *is_stopped = !playback_get_playing(); return TRUE; } -gboolean audacious_remote_status(RemoteObject *obj, gchar **status, +gboolean audacious_rc_status(RemoteObject *obj, gchar **status, GError **error) { if (playback_get_paused()) *status = g_strdup("paused"); @@ -152,7 +201,7 @@ return TRUE; } -gboolean audacious_remote_time(RemoteObject *obj, gint *time, GError **error) { +gboolean audacious_rc_time(RemoteObject *obj, gint *time, GError **error) { if (playback_get_playing()) *time = playback_get_time(); else @@ -160,7 +209,7 @@ return TRUE; } -gboolean audacious_remote_seek(RemoteObject *obj, guint pos, GError **error) { +gboolean audacious_rc_seek(RemoteObject *obj, guint pos, GError **error) { if (playlist_get_current_length(playlist_get_active()) > 0 && pos < (guint)playlist_get_current_length(playlist_get_active())) playback_seek(pos / 1000); @@ -168,13 +217,13 @@ return TRUE; } -gboolean audacious_remote_volume(RemoteObject *obj, gint *vl, gint *vr, +gboolean audacious_rc_volume(RemoteObject *obj, gint *vl, gint *vr, GError **error) { input_get_volume(vl, vr); return TRUE; } -gboolean audacious_remote_set_volume(RemoteObject *obj, gint vl, gint vr, +gboolean audacious_rc_set_volume(RemoteObject *obj, gint vl, gint vr, GError **error) { if (vl > 100) vl = 100; @@ -184,7 +233,7 @@ return TRUE; } -gboolean audacious_remote_balance(RemoteObject *obj, gint *balance, +gboolean audacious_rc_balance(RemoteObject *obj, gint *balance, GError **error) { gint vl, vr; input_get_volume(&vl, &vr); @@ -200,94 +249,94 @@ } // Playlist Information/Manipulation -gboolean audacious_remote_position(RemoteObject *obj, int *pos, GError **error) +gboolean audacious_rc_position(RemoteObject *obj, int *pos, GError **error) { *pos = playlist_get_position(playlist_get_active()); return TRUE; } -gboolean audacious_remote_advance(RemoteObject *obj, GError **error) { +gboolean audacious_rc_advance(RemoteObject *obj, GError **error) { playlist_next(playlist_get_active()); return TRUE; } -gboolean audacious_remote_reverse(RemoteObject *obj, GError **error) { +gboolean audacious_rc_reverse(RemoteObject *obj, GError **error) { playlist_prev(playlist_get_active()); return TRUE; } -gboolean audacious_remote_length(RemoteObject *obj, int *length, +gboolean audacious_rc_length(RemoteObject *obj, int *length, GError **error) { *length = playlist_get_length(playlist_get_active()); return TRUE; } -gboolean audacious_remote_song_title(RemoteObject *obj, int pos, +gboolean audacious_rc_song_title(RemoteObject *obj, int pos, gchar **title, GError **error) { *title = playlist_get_songtitle(playlist_get_active(), pos); return TRUE; } -gboolean audacious_remote_song_filename(RemoteObject *obj, int pos, +gboolean audacious_rc_song_filename(RemoteObject *obj, int pos, gchar **filename, GError **error) { *filename = playlist_get_filename(playlist_get_active(), pos); return TRUE; } -gboolean audacious_remote_song_length(RemoteObject *obj, int pos, int *length, +gboolean audacious_rc_song_length(RemoteObject *obj, int pos, int *length, GError **error) { *length = playlist_get_songtime(playlist_get_active(), pos) / 1000; return TRUE; } -gboolean audacious_remote_song_frames(RemoteObject *obj, int pos, int *length, +gboolean audacious_rc_song_frames(RemoteObject *obj, int pos, int *length, GError **error) { *length = playlist_get_songtime(playlist_get_active(), pos); return TRUE; } -gboolean audacious_remote_jump(RemoteObject *obj, int pos, GError **error) { +gboolean audacious_rc_jump(RemoteObject *obj, int pos, GError **error) { if (pos < (guint)playlist_get_length(playlist_get_active())) playlist_set_position(playlist_get_active(), pos); return TRUE; } -gboolean audacious_remote_add_url(RemoteObject *obj, gchar *url, +gboolean audacious_rc_add_url(RemoteObject *obj, gchar *url, GError **error) { playlist_add_url(playlist_get_active(), url); return TRUE; } -gboolean audacious_remote_delete(RemoteObject *obj, int pos, GError **error) { +gboolean audacious_rc_delete(RemoteObject *obj, int pos, GError **error) { playlist_delete_index(playlist_get_active(), pos); return TRUE; } -gboolean audacious_remote_clear(RemoteObject *obj, GError **error) { +gboolean audacious_rc_clear(RemoteObject *obj, GError **error) { playlist_clear(playlist_get_active()); mainwin_clear_song_info(); mainwin_set_info_text(); return TRUE; } -gboolean audacious_remote_repeating(RemoteObject *obj, gboolean *is_repeating, +gboolean audacious_rc_repeating(RemoteObject *obj, gboolean *is_repeating, GError **error) { *is_repeating = cfg.repeat; return TRUE; } -gboolean audacious_remote_repeat(RemoteObject *obj, GError **error) { +gboolean audacious_rc_repeat(RemoteObject *obj, GError **error) { mainwin_repeat_pushed(!cfg.repeat); return TRUE; } -gboolean audacious_remote_shuffling(RemoteObject *obj, gboolean *is_shuffling, +gboolean audacious_rc_shuffling(RemoteObject *obj, gboolean *is_shuffling, GError **error) { *is_shuffling = cfg.shuffle; return TRUE; } -gboolean audacious_remote_shuffle(RemoteObject *obj, GError **error) { +gboolean audacious_rc_shuffle(RemoteObject *obj, GError **error) { mainwin_shuffle_pushed(!cfg.shuffle); return TRUE; }
--- a/src/audacious/main.c Fri May 11 08:59:22 2007 -0700 +++ b/src/audacious/main.c Fri May 11 11:52:56 2007 -0700 @@ -897,7 +897,7 @@ { gchar **filenames = options->filenames; #ifdef HAVE_DBUS - DBusGProxy *session = audacious_get_dbus_proxy(); + // DBusGProxy *session = audacious_get_dbus_proxy(); #endif if (options->version) @@ -1143,6 +1143,10 @@ exit(EXIT_SUCCESS); } +#ifdef USE_DBUS + init_dbus(); +#endif + plugin_system_init(); /* Initialize the playlist system. */ @@ -1183,10 +1187,6 @@ if (options.headless != 1) GDK_THREADS_LEAVE(); -#ifdef USE_DBUS - init_dbus(); -#endif - handle_cmd_line_options(&options, FALSE); if (options.headless != 1) @@ -1255,10 +1255,6 @@ GDK_THREADS_LEAVE(); -#ifdef USE_DBUS - free_dbus(); -#endif - g_cond_free(cond_scan); g_mutex_free(mutex_scan); @@ -1278,10 +1274,6 @@ g_timeout_add(10, aud_headless_iteration, NULL); g_main_loop_run(loop); -#ifdef USE_DBUS - free_dbus(); -#endif - return EXIT_SUCCESS; } }
--- a/src/audacious/objects.xml Fri May 11 08:59:22 2007 -0700 +++ b/src/audacious/objects.xml Fri May 11 11:52:56 2007 -0700 @@ -43,35 +43,35 @@ CMD_PLAYLIST_DELETE CMD_IS_REPEAT CMD_IS_SHUFFLE + CMD_GET_VOLUME + CMD_SET_VOLUME + CMD_GET_BALANCE + CMD_IS_EQ_WIN + CMD_IS_PL_WIN + CMD_IS_MAIN_WIN + CMD_PL_WIN_TOGGLE + CMD_EQ_WIN_TOGGLE + CMD_MAIN_WIN_TOGGLE + CMD_QUIT + CMD_EJECT Remaining: CMD_PLAYLIST_ADD - CMD_GET_VOLUME - CMD_SET_VOLUME CMD_GET_SKIN CMD_SET_SKIN CMD_GET_INFO CMD_GET_EQ_DATA CMD_SET_EQ_DATA - CMD_PL_WIN_TOGGLE - CMD_EQ_WIN_TOGGLE CMD_SHOW_PREFS_BOX CMD_TOGGLE_AOT CMD_SHOW_ABOUT_BOX - CMD_EJECT - CMD_GET_BALANCE - CMD_MAIN_WIN_TOGGLE - CMD_IS_EQ_WIN - CMD_IS_PL_WIN - CMD_IS_MAIN_WIN CMD_GET_EQ CMD_GET_EQ_PREAMP CMD_GET_EQ_BAND CMD_SET_EQ CMD_SET_EQ_PREAMP CMD_SET_EQ_BAND - CMD_QUIT CMD_PLAYLIST_INS_URL_STRING CMD_PLAYLIST_INS CMD_PLAY_PAUSE @@ -98,6 +98,49 @@ <arg type="s" direction="out" name="version"/> </method> + <!-- Quit Audacious --> + <method name="Quit"> + <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + </method> + + <!-- Open files (Eject) --> + <method name="Eject"> + <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + </method> + + <!-- Main window visibility --> + <method name="MainWinVisible"> + <arg type="b" direction="out" name="is_main_win"/> + </method> + + <!-- Toggle main window visibility --> + <method name="ShowMainWin"> + <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="show"/> + </method> + + <!-- Equalizer visibility --> + <method name="EqualizerVisible"> + <arg type="b" direction="out" name="is_eq_win"/> + </method> + + <!-- Toggle equalizer visibility --> + <method name="ShowEqualizer"> + <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="show"/> + </method> + + <!-- Playlist visibility --> + <method name="PlaylistVisible"> + <arg type="b" direction="out" name="is_pl_win"/> + </method> + + <!-- Toggle playlist visibility --> + <method name="ShowPlaylist"> + <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="show"/> + </method> + <!-- Playback Information/Manipulation --> <!-- Begin or resume playback --> <method name="Play">
--- a/src/audacious/pluginenum.c Fri May 11 08:59:22 2007 -0700 +++ b/src/audacious/pluginenum.c Fri May 11 11:52:56 2007 -0700 @@ -38,6 +38,7 @@ #ifdef USE_DBUS +#include "dbus.h" #include "dbus-service.h" #endif @@ -62,6 +63,11 @@ GHashTable *plugin_matrix = NULL; GList *lowlevel_list = NULL; +#ifdef USE_DBUS +static DBusGProxy *dbus_proxy = NULL; +static DBusGConnection *connection = NULL; +#endif + extern GList *vfs_transports; static gint @@ -179,7 +185,7 @@ GeneralPlugin *p = GENERAL_PLUGIN(plugin); p->xmms_session = -1; #ifdef USE_DBUS - p->dbus_proxy = audacious_get_dbus_proxy(); + p->dbus_proxy = dbus_proxy; #endif gp_data.general_list = g_list_append(gp_data.general_list, p); } @@ -190,7 +196,7 @@ VisPlugin *p = VIS_PLUGIN(plugin); p->xmms_session = -1; #ifdef USE_DBUS - p->dbus_proxy = audacious_get_dbus_proxy(); + p->dbus_proxy = dbus_proxy; #endif p->disable_plugin = vis_disable_plugin; vp_data.vis_list = g_list_append(vp_data.vis_list, p); @@ -286,6 +292,23 @@ LowlevelPlugin *lp; gint dirsel = 0, i = 0; +#ifdef USE_DBUS + GError *error = NULL; + connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + + if (connection == NULL) + { + g_printerr("audtool: D-Bus error: %s", error->message); + g_error_free(error); + + exit(EXIT_FAILURE); + } + + dbus_proxy = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE, + AUDACIOUS_DBUS_PATH, + AUDACIOUS_DBUS_INTERFACE); +#endif + if (!g_module_supported()) { report_error("Module loading not supported! Plugins will not be loaded.\n"); return;
--- a/src/libaudclient/audctrl.c Fri May 11 08:59:22 2007 -0700 +++ b/src/libaudclient/audctrl.c Fri May 11 11:52:56 2007 -0700 @@ -227,21 +227,49 @@ } void audacious_remote_main_win_toggle(DBusGProxy *proxy, gboolean show) { + const char* path = dbus_g_proxy_get_path(proxy); + g_print("path: %s\n", path); + org_atheme_audacious_show_main_win(proxy, show, &error); + g_clear_error(&error); } void audacious_remote_pl_win_toggle(DBusGProxy *proxy, gboolean show) { + org_atheme_audacious_show_playlist(proxy, show, &error); + g_clear_error(&error); } void audacious_remote_eq_win_toggle(DBusGProxy *proxy, gboolean show) { + org_atheme_audacious_show_equalizer(proxy, show, &error); + g_clear_error(&error); } +/** + * xmms_remote_is_main_win: + * @session: Legacy XMMS-style session identifier. + * + * Queries Audacious about the main window's visibility. + * + * Return value: TRUE if visible, FALSE otherwise. + **/ gboolean audacious_remote_is_main_win(DBusGProxy *proxy) { + gboolean visible; + org_atheme_audacious_main_win_visible(proxy, &visible, &error); + g_clear_error(&error); + return visible; } gboolean audacious_remote_is_pl_win(DBusGProxy *proxy) { + gboolean visible; + org_atheme_audacious_playlist_visible(proxy, &visible, &error); + g_clear_error(&error); + return visible; } gboolean audacious_remote_is_eq_win(DBusGProxy *proxy) { + gboolean visible; + org_atheme_audacious_equalizer_visible(proxy, &visible, &error); + g_clear_error(&error); + return visible; } void audacious_remote_show_prefs_box(DBusGProxy *proxy) { @@ -251,6 +279,8 @@ } void audacious_remote_eject(DBusGProxy *proxy) { + org_atheme_audacious_eject(proxy, &error); + g_clear_error(&error); } void audacious_remote_playlist_prev(DBusGProxy *proxy) { @@ -303,6 +333,8 @@ } void audacious_remote_quit(DBusGProxy *proxy) { + org_atheme_audacious_quit(proxy, &error); + g_clear_error(&error); } void audacious_remote_play_pause(DBusGProxy *proxy) {