annotate src/audacious/dbus.c @ 2728:452a159dc619 trunk

[svn] - log when dbus has been successfully started up
author nenolod
date Thu, 10 May 2007 13:21:55 -0700
parents 6884a2144a01
children cf080b11c3fa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
1 /*
2696
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
2 * Audacious: A cross-platform multimedia player
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
3 * Copyright (c) 2007 Ben Tucker
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
4 *
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
5 * This program is free software; you can redistribute it and/or modify
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
6 * it under the terms of the GNU General Public License as published by
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
7 * the Free Software Foundation; under version 2 of the License.
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
8 *
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
9 * This program is distributed in the hope that it will be useful,
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
12 * GNU General Public License for more details.
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
13 *
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
14 * You should have received a copy of the GNU General Public License
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
15 * along with this program; if not, write to the Free Software
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
17 * 02110-1301, USA.
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
18 */
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
19
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
20 #ifdef HAVE_CONFIG_H
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
21 # include "config.h"
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
22 #endif
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
23
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
24 #include <glib.h>
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
25 #include <dbus/dbus-glib-bindings.h>
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
26 #include "dbus.h"
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
27 #include "dbus-service.h"
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
28 #include "dbus-server-bindings.h"
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
29
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
30 #include "main.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
31 #include "ui_equalizer.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
32 #include "ui_main.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
33 #include "input.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
34 #include "playback.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
35 #include "playlist.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
36 #include "ui_playlist.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
37 #include "ui_preferences.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
38 #include "memorypool.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
39 #include "titlestring.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
40 #include "ui_jumptotrack.h"
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
41
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
42 static DBusGProxy *dbproxy = NULL;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
43
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
44 G_DEFINE_TYPE(RemoteObject, audacious_remote, G_TYPE_OBJECT);
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
45
2702
89155edffa31 [svn] - rename *class prototypes to *klass to avoid keyword collisions in sun studio and icc.
nenolod
parents: 2700
diff changeset
46 void audacious_remote_class_init(RemoteObjectClass *klass) {}
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
47
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
48 void audacious_remote_init(RemoteObject *object) {
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
49 GError *error = NULL;
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
50 unsigned int request_ret;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
51
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
52 // Initialize the DBus connection
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
53 object->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
54 if (object->connection == NULL) {
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
55 g_warning("Unable to connect to dbus: %s", error->message);
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
56 g_error_free(error);
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
57 return;
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
58 }
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
59
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
60 dbus_g_object_type_install_info(audacious_remote_get_type(),
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
61 &dbus_glib_audacious_remote_object_info);
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
62
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
63 // Register DBUS path
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
64 dbus_g_connection_register_g_object(object->connection,
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
65 AUDACIOUS_DBUS_PATH, G_OBJECT(object));
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
66
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
67 // Register the service name, the constants here are defined in
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
68 // dbus-glib-bindings.h
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
69 dbproxy = dbus_g_proxy_new_for_name(object->connection,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
70 DBUS_SERVICE_DBUS, DBUS_PATH_DBUS,
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
71 DBUS_INTERFACE_DBUS);
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
72
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
73 if (!org_freedesktop_DBus_request_name(dbproxy,
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
74 AUDACIOUS_DBUS_SERVICE, 0, &request_ret, &error)) {
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
75 g_warning("Unable to register service: %s", error->message);
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
76 g_error_free(error);
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
77 }
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
78 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
79
2700
2d1837805ca4 [svn] Improved DBus initialization and fixed a warning.
magma
parents: 2696
diff changeset
80 void init_dbus() {
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
81 g_type_init();
2700
2d1837805ca4 [svn] Improved DBus initialization and fixed a warning.
magma
parents: 2696
diff changeset
82 g_object_new(audacious_remote_get_type(), NULL);
2728
452a159dc619 [svn] - log when dbus has been successfully started up
nenolod
parents: 2717
diff changeset
83 g_message("D-Bus support has been activated");
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
84 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
85
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
86 void free_dbus() {
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
87 if (dbproxy != NULL)
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
88 g_object_unref(dbproxy);
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
89 }
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
90
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
91 DBusGProxy *audacious_get_dbus_proxy() {
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
92 return dbproxy;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
93 }
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
94
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
95 // Audacious General Information
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
96 gboolean audacious_remote_version(RemoteObject *obj, gchar **version,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
97 GError **error) {
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
98 *version = g_strdup(VERSION);
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
99 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
100 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
101
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
102 // Playback Information/Manipulation
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
103 gboolean audacious_remote_play(RemoteObject *obj, GError **error) {
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
104 if (playback_get_paused())
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
105 playback_pause();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
106 else if (playlist_get_length(playlist_get_active()))
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
107 playback_initiate();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
108 else
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
109 mainwin_eject_pushed();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
110 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
111 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
112
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
113 gboolean audacious_remote_pause(RemoteObject *obj, GError **error) {
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
114 playback_pause();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
115 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
116 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
117
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
118 gboolean audacious_remote_stop(RemoteObject *obj, GError **error) {
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
119 ip_data.stop = TRUE;
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
120 playback_stop();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
121 ip_data.stop = FALSE;
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
122 mainwin_clear_song_info();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
123 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
124 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
125
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
126 gboolean audacious_remote_playing(RemoteObject *obj, gboolean *is_playing,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
127 GError **error) {
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
128 *is_playing = playback_get_playing();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
129 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
130 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
131
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
132 gboolean audacious_remote_paused(RemoteObject *obj, gboolean *is_paused,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
133 GError **error) {
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
134 *is_paused = playback_get_paused();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
135 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
136 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
137
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
138 gboolean audacious_remote_stopped(RemoteObject *obj, gboolean *is_stopped,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
139 GError **error) {
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
140 *is_stopped = !playback_get_playing();
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
141 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
142 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
143
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
144 gboolean audacious_remote_status(RemoteObject *obj, gchar **status,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
145 GError **error) {
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
146 if (playback_get_paused())
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
147 *status = g_strdup("paused");
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
148 else if (playback_get_playing())
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
149 *status = g_strdup("playing");
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
150 else
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
151 *status = g_strdup("stopped");
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
152 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
153 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
154
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
155 gboolean audacious_remote_time(RemoteObject *obj, gint *time, GError **error) {
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
156 if (playback_get_playing())
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
157 *time = playback_get_time();
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
158 else
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
159 *time = 0;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
160 return TRUE;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
161 }
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
162
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
163 gboolean audacious_remote_seek(RemoteObject *obj, guint pos, GError **error) {
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
164 if (playlist_get_current_length(playlist_get_active()) > 0 &&
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
165 pos < (guint)playlist_get_current_length(playlist_get_active()))
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
166 playback_seek(pos / 1000);
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
167
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
168 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
169 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
170
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
171 gboolean audacious_remote_volume(RemoteObject *obj, gint *vl, gint *vr,
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
172 GError **error) {
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
173 input_get_volume(vl, vr);
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
174 return TRUE;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
175 }
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
176
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
177 gboolean audacious_remote_set_volume(RemoteObject *obj, gint vl, gint vr,
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
178 GError **error) {
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
179 if (vl > 100)
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
180 vl = 100;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
181 if (vr > 100)
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
182 vr = 100;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
183 input_set_volume(vl, vr);
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
184 return TRUE;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
185 }
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
186
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
187 gboolean audacious_remote_balance(RemoteObject *obj, gint *balance,
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
188 GError **error) {
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
189 gint vl, vr;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
190 input_get_volume(&vl, &vr);
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
191 if (vl < 0 || vr < 0)
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
192 *balance = 0;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
193 else if (vl > vr)
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
194 *balance = -100 + ((vr * 100) / vl);
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
195 else if (vr > vl)
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
196 *balance = 100 - ((vl * 100) / vr);
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
197 else
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
198 *balance = 0;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
199 return TRUE;
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
200 }
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2706
diff changeset
201
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
202 // Playlist Information/Manipulation
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
203 gboolean audacious_remote_position(RemoteObject *obj, int *pos, GError **error)
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
204 {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
205 *pos = playlist_get_position(playlist_get_active());
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
206 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
207 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
208
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
209 gboolean audacious_remote_advance(RemoteObject *obj, GError **error) {
2696
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
210 playlist_next(playlist_get_active());
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
211 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
212 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
213
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
214 gboolean audacious_remote_reverse(RemoteObject *obj, GError **error) {
2696
c00850315ce1 [svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents: 2695
diff changeset
215 playlist_prev(playlist_get_active());
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
216 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
217 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
218
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
219 gboolean audacious_remote_length(RemoteObject *obj, int *length,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
220 GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
221 *length = playlist_get_length(playlist_get_active());
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
222 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
223 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
224
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
225 gboolean audacious_remote_song_title(RemoteObject *obj, int pos,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
226 gchar **title, GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
227 *title = playlist_get_songtitle(playlist_get_active(), pos);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
228 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
229 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
230
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
231 gboolean audacious_remote_song_filename(RemoteObject *obj, int pos,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
232 gchar **filename, GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
233 *filename = playlist_get_filename(playlist_get_active(), pos);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
234 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
235 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
236
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
237 gboolean audacious_remote_song_length(RemoteObject *obj, int pos, int *length,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
238 GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
239 *length = playlist_get_songtime(playlist_get_active(), pos) / 1000;
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
240 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
241 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
242
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
243 gboolean audacious_remote_song_frames(RemoteObject *obj, int pos, int *length,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
244 GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
245 *length = playlist_get_songtime(playlist_get_active(), pos);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
246 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
247 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
248
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
249 gboolean audacious_remote_jump(RemoteObject *obj, int pos, GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
250 if (pos < (guint)playlist_get_length(playlist_get_active()))
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
251 playlist_set_position(playlist_get_active(), pos);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
252 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
253 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
254
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
255 gboolean audacious_remote_add_url(RemoteObject *obj, gchar *url,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
256 GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
257 playlist_add_url(playlist_get_active(), url);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
258 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
259 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
260
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
261 gboolean audacious_remote_delete(RemoteObject *obj, int pos, GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
262 playlist_delete_index(playlist_get_active(), pos);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
263 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
264 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
265
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
266 gboolean audacious_remote_clear(RemoteObject *obj, GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
267 playlist_clear(playlist_get_active());
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
268 mainwin_clear_song_info();
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
269 mainwin_set_info_text();
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
270 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
271 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
272
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
273 gboolean audacious_remote_repeating(RemoteObject *obj, gboolean *is_repeating,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
274 GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
275 *is_repeating = cfg.repeat;
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
276 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
277 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
278
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
279 gboolean audacious_remote_repeat(RemoteObject *obj, GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
280 mainwin_repeat_pushed(!cfg.repeat);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
281 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
282 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
283
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
284 gboolean audacious_remote_shuffling(RemoteObject *obj, gboolean *is_shuffling,
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
285 GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
286 *is_shuffling = cfg.shuffle;
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
287 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
288 }
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
289
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
290 gboolean audacious_remote_shuffle(RemoteObject *obj, GError **error) {
2706
958d12f78138 [svn] Completed the implementation of all the stubs in dbus.c, and commented the creation of the mpris dbus bindings to fix compilation issues.
magma
parents: 2702
diff changeset
291 mainwin_shuffle_pushed(!cfg.shuffle);
2695
4c4c8b294287 [svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents: 2694
diff changeset
292 return TRUE;
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents:
diff changeset
293 }