Mercurial > audlegacy
annotate src/libaudclient/audctrl.c @ 2713:8f7da5257692 trunk
[svn] - rename to libaudclient
- enforce libaudclient.so.1
| author | nenolod |
|---|---|
| date | Wed, 09 May 2007 14:40:01 -0700 |
| parents | src/libaudaciousng/audctrl.c@c35913222440 |
| children | f4a5f8fa3836 |
| rev | line source |
|---|---|
|
2711
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
1 /* |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
2 * Audacious: A cross-platform multimedia player |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
3 * Copyright (c) 2007 Ben Tucker |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
4 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
7 * the Free Software Foundation; under version 2 of the License. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
8 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
13 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
15 * along with this program; if not, write to the Free Software |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
17 * 02110-1301, USA. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
18 */ |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
19 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
20 #ifdef HAVE_CONFIG_H |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
21 # include "config.h" |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
22 #endif |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
23 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
24 #include <stdlib.h> |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
25 #include <glib.h> |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
26 #include <dbus/dbus-glib.h> |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
27 #include "audacious/dbus.h" |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
28 #include "audacious/dbus-client-bindings.h" |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
29 #include "audctrl.h" |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
30 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
31 GError *error = NULL; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
32 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
33 void audacious_remote_playlist(DBusGProxy *proxy, gchar **list, gint num, |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
34 gboolean enqueue) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
35 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
36 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
37 gint audacious_remote_get_version(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
38 return 0; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
39 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
40 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
41 void audacious_remote_playlist_add(DBusGProxy *proxy, GList *list) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
42 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
43 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
44 void audacious_remote_playlist_delete(DBusGProxy *proxy, gint pos) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
45 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
46 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
47 void audacious_remote_play(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
48 org_atheme_audacious_playback_play(proxy, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
49 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
50 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
51 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
52 void audacious_remote_pause(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
53 org_atheme_audacious_playback_pause(proxy, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
54 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
55 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
56 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
57 void audacious_remote_stop(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
58 org_atheme_audacious_playback_stop(proxy, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
59 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
60 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
61 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
62 gboolean audacious_remote_is_playing(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
63 gboolean is_playing; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
64 org_atheme_audacious_playback_playing(proxy, &is_playing, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
65 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
66 return is_playing; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
67 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
68 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
69 gboolean audacious_remote_is_paused(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
70 gboolean is_paused; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
71 org_atheme_audacious_playback_paused(proxy, &is_paused, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
72 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
73 return is_paused; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
74 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
75 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
76 gint audacious_remote_get_playlist_pos(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
77 gint pos; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
78 org_atheme_audacious_playlist_position(proxy, &pos, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
79 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
80 return pos; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
81 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
82 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
83 void audacious_remote_set_playlist_pos(DBusGProxy *proxy, gint pos) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
84 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
85 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
86 gint audacious_remote_get_playlist_length(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
87 gint len; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
88 org_atheme_audacious_playlist_length(proxy, &len, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
89 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
90 return len; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
91 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
92 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
93 void audacious_remote_playlist_clear(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
94 org_atheme_audacious_playlist_clear(proxy, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
95 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
96 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
97 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
98 gint audacious_remote_get_output_time(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
99 gint time; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
100 org_atheme_audacious_playback_time(proxy, &time, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
101 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
102 return time; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
103 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
104 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
105 void audacious_remote_jump_to_time(DBusGProxy *proxy, gint pos) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
106 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
107 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
108 /** |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
109 * audacious_remote_get_volume: |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
110 * @proxy: DBus proxy for audacious |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
111 * @vl: Pointer to integer containing the left channel's volume. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
112 * @vr: Pointer to integer containing the right channel's volume. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
113 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
114 * Queries audacious about the current volume. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
115 **/ |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
116 void audacious_remote_get_volume(DBusGProxy *proxy, gint * vl, gint * vr) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
117 org_atheme_audacious_playback_volume(proxy, vl, vr, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
118 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
119 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
120 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
121 /** |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
122 * audacious_remote_get_main_volume: |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
123 * @proxy: DBus proxy for audacious |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
124 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
125 * Queries audacious about the current volume. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
126 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
127 * Return value: The current volume. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
128 **/ |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
129 gint audacious_remote_get_main_volume(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
130 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:
diff
changeset
|
131 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
132 audacious_remote_get_volume(proxy, &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:
diff
changeset
|
133 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
134 return (vl > vr) ? 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:
diff
changeset
|
135 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
136 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
137 /** |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
138 * audacious_remote_set_volume: |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
139 * @proxy: DBus proxy for audacious |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
140 * @vl: The volume for the left channel. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
141 * @vr: The volume for the right channel. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
142 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
143 * Sets the volume for the left and right channels in Audacious. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
144 **/ |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
145 void audacious_remote_set_volume(DBusGProxy *proxy, gint vl, gint vr) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
146 org_atheme_audacious_playback_set_volume(proxy, vl, vr, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
147 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
148 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
149 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
150 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
151 /** |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
152 * audacious_remote_set_main_volume: |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
153 * @proxy: DBus proxy for audacious |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
154 * @v: The volume to set. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
155 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
156 * Sets the volume in Audacious. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
157 **/ |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
158 void audacious_remote_set_main_volume(DBusGProxy *proxy, gint v) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
159 gint b, 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:
diff
changeset
|
160 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
161 b = audacious_remote_get_balance(proxy); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
162 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
163 if (b < 0) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
164 vl = v; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
165 vr = (v * (100 - abs(b))) / 100; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
166 } else if (b > 0) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
167 vl = (v * (100 - b)) / 100; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
168 vr = v; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
169 } else |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
170 vl = vr = v; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
171 audacious_remote_set_volume(proxy, 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:
diff
changeset
|
172 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
173 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
174 /** |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
175 * audacious_remote_get_balance: |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
176 * @proxy: DBus proxy for audacious |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
177 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
178 * Queries audacious about the current balance. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
179 * |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
180 * Return value: The current balance. |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
181 **/ |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
182 gint audacious_remote_get_balance(DBusGProxy *proxy) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
183 gint balance; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
184 org_atheme_audacious_playback_balance(proxy, &balance, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
185 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
186 return balance; |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
187 } |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
188 |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
189 void audacious_remote_playlist_add_url_string(DBusGProxy *proxy, |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
190 gchar *string) { |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
191 org_atheme_audacious_playlist_add_url(proxy, string, &error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
192 g_error_free(error); |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
diff
changeset
|
193 } |
