Mercurial > audlegacy
annotate src/audlegacy/dbus.c @ 4870:56af01cd5a5c
Eliminate a double free (bug #30)
author | John Lindgren <john.lindgren@tds.net> |
---|---|
date | Sat, 25 Apr 2009 21:32:54 -0400 |
parents | 51e2089a73f1 |
children | 43eb8388760d |
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 |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
2814
diff
changeset
|
7 * the Free Software Foundation; under version 3 of the License. |
2696
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 |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
2814
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
16 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
17 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
18 * Audacious or using our public API to be a derived work. |
2696
c00850315ce1
[svn] Fixed licensing issues and DBus node/interface names. Also implemented playlist advance and reverse.
magma
parents:
2695
diff
changeset
|
19 */ |
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
|
20 |
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
|
21 #ifdef HAVE_CONFIG_H |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
22 # 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
|
23 #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
|
24 |
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 <glib.h> |
3888 | 26 #include <dbus/dbus.h> |
27 #include <dbus/dbus-glib.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
|
28 #include <dbus/dbus-glib-bindings.h> |
3888 | 29 #include <dbus/dbus-glib-lowlevel.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
|
30 #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
|
31 #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
|
32 #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
|
33 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
34 #include <math.h> |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
35 #include "equalizer.h" |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
36 #include "input.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
|
37 #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
|
38 #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
|
39 #include "playlist.h" |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
40 #include "strings.h" |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
41 #include "tuple.h" |
4820
da1347e9de81
-dbus.c:278: warning: implicit declaration of function ¡Ærun_filebrowser¡Ç
Tony Vroon <chainsaw@gentoo.org>
parents:
4811
diff
changeset
|
42 #include "ui_fileopener.h" |
4577 | 43 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
44 static DBusGConnection *dbus_conn = NULL; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
45 static guint signals[LAST_SIG] = { 0 }; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
46 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
47 G_DEFINE_TYPE(RemoteObject, audacious_rc, G_TYPE_OBJECT); |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
48 G_DEFINE_TYPE(MprisRoot, mpris_root, G_TYPE_OBJECT); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
49 G_DEFINE_TYPE(MprisPlayer, mpris_player, G_TYPE_OBJECT); |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
50 G_DEFINE_TYPE(MprisTrackList, mpris_tracklist, G_TYPE_OBJECT); |
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
|
51 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
52 #define DBUS_TYPE_G_STRING_VALUE_HASHTABLE (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
53 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
54 void audacious_rc_class_init(RemoteObjectClass *klass) {} |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
55 void mpris_root_class_init(MprisRootClass *klass) {} |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
56 |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
57 void mpris_player_class_init(MprisPlayerClass *klass) { |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
58 signals[CAPS_CHANGE_SIG] = |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
59 g_signal_new("caps_change", |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
60 G_OBJECT_CLASS_TYPE(klass), |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
61 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
62 0, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
63 NULL, NULL, |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
64 g_cclosure_marshal_VOID__INT, |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
65 G_TYPE_NONE, 1, G_TYPE_INT); |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
66 signals[TRACK_CHANGE_SIG] = |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
67 g_signal_new("track_change", |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
68 G_OBJECT_CLASS_TYPE(klass), |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
69 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
70 0, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
71 NULL, NULL, |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
72 g_cclosure_marshal_VOID__BOXED, |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
73 G_TYPE_NONE, 1, DBUS_TYPE_G_STRING_VALUE_HASHTABLE); |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
74 signals[STATUS_CHANGE_SIG] = |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
75 g_signal_new("status_change", |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
76 G_OBJECT_CLASS_TYPE(klass), |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
77 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
78 0, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
79 NULL, NULL, |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
80 g_cclosure_marshal_VOID__INT, |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
81 G_TYPE_NONE, 1, G_TYPE_INT); |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
82 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
83 |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
84 void mpris_tracklist_class_init(MprisTrackListClass *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
|
85 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
86 void audacious_rc_init(RemoteObject *object) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
87 GError *error = NULL; |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
88 DBusGProxy *driver_proxy; |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
89 guint 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
|
90 |
4630
64c40b3e69f4
Added few g_messages() to ease debugging of certain D-Bus-related problems.
Matti Hamalainen <ccr@tnsp.org>
parents:
4629
diff
changeset
|
91 g_message("Registering remote D-Bus interfaces"); |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
92 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
93 dbus_g_object_type_install_info(audacious_rc_get_type(), |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
94 &dbus_glib_audacious_rc_object_info); |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
95 |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
96 // Register DBUS path |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
97 dbus_g_connection_register_g_object(dbus_conn, |
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
|
98 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
|
99 |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
100 // 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
|
101 // dbus-glib-bindings.h |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
102 driver_proxy = dbus_g_proxy_new_for_name(dbus_conn, |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
103 DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
104 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
|
105 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
106 if (!org_freedesktop_DBus_request_name(driver_proxy, |
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
|
107 AUDACIOUS_DBUS_SERVICE, 0, &request_ret, &error)) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
108 g_warning("Unable to register service: %s", error->message); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
109 g_error_free(error); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
110 } |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
111 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
112 if (!org_freedesktop_DBus_request_name(driver_proxy, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
113 AUDACIOUS_DBUS_SERVICE_MPRIS, 0, &request_ret, &error)) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
114 g_warning("Unable to register service: %s", error->message); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
115 g_error_free(error); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
116 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
117 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
118 g_object_unref(driver_proxy); |
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
|
119 } |
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
|
120 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
121 void mpris_root_init(MprisRoot *object) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
122 dbus_g_object_type_install_info(mpris_root_get_type(), |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
123 &dbus_glib_mpris_root_object_info); |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
124 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
125 // Register DBUS path |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
126 dbus_g_connection_register_g_object(dbus_conn, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
127 AUDACIOUS_DBUS_PATH_MPRIS_ROOT, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
128 G_OBJECT(object)); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
129 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
130 |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
131 void mpris_player_init(MprisPlayer *object) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
132 dbus_g_object_type_install_info(mpris_player_get_type(), |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
133 &dbus_glib_mpris_player_object_info); |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
134 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
135 // Register DBUS path |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
136 dbus_g_connection_register_g_object(dbus_conn, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
137 AUDACIOUS_DBUS_PATH_MPRIS_PLAYER, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
138 G_OBJECT(object)); |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
139 |
4629
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
140 // Add signals |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
141 DBusGProxy *proxy = object->proxy; |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
142 if (proxy != NULL) { |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
143 dbus_g_proxy_add_signal(proxy, "StatusChange", |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
144 G_TYPE_INT, G_TYPE_INVALID); |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
145 dbus_g_proxy_add_signal(proxy, "CapsChange", |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
146 G_TYPE_INT, G_TYPE_INVALID); |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
147 dbus_g_proxy_add_signal(proxy, "TrackChange", |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
148 DBUS_TYPE_G_STRING_VALUE_HASHTABLE, G_TYPE_INVALID); |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
149 } else { |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
150 /* XXX / FIXME: Why does this happen? -- ccr */ |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
151 g_warning("in mpris_player_init object->proxy == NULL, not adding some signals."); |
d239bf252eac
Print a warning instead of mysterious dbus-glib assertion failures when
Matti Hamalainen <ccr@tnsp.org>
parents:
4610
diff
changeset
|
152 } |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
153 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
154 |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
155 void mpris_tracklist_init(MprisTrackList *object) { |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
156 dbus_g_object_type_install_info(mpris_tracklist_get_type(), |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
157 &dbus_glib_mpris_tracklist_object_info); |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
158 |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
159 // Register DBUS path |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
160 dbus_g_connection_register_g_object(dbus_conn, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
161 AUDACIOUS_DBUS_PATH_MPRIS_TRACKLIST, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
162 G_OBJECT(object)); |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
163 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
164 |
2700
2d1837805ca4
[svn] Improved DBus initialization and fixed a warning.
magma
parents:
2696
diff
changeset
|
165 void init_dbus() { |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
166 GError *error = NULL; |
3886
5c8d5ff0e601
fix exit_on_disconnect behaviour.
William Pitcock <nenolod@atheme.org>
parents:
3873
diff
changeset
|
167 DBusConnection *local_conn; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
168 // Initialize the DBus connection |
4630
64c40b3e69f4
Added few g_messages() to ease debugging of certain D-Bus-related problems.
Matti Hamalainen <ccr@tnsp.org>
parents:
4629
diff
changeset
|
169 g_message("Trying to initialize D-Bus"); |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
170 dbus_conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
171 if (dbus_conn == NULL) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
172 g_warning("Unable to connect to dbus: %s", error->message); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
173 g_error_free(error); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
174 return; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
175 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
176 |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
177 g_type_init(); |
4630
64c40b3e69f4
Added few g_messages() to ease debugging of certain D-Bus-related problems.
Matti Hamalainen <ccr@tnsp.org>
parents:
4629
diff
changeset
|
178 g_message("D-Bus RC"); |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
179 g_object_new(audacious_rc_get_type(), NULL); |
4630
64c40b3e69f4
Added few g_messages() to ease debugging of certain D-Bus-related problems.
Matti Hamalainen <ccr@tnsp.org>
parents:
4629
diff
changeset
|
180 g_message("D-Bus MPRIS root"); |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
181 g_object_new(mpris_root_get_type(), NULL); |
4630
64c40b3e69f4
Added few g_messages() to ease debugging of certain D-Bus-related problems.
Matti Hamalainen <ccr@tnsp.org>
parents:
4629
diff
changeset
|
182 g_message("D-Bus MPRIS player"); |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
183 mpris = g_object_new(mpris_player_get_type(), NULL); |
4630
64c40b3e69f4
Added few g_messages() to ease debugging of certain D-Bus-related problems.
Matti Hamalainen <ccr@tnsp.org>
parents:
4629
diff
changeset
|
184 g_message("result=%p", mpris); |
64c40b3e69f4
Added few g_messages() to ease debugging of certain D-Bus-related problems.
Matti Hamalainen <ccr@tnsp.org>
parents:
4629
diff
changeset
|
185 g_message("D-Bus MPRIS tracklist"); |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
186 g_object_new(mpris_tracklist_get_type(), NULL); |
2728
452a159dc619
[svn] - log when dbus has been successfully started up
nenolod
parents:
2717
diff
changeset
|
187 g_message("D-Bus support has been activated"); |
3886
5c8d5ff0e601
fix exit_on_disconnect behaviour.
William Pitcock <nenolod@atheme.org>
parents:
3873
diff
changeset
|
188 |
5c8d5ff0e601
fix exit_on_disconnect behaviour.
William Pitcock <nenolod@atheme.org>
parents:
3873
diff
changeset
|
189 local_conn = dbus_g_connection_get_connection(dbus_conn); |
5c8d5ff0e601
fix exit_on_disconnect behaviour.
William Pitcock <nenolod@atheme.org>
parents:
3873
diff
changeset
|
190 dbus_connection_set_exit_on_disconnect(local_conn, FALSE); |
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
|
191 } |
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
|
192 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
193 GValue *tuple_value_to_gvalue(Tuple *tuple, const gchar *key) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
194 GValue *val; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
195 TupleValueType type; |
3490
602ec8c40d0d
Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
3348
diff
changeset
|
196 type = tuple_get_value_type(tuple, -1, key); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
197 if (type == TUPLE_STRING) { |
4634
1e3d9707ae50
backout 4626. there was no relevance to the bug I was chasing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
4632
diff
changeset
|
198 gchar *result = g_strdup(tuple_get_string(tuple, -1, key)); |
3827
fd86a88426f4
dbus: ensure that only proper UTF8 is sent over the wire.
William Pitcock <nenolod@atheme.org>
parents:
3490
diff
changeset
|
199 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
200 val = g_new0(GValue, 1); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
201 g_value_init(val, G_TYPE_STRING); |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
202 g_value_take_string(val, result); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
203 return val; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
204 } else if (type == TUPLE_INT) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
205 val = g_new0(GValue, 1); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
206 g_value_init(val, G_TYPE_INT); |
3490
602ec8c40d0d
Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
3348
diff
changeset
|
207 g_value_set_int(val, tuple_get_int(tuple, -1, key)); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
208 return val; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
209 } |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
210 return NULL; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
211 } |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
212 |
4638
bbb873e9a35b
De-constify and remove an unused variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
4634
diff
changeset
|
213 static void tuple_insert_to_hash(GHashTable *md, Tuple *tuple, gchar *key) |
4631
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
214 { |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
215 GValue *value = tuple_value_to_gvalue(tuple, key); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
216 if (value != NULL) |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
217 g_hash_table_insert(md, key, value); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
218 } |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
219 |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
220 static void remove_metadata_value(gpointer value) |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
221 { |
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
222 g_value_unset((GValue*)value); |
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
223 g_free((GValue*)value); |
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
224 } |
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
225 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
226 GHashTable *mpris_metadata_from_tuple(Tuple *tuple) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
227 GHashTable *md = NULL; |
4823
732f392b887b
include track number in D-Bus-exported metadata (fixes http://bugs.debian.org/514426)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
4820
diff
changeset
|
228 gpointer value; |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
229 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
230 if (tuple == NULL) |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
231 return NULL; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
232 |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
233 md = g_hash_table_new_full(g_str_hash, g_str_equal, |
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
234 NULL, remove_metadata_value); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
235 |
4631
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
236 tuple_insert_to_hash(md, tuple, "length"); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
237 tuple_insert_to_hash(md, tuple, "title"); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
238 tuple_insert_to_hash(md, tuple, "artist"); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
239 tuple_insert_to_hash(md, tuple, "album"); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
240 tuple_insert_to_hash(md, tuple, "genre"); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
241 tuple_insert_to_hash(md, tuple, "codec"); |
6cda48638a58
Remove code repetition by using a function.
Matti Hamalainen <ccr@tnsp.org>
parents:
4630
diff
changeset
|
242 tuple_insert_to_hash(md, tuple, "quality"); |
3968
f1ed63913f1c
Add MPRIS codec and quality fields.
William Pitcock <nenolod@atheme.org>
parents:
3955
diff
changeset
|
243 |
4823
732f392b887b
include track number in D-Bus-exported metadata (fixes http://bugs.debian.org/514426)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
4820
diff
changeset
|
244 value = tuple_value_to_gvalue(tuple, "track-number"); |
732f392b887b
include track number in D-Bus-exported metadata (fixes http://bugs.debian.org/514426)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
4820
diff
changeset
|
245 if (value != NULL) |
732f392b887b
include track number in D-Bus-exported metadata (fixes http://bugs.debian.org/514426)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
4820
diff
changeset
|
246 { |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
247 g_hash_table_insert(md, "tracknumber", value); |
4823
732f392b887b
include track number in D-Bus-exported metadata (fixes http://bugs.debian.org/514426)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
4820
diff
changeset
|
248 } |
732f392b887b
include track number in D-Bus-exported metadata (fixes http://bugs.debian.org/514426)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
4820
diff
changeset
|
249 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
250 return md; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
251 } |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
252 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
253 /* MPRIS API */ |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
254 // MPRIS / |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
255 gboolean mpris_root_identity(MprisRoot *obj, gchar **identity, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
256 GError **error) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
257 *identity = g_strdup_printf("Audacious %s", VERSION); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
258 return TRUE; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
259 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
260 |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
261 // MPRIS /Player |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
262 gboolean mpris_player_next(MprisPlayer *obj, GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
263 playlist_next(playlist_get_active()); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
264 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
265 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
266 gboolean mpris_player_prev(MprisPlayer *obj, GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
267 playlist_prev(playlist_get_active()); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
268 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
269 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
270 gboolean mpris_player_pause(MprisPlayer *obj, GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
271 playback_pause(); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
272 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
273 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
274 gboolean mpris_player_stop(MprisPlayer *obj, GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
275 ip_data.stop = TRUE; |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
276 playback_stop(); |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
277 ip_data.stop = FALSE; |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
278 mainwin_clear_song_info(); |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
279 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
280 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
281 gboolean mpris_player_play(MprisPlayer *obj, GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
282 if (playback_get_paused()) |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
283 playback_pause(); |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
284 else if (playlist_get_length(playlist_get_active())) |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
285 playback_initiate(); |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
286 else |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
287 mainwin_eject_pushed(); |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
288 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
289 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
290 gboolean mpris_player_repeat(MprisPlayer *obj, gboolean rpt, GError **error) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
291 mainwin_repeat_pushed(rpt); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
292 mainwin_set_noplaylistadvance(rpt); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
293 return TRUE; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
294 } |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
295 gboolean mpris_player_quit(MprisPlayer *obj, GError **error) { |
4449
19e3f3c5fe7f
introduce function aud_quit(), which is basically mainwin_quit_cb(), but
mf0102 <0102@gmx.at>
parents:
4413
diff
changeset
|
296 aud_quit(); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
297 return TRUE; |
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
298 } |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
299 gboolean mpris_player_get_status(MprisPlayer *obj, gint *status, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
300 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
301 // check paused before playing because playback_get_playing() is true when |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
302 // paused as well as when playing |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
303 if (playback_get_paused()) |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
304 *status = MPRIS_STATUS_PAUSE; |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
305 else if (playback_get_playing()) |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
306 *status = MPRIS_STATUS_PLAY; |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
307 else |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
308 *status = MPRIS_STATUS_STOP; |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
309 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
310 } |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
311 gboolean mpris_player_get_metadata(MprisPlayer *obj, GHashTable **metadata, |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
312 GError **error) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
313 GHashTable *md = NULL; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
314 Tuple *tuple = NULL; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
315 GValue *value; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
316 Playlist *active; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
317 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
318 active = playlist_get_active(); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
319 gint pos = playlist_get_position(active); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
320 tuple = playlist_get_tuple(active, pos); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
321 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
322 md = mpris_metadata_from_tuple(tuple); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
323 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
324 if (md == NULL) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
325 // there's no metadata for this track |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
326 return TRUE; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
327 } |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
328 |
4770
fde0748bd6aa
MPRIS specification defines url to the media as location, not URI
Tomasz Mon <desowin@gmail.com>
parents:
4718
diff
changeset
|
329 // Song location |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
330 value = g_new0(GValue, 1); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
331 g_value_init(value, G_TYPE_STRING); |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
332 g_value_take_string(value, playlist_get_filename(active, pos)); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
333 |
4770
fde0748bd6aa
MPRIS specification defines url to the media as location, not URI
Tomasz Mon <desowin@gmail.com>
parents:
4718
diff
changeset
|
334 g_hash_table_insert(md, "location", value); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
335 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
336 *metadata = md; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
337 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
338 return TRUE; |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
339 } |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
340 gboolean mpris_player_get_caps(MprisPlayer *obj, gint *capabilities, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
341 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
342 *capabilities = MPRIS_CAPS_CAN_GO_NEXT | |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
343 MPRIS_CAPS_CAN_GO_PREV | |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
344 MPRIS_CAPS_CAN_PAUSE | |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
345 MPRIS_CAPS_CAN_PLAY | |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
346 MPRIS_CAPS_CAN_SEEK | |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
347 MPRIS_CAPS_CAN_PROVIDE_METADATA | |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
348 MPRIS_CAPS_PROVIDES_TIMING; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
349 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
350 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
351 gboolean mpris_player_volume_set(MprisPlayer *obj, gint vol, GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
352 gint vl, vr, v; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
353 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
354 // get the current volume so we can maintain the balance |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
355 input_get_volume(&vl, &vr); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
356 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
357 // sanity check |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
358 vl = CLAMP(vl, 0, 100); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
359 vr = CLAMP(vr, 0, 100); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
360 v = CLAMP(vol, 0, 100); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
361 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
362 if (vl > vr) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
363 input_set_volume(v, (gint) rint(((gdouble) vr / vl) * v)); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
364 } else if (vl < vr) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
365 input_set_volume((gint) rint(((gdouble) vl / vr) * v), v); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
366 } else { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
367 input_set_volume(v, v); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
368 } |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
369 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
370 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
371 gboolean mpris_player_volume_get(MprisPlayer *obj, gint *vol, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
372 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
373 gint vl, vr; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
374 input_get_volume(&vl, &vr); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
375 // vl and vr may be different depending on the balance; the true volume is |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
376 // the maximum of vl or vr. |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
377 *vol = MAX(vl, vr); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
378 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
379 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
380 gboolean mpris_player_position_set(MprisPlayer *obj, gint pos, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
381 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
382 gint time = CLAMP(pos / 1000, 0, |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
383 playlist_get_current_length(playlist_get_active()) / 1000 - 1); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
384 playback_seek(time); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
385 return TRUE; |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
386 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
387 gboolean mpris_player_position_get(MprisPlayer *obj, gint *pos, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
388 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
389 if (playback_get_playing()) |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
390 *pos = playback_get_time(); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
391 else |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
392 *pos = 0; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
393 return TRUE; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
394 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
395 // MPRIS /Player signals |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
396 gboolean mpris_emit_caps_change(MprisPlayer *obj) { |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
397 g_signal_emit(obj, signals[CAPS_CHANGE_SIG], 0, 0); |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
398 return TRUE; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
399 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
400 |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
401 gboolean mpris_emit_track_change(MprisPlayer *obj) { |
3827
fd86a88426f4
dbus: ensure that only proper UTF8 is sent over the wire.
William Pitcock <nenolod@atheme.org>
parents:
3490
diff
changeset
|
402 GHashTable *metadata; |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
403 Tuple *tuple = NULL; |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
404 GValue *value; |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
405 Playlist *active; |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
406 |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
407 active = playlist_get_active(); |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
408 gint pos = playlist_get_position(active); |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
409 tuple = playlist_get_tuple(active, pos); |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
410 |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
411 metadata = mpris_metadata_from_tuple(tuple); |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
412 |
3955
37963a32f627
Fix misleading assertion triggers (Debian #451214)
William Pitcock <nenolod@atheme.org>
parents:
3929
diff
changeset
|
413 if (!metadata) |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
414 metadata = g_hash_table_new_full(g_str_hash, g_str_equal, |
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
415 NULL, remove_metadata_value); |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
416 |
4770
fde0748bd6aa
MPRIS specification defines url to the media as location, not URI
Tomasz Mon <desowin@gmail.com>
parents:
4718
diff
changeset
|
417 // Song location |
3955
37963a32f627
Fix misleading assertion triggers (Debian #451214)
William Pitcock <nenolod@atheme.org>
parents:
3929
diff
changeset
|
418 value = g_new0(GValue, 1); |
37963a32f627
Fix misleading assertion triggers (Debian #451214)
William Pitcock <nenolod@atheme.org>
parents:
3929
diff
changeset
|
419 g_value_init(value, G_TYPE_STRING); |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
420 g_value_take_string(value, playlist_get_filename(active, pos)); |
3955
37963a32f627
Fix misleading assertion triggers (Debian #451214)
William Pitcock <nenolod@atheme.org>
parents:
3929
diff
changeset
|
421 |
4770
fde0748bd6aa
MPRIS specification defines url to the media as location, not URI
Tomasz Mon <desowin@gmail.com>
parents:
4718
diff
changeset
|
422 g_hash_table_insert(metadata, "location", value); |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
423 |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
424 g_signal_emit(obj, signals[TRACK_CHANGE_SIG], 0, metadata); |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
425 g_hash_table_destroy(metadata); |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
426 return TRUE; |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
427 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
428 |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
429 gboolean mpris_emit_status_change(MprisPlayer *obj, PlaybackStatus status) { |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3344
diff
changeset
|
430 g_signal_emit(obj, signals[STATUS_CHANGE_SIG], 0, status); |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
431 return TRUE; |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
432 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
433 |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
434 // MPRIS /TrackList |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
435 gboolean mpris_tracklist_get_metadata(MprisTrackList *obj, gint pos, |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
436 GHashTable **metadata, GError **error) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
437 GHashTable *md = NULL; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
438 Tuple *tuple = NULL; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
439 GValue *value; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
440 Playlist *active; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
441 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
442 active = playlist_get_active(); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
443 tuple = playlist_get_tuple(active, pos); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
444 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
445 md = mpris_metadata_from_tuple(tuple); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
446 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
447 if (md == NULL) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
448 // there's no metadata for this track |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
449 return TRUE; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
450 } |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
451 |
4770
fde0748bd6aa
MPRIS specification defines url to the media as location, not URI
Tomasz Mon <desowin@gmail.com>
parents:
4718
diff
changeset
|
452 // Song location |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
453 value = g_new0(GValue, 1); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
454 g_value_init(value, G_TYPE_STRING); |
4108
dfe5d686749e
Fixes memory leak in mpris_emit_track_change() (Bugzilla #37)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
3968
diff
changeset
|
455 g_value_take_string(value, playlist_get_filename(active, pos)); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
456 |
4770
fde0748bd6aa
MPRIS specification defines url to the media as location, not URI
Tomasz Mon <desowin@gmail.com>
parents:
4718
diff
changeset
|
457 g_hash_table_insert(md, "location", value); |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
458 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
459 *metadata = md; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
460 |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
461 return TRUE; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
462 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
463 gboolean mpris_tracklist_get_current_track(MprisTrackList *obj, gint *pos, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
464 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
465 *pos = playlist_get_position(playlist_get_active()); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
466 return TRUE; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
467 } |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
468 gboolean mpris_tracklist_get_length(MprisTrackList *obj, gint *length, |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
469 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
470 *length = playlist_get_length(playlist_get_active()); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
471 return TRUE; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
472 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
473 gboolean mpris_tracklist_add_track(MprisTrackList *obj, gchar *uri, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
474 gboolean play, GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
475 guint num_added; |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
476 num_added = playlist_add_url(playlist_get_active(), uri); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
477 if (play && num_added > 0) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
478 gint pos = playlist_get_length(playlist_get_active()) - 1; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
479 playlist_set_position(playlist_get_active(), pos); |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
480 playback_initiate(); |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
481 } |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
482 // TODO: set an error if num_added == 0 |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
483 return TRUE; |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
484 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
485 gboolean mpris_tracklist_del_track(MprisTrackList *obj, gint pos, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
486 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
487 playlist_delete_index(playlist_get_active(), pos); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
488 return TRUE; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
489 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
490 gboolean mpris_tracklist_loop(MprisTrackList *obj, gboolean loop, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
491 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
492 mainwin_repeat_pushed(loop); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
493 if (loop) { |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
494 mainwin_set_noplaylistadvance(FALSE); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
495 mainwin_set_stopaftersong(FALSE); |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
496 } |
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
497 return TRUE; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
498 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
499 gboolean mpris_tracklist_random(MprisTrackList *obj, gboolean random, |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
500 GError **error) { |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
501 mainwin_shuffle_pushed(random); |
3268
8af43e099cce
Added function prototypes for Disconnect and GetMetadata methods, and a prototype for the Disconnected signal.
Ben Tucker <ben.tucker@gmail.com>
parents:
3165
diff
changeset
|
502 return TRUE; |
2771
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
503 } |
4585019eb82e
[svn] -Renamed MPRIS /TrackList Shuffle method to Random
magma
parents:
2769
diff
changeset
|
504 |
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
|
505 // Audacious General Information |
3873
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
506 gboolean audacious_rc_version(RemoteObject *obj, gchar **version, GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
507 *version = g_strdup(VERSION); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
508 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
|
509 } |
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
|
510 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
511 gboolean audacious_rc_quit(RemoteObject *obj, GError **error) { |
4449
19e3f3c5fe7f
introduce function aud_quit(), which is basically mainwin_quit_cb(), but
mf0102 <0102@gmx.at>
parents:
4413
diff
changeset
|
512 aud_quit(); |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
513 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
514 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
515 |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
516 gboolean audacious_rc_eject(RemoteObject *obj, GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
517 drct_eject(); |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
518 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
519 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
520 |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
521 gboolean audacious_rc_main_win_visible(RemoteObject *obj, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
522 gboolean *is_main_win, GError **error) { |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
523 *is_main_win = cfg.player_visible; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
524 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
525 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
526 |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
527 gboolean audacious_rc_show_main_win(RemoteObject *obj, gboolean show, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
528 GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
529 drct_main_win_toggle(show); |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
530 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
531 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
532 |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
533 gboolean audacious_rc_equalizer_visible(RemoteObject *obj, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
534 gboolean *is_eq_win, GError **error) { |
2741 | 535 *is_eq_win = cfg.equalizer_visible; |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
536 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
537 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
538 |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
539 gboolean audacious_rc_show_equalizer(RemoteObject *obj, gboolean show, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
540 GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
541 drct_eq_win_toggle(show); |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
542 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
543 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
544 |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
545 gboolean audacious_rc_playlist_visible(RemoteObject *obj, gboolean *is_pl_win, |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
546 GError **error) { |
2741 | 547 *is_pl_win = cfg.playlist_visible; |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
548 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
549 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
550 |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
551 gboolean audacious_rc_show_playlist(RemoteObject *obj, gboolean show, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
552 GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
553 drct_pl_win_toggle(show); |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
554 return TRUE; |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
555 } |
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
556 |
4610
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
557 gboolean audacious_rc_get_tuple_fields(RemoteObject *obj, gchar ***fields, |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
558 GError **error) { |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
559 gchar **res = g_new0(gchar *, FIELD_LAST); |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
560 gint i; |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
561 for (i = 0; i < FIELD_LAST; i++) { |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
562 res[i] = g_strdup(tuple_fields[i].name); |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
563 } |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
564 *fields = res; |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
565 |
4610
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
566 return TRUE; |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
567 } |
c9b0da38d07d
Add a new dbus / remote interface function for getting available "standard" Tuple field names.
Matti Hamalainen <ccr@tnsp.org>
parents:
4605
diff
changeset
|
568 |
4604
51d82bf6ba63
Use a define (AUD_EQUALIZER_NBANDS) instead of magic value 10 everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
4577
diff
changeset
|
569 |
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
|
570 // Playback Information/Manipulation |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
571 gboolean audacious_rc_play(RemoteObject *obj, GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
572 if (playback_get_paused()) |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
573 playback_pause(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
574 else if (playlist_get_length(playlist_get_active())) |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
575 playback_initiate(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
576 else |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
577 mainwin_eject_pushed(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
578 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
|
579 } |
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
|
580 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
581 gboolean audacious_rc_pause(RemoteObject *obj, GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
582 playback_pause(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
583 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
|
584 } |
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
|
585 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
586 gboolean audacious_rc_stop(RemoteObject *obj, GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
587 ip_data.stop = TRUE; |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
588 playback_stop(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
589 ip_data.stop = FALSE; |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
590 mainwin_clear_song_info(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
591 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
|
592 } |
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
|
593 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
594 gboolean audacious_rc_playing(RemoteObject *obj, gboolean *is_playing, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
595 GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
596 *is_playing = playback_get_playing(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
597 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
|
598 } |
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
|
599 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
600 gboolean audacious_rc_paused(RemoteObject *obj, gboolean *is_paused, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
601 GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
602 *is_paused = playback_get_paused(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
603 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
|
604 } |
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
|
605 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
606 gboolean audacious_rc_stopped(RemoteObject *obj, gboolean *is_stopped, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
607 GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
608 *is_stopped = !playback_get_playing(); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
609 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
|
610 } |
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
|
611 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
612 gboolean audacious_rc_status(RemoteObject *obj, gchar **status, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
613 GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
614 if (playback_get_paused()) |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
615 *status = g_strdup("paused"); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
616 else if (playback_get_playing()) |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
617 *status = g_strdup("playing"); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
618 else |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
619 *status = g_strdup("stopped"); |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
620 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
|
621 } |
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
|
622 |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
623 gboolean audacious_rc_info(RemoteObject *obj, gint *rate, gint *freq, |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
624 gint *nch, GError **error) { |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
625 playback_get_sample_params(rate, freq, nch); |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
626 return TRUE; |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
627 } |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
628 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
629 gboolean audacious_rc_time(RemoteObject *obj, gint *time, GError **error) { |
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
|
630 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
|
631 *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
|
632 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
|
633 *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
|
634 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
|
635 } |
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
|
636 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
637 gboolean audacious_rc_seek(RemoteObject *obj, guint pos, GError **error) { |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
638 if (playlist_get_current_length(playlist_get_active()) > 0 && |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
639 pos < (guint)playlist_get_current_length(playlist_get_active())) |
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
640 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
|
641 |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
642 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
|
643 } |
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
|
644 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
645 gboolean audacious_rc_volume(RemoteObject *obj, gint *vl, gint *vr, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
646 GError **error) { |
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
|
647 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
|
648 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
|
649 } |
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
|
650 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
651 gboolean audacious_rc_set_volume(RemoteObject *obj, gint vl, gint vr, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
652 GError **error) { |
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
|
653 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
|
654 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
|
655 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
|
656 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
|
657 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
|
658 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
|
659 } |
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
|
660 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
661 gboolean audacious_rc_balance(RemoteObject *obj, gint *balance, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
662 GError **error) { |
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
|
663 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
|
664 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
|
665 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
|
666 *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
|
667 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
|
668 *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
|
669 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
|
670 *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
|
671 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
|
672 *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
|
673 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
|
674 } |
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
|
675 |
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
|
676 // Playlist Information/Manipulation |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
677 gboolean audacious_rc_position(RemoteObject *obj, gint *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
|
678 *pos = playlist_get_position(playlist_get_active()); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
679 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
|
680 } |
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
|
681 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
682 gboolean audacious_rc_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
|
683 playlist_next(playlist_get_active()); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
684 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
|
685 } |
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
|
686 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
687 gboolean audacious_rc_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
|
688 playlist_prev(playlist_get_active()); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
689 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
|
690 } |
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
|
691 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
692 gboolean audacious_rc_length(RemoteObject *obj, gint *length, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
693 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
|
694 *length = playlist_get_length(playlist_get_active()); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
695 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
|
696 } |
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
|
697 |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
698 gboolean audacious_rc_song_title(RemoteObject *obj, guint pos, |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
699 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
|
700 *title = playlist_get_songtitle(playlist_get_active(), pos); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
701 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
|
702 } |
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
|
703 |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
704 gboolean audacious_rc_song_filename(RemoteObject *obj, guint pos, |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
705 gchar **filename, GError **error) { |
4634
1e3d9707ae50
backout 4626. there was no relevance to the bug I was chasing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
4632
diff
changeset
|
706 *filename = playlist_get_filename(playlist_get_active(), pos); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
707 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
|
708 } |
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
|
709 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
710 gboolean audacious_rc_song_length(RemoteObject *obj, guint pos, gint *length, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
711 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
|
712 *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
|
713 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
|
714 } |
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
|
715 |
3344
c03055ef8822
-Implemented /Player GetStatus, GetMetadata, GetCaps, PositionGet, PositionSet, VolumeGet, and VolumeSet
Ben Tucker <ben.tucker@gmail.com>
parents:
3336
diff
changeset
|
716 gboolean audacious_rc_song_frames(RemoteObject *obj, guint pos, gint *length, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
717 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
|
718 *length = playlist_get_songtime(playlist_get_active(), pos); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
719 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
|
720 } |
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
|
721 |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
722 gboolean audacious_rc_song_tuple(RemoteObject *obj, guint pos, gchar *field, |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
723 GValue *value, GError **error) { |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
724 Tuple *tuple; |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
725 tuple = playlist_get_tuple(playlist_get_active(), pos); |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
726 if (!tuple) { |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
727 return FALSE; |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
728 } else { |
3490
602ec8c40d0d
Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
3348
diff
changeset
|
729 TupleValueType type = tuple_get_value_type(tuple, -1, field); |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
730 |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
731 switch(type) |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
732 { |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
733 case TUPLE_STRING: |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
734 g_value_init(value, G_TYPE_STRING); |
3490
602ec8c40d0d
Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
3348
diff
changeset
|
735 g_value_set_string(value, tuple_get_string(tuple, -1, field)); |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
736 break; |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
737 case TUPLE_INT: |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
738 g_value_init(value, G_TYPE_INT); |
3490
602ec8c40d0d
Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
3348
diff
changeset
|
739 g_value_set_int(value, tuple_get_int(tuple, -1, field)); |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
740 break; |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
741 default: |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
742 return FALSE; |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3268
diff
changeset
|
743 break; |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
744 } |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
745 } |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
746 return TRUE; |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
747 } |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
748 |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
749 gboolean audacious_rc_jump(RemoteObject *obj, guint 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
|
750 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
|
751 playlist_set_position(playlist_get_active(), pos); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
752 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
|
753 } |
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
|
754 |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
755 gboolean audacious_rc_add(RemoteObject *obj, gchar *file, GError **error) { |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
756 playlist_add_url(playlist_get_active(), file); |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
757 return TRUE; |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
758 } |
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
759 gboolean audacious_rc_add_url(RemoteObject *obj, gchar *url, 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
|
760 playlist_add_url(playlist_get_active(), url); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
761 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
|
762 } |
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
|
763 |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
764 gboolean audacious_rc_delete(RemoteObject *obj, guint 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
|
765 playlist_delete_index(playlist_get_active(), pos); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
766 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
|
767 } |
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
|
768 |
2733
cf080b11c3fa
[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.
magma
parents:
2728
diff
changeset
|
769 gboolean audacious_rc_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
|
770 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
|
771 mainwin_clear_song_info(); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
772 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
|
773 } |
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
|
774 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
775 gboolean audacious_rc_auto_advance(RemoteObject *obj, gboolean *is_advance, |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
776 GError **error) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
777 *is_advance = cfg.no_playlist_advance; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
778 return TRUE; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
779 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
780 |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
781 gboolean audacious_rc_toggle_auto_advance(RemoteObject *obj, GError **error) { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
782 cfg.no_playlist_advance = !cfg.no_playlist_advance; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
783 return TRUE; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
784 } |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
785 |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
786 gboolean audacious_rc_repeat(RemoteObject *obj, gboolean *is_repeating, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
787 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
|
788 *is_repeating = cfg.repeat; |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
789 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
|
790 } |
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
|
791 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
792 gboolean audacious_rc_toggle_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
|
793 mainwin_repeat_pushed(!cfg.repeat); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
794 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
|
795 } |
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
|
796 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
797 gboolean audacious_rc_shuffle(RemoteObject *obj, gboolean *is_shuffling, |
2766
ea20b1e92411
[svn] Added CMD_GET_INFO and CMD_PLAYLIST_GET_TUPLE_DATA replacements; Changed some formatting and used unsigned numbers where appropriate.
magma
parents:
2741
diff
changeset
|
798 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
|
799 *is_shuffling = cfg.shuffle; |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
800 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
|
801 } |
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
|
802 |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2766
diff
changeset
|
803 gboolean audacious_rc_toggle_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
|
804 mainwin_shuffle_pushed(!cfg.shuffle); |
2695
4c4c8b294287
[svn] Fixed formatting. Tabs + tw=2 ==> spaces + tw=4.
magma
parents:
2694
diff
changeset
|
805 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
|
806 } |
2785 | 807 |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
808 /* New on Oct 5 */ |
3917 | 809 gboolean audacious_rc_show_prefs_box(RemoteObject *obj, gboolean show, GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
810 hook_call("prefswin show", &show); |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
811 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
812 } |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
813 |
3917 | 814 gboolean audacious_rc_show_about_box(RemoteObject *obj, gboolean show, GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
815 hook_call("aboutwin show", &show); |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
816 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
817 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
818 |
3917 | 819 gboolean audacious_rc_show_jtf_box(RemoteObject *obj, gboolean show, GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
820 hook_call("ui jump to track show", &show); |
3917 | 821 return TRUE; |
822 } | |
823 | |
824 gboolean audacious_rc_show_filebrowser(RemoteObject *obj, gboolean show, GError **error) | |
825 { | |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
826 gboolean play_button = FALSE; |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
827 if (show) |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
828 hook_call("filebrowser show", &play_button); |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
829 else |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
830 hook_call("filebrowser hide", NULL); |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
831 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
832 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
833 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
834 gboolean audacious_rc_play_pause(RemoteObject *obj, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
835 if (playback_get_playing()) |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
836 playback_pause(); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
837 else |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
838 playback_initiate(); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
839 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
840 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
841 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
842 gboolean audacious_rc_activate(RemoteObject *obj, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
843 gtk_window_present(GTK_WINDOW(mainwin)); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
844 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
845 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
846 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
847 gboolean audacious_rc_get_info(RemoteObject *obj, gint *rate, gint *freq, gint *nch, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
848 playback_get_sample_params(rate, freq, nch); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
849 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
850 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
851 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
852 gboolean audacious_rc_toggle_aot(RemoteObject *obj, gboolean ontop, GError **error) { |
4544
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4518
diff
changeset
|
853 hook_call("mainwin set always on top", &ontop); |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
854 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
855 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
856 |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
857 /* New on Oct 9: Queue */ |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
858 gboolean audacious_rc_playqueue_add(RemoteObject *obj, gint pos, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
859 if (pos < (guint)playlist_get_length(playlist_get_active())) |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
860 playlist_queue_position(playlist_get_active(), pos); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
861 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
862 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
863 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
864 gboolean audacious_rc_playqueue_remove(RemoteObject *obj, gint pos, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
865 if (pos < (guint)playlist_get_length(playlist_get_active())) |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
866 playlist_queue_remove(playlist_get_active(), pos); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
867 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
868 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
869 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
870 gboolean audacious_rc_playqueue_clear(RemoteObject *obj, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
871 playlist_clear_queue(playlist_get_active()); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
872 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
873 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
874 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
875 gboolean audacious_rc_get_playqueue_length(RemoteObject *obj, gint *length, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
876 *length = playlist_queue_get_length(playlist_get_active()); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
877 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
878 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
879 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
880 gboolean audacious_rc_queue_get_list_pos(RemoteObject *obj, gint qpos, gint *pos, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
881 if (playback_get_playing()) |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
882 *pos = playlist_get_queue_qposition_number(playlist_get_active(), qpos); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
883 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
884 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
885 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
886 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
887 gboolean audacious_rc_queue_get_queue_pos(RemoteObject *obj, gint pos, gint *qpos, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
888 if (playback_get_playing()) |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
889 *qpos = playlist_get_queue_position_number(playlist_get_active(), pos); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
890 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
891 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
892 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
893 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
894 gboolean audacious_rc_playqueue_is_queued(RemoteObject *obj, gint pos, gboolean *is_queued, GError **error) { |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
895 *is_queued = playlist_is_position_queued(playlist_get_active(), pos); |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
896 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
897 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
898 |
3873
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
899 gboolean audacious_rc_playlist_ins_url_string(RemoteObject *obj, gchar *url, gint pos, GError **error) { |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
900 if (pos >= 0 && url && strlen(url)) { |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
901 playlist_ins_url(playlist_get_active(), url, pos); |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
902 } |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
903 return TRUE; |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
904 } |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
905 |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
906 gboolean audacious_rc_playlist_add(RemoteObject *obj, gpointer list, GError **error) { |
4518
f2271d78e07e
Handling of remote DBus PlaylistAdd method was incorrect, causing a segfault. Dbus marshaller
Matti Hamalainen <ccr@tnsp.org>
parents:
4508
diff
changeset
|
907 return playlist_add_url(playlist_get_active(), (gchar *) list) > 0; |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
908 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
909 |
3873
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
910 gboolean audacious_rc_playlist_enqueue_to_temp(RemoteObject *obj, gchar *url, GError **error) { |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
911 Playlist *new_pl = playlist_new(); |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
912 gchar *pl_name = NULL; |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
913 |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
914 pl_name = (gchar*)playlist_get_current_name(new_pl); |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
915 playlist_set_current_name (new_pl, pl_name ? pl_name : "New Playlist"); |
3873
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
916 |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
917 playlist_add_playlist(new_pl); |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
918 |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
919 // DISABLE_MANAGER_UPDATE(); |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
920 playlist_select_playlist(new_pl); |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
921 // ENABLE_MANAGER_UPDATE(); |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
922 |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
923 playlist_add_url(new_pl, url); |
f3341c2d6b9e
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3867
diff
changeset
|
924 |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
925 return TRUE; |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
926 } |
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
927 |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
928 /* New on Nov 7: Equalizer */ |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
929 gboolean audacious_rc_get_eq(RemoteObject *obj, gdouble *preamp, GArray **bands, GError **error) |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
930 { |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
931 int i; |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
932 |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
933 *preamp = (gdouble)equalizer_get_preamp(); |
4604
51d82bf6ba63
Use a define (AUD_EQUALIZER_NBANDS) instead of magic value 10 everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
4577
diff
changeset
|
934 *bands = g_array_sized_new(FALSE, FALSE, sizeof(gdouble), AUD_EQUALIZER_NBANDS); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
935 |
4604
51d82bf6ba63
Use a define (AUD_EQUALIZER_NBANDS) instead of magic value 10 everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
4577
diff
changeset
|
936 for(i=0; i < AUD_EQUALIZER_NBANDS; i++){ |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
937 gdouble val = (gdouble)equalizer_get_band(i); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
938 g_array_append_val(*bands, val); |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
939 } |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
940 |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
941 return TRUE; |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
942 } |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
943 |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
944 gboolean audacious_rc_get_eq_preamp(RemoteObject *obj, gdouble *preamp, GError **error) |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
945 { |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
946 *preamp = (gdouble)equalizer_get_preamp(); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
947 return TRUE; |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
948 } |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
949 |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
950 gboolean audacious_rc_get_eq_band(RemoteObject *obj, gint band, gdouble *value, GError **error) |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
951 { |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
952 *value = (gdouble)equalizer_get_band(band); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
953 return TRUE; |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
954 } |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
955 |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
956 gboolean audacious_rc_set_eq(RemoteObject *obj, gdouble preamp, GArray *bands, GError **error) |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
957 { |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
958 gdouble element; |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
959 int i; |
4870
56af01cd5a5c
Eliminate a double free (bug #30)
John Lindgren <john.lindgren@tds.net>
parents:
4858
diff
changeset
|
960 |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
961 equalizer_set_preamp((gfloat)preamp); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
962 |
4604
51d82bf6ba63
Use a define (AUD_EQUALIZER_NBANDS) instead of magic value 10 everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
4577
diff
changeset
|
963 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) { |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
964 element = g_array_index(bands, gdouble, i); |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
965 equalizer_set_band(i, (gfloat)element); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
966 } |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
967 |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
968 return TRUE; |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
969 } |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
970 |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
971 gboolean audacious_rc_set_eq_preamp(RemoteObject *obj, gdouble preamp, GError **error) |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
972 { |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
973 equalizer_set_preamp((gfloat)preamp); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
974 return TRUE; |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
975 } |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
976 |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
977 gboolean audacious_rc_set_eq_band(RemoteObject *obj, gint band, gdouble value, GError **error) |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
978 { |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4705
diff
changeset
|
979 equalizer_set_band(band, (gfloat)value); |
3915
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
980 return TRUE; |
86c9abc83fbd
audacious remote functions:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3888
diff
changeset
|
981 } |
3867
e48f2f4c116d
- many remained audacious remote functions have been implemented.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3827
diff
changeset
|
982 |
3917 | 983 gboolean audacious_rc_equalizer_activate(RemoteObject *obj, gboolean active, GError **error) |
984 { | |
4718 | 985 equalizer_set_active(active); |
3917 | 986 return TRUE; |
987 } | |
988 | |
989 | |
2785 | 990 DBusGProxy *audacious_get_dbus_proxy(void) |
991 { | |
992 DBusGConnection *connection = NULL; | |
993 GError *error = NULL; | |
994 connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); | |
995 g_clear_error(&error); | |
996 return dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE, | |
997 AUDACIOUS_DBUS_PATH, | |
998 AUDACIOUS_DBUS_INTERFACE); | |
999 } |