Mercurial > audlegacy
comparison src/audlegacy/dbus-service.h @ 4811:7bf7f83a217e
rename src/audacious src/audlegacy so that both audlegacy and audacious can coexist.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 26 Nov 2008 00:44:56 +0900 |
parents | src/audacious/dbus-service.h@736e981747d8 |
children |
comparison
equal
deleted
inserted
replaced
4810:c10e53092037 | 4811:7bf7f83a217e |
---|---|
1 /* | |
2 * Audacious: A cross-platform multimedia player | |
3 * Copyright (c) 2007 Ben Tucker | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
7 * the Free Software Foundation; under version 3 of the License. | |
8 * | |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with this program. If not, see <http://www.gnu.org/licenses>. | |
16 * | |
17 * The Audacious team does not consider modular code linking to | |
18 * Audacious or using our public API to be a derived work. | |
19 */ | |
20 | |
21 #ifndef AUDACIOUS_DBUS_SERVICE_H | |
22 #define AUDACIOUS_DBUS_SERVICE_H | |
23 | |
24 #include <glib.h> | |
25 | |
26 #define DBUS_API_SUBJECT_TO_CHANGE | |
27 #include <dbus/dbus-glib.h> | |
28 | |
29 typedef struct { | |
30 GObject parent; | |
31 DBusGProxy *proxy; | |
32 } RemoteObject, MprisRoot, MprisPlayer, MprisTrackList; | |
33 | |
34 typedef struct { | |
35 GObjectClass parent_class; | |
36 } RemoteObjectClass, MprisRootClass, MprisPlayerClass, MprisTrackListClass; | |
37 | |
38 void init_dbus(); | |
39 void free_dbus(); | |
40 DBusGProxy *audacious_get_dbus_proxy(); | |
41 | |
42 /* MPRIS API */ | |
43 // Capabilities | |
44 enum { | |
45 MPRIS_CAPS_NONE = 0, | |
46 MPRIS_CAPS_CAN_GO_NEXT = 1 << 0, | |
47 MPRIS_CAPS_CAN_GO_PREV = 1 << 1, | |
48 MPRIS_CAPS_CAN_PAUSE = 1 << 2, | |
49 MPRIS_CAPS_CAN_PLAY = 1 << 3, | |
50 MPRIS_CAPS_CAN_SEEK = 1 << 4, | |
51 MPRIS_CAPS_CAN_PROVIDE_METADATA = 1 << 5, | |
52 MPRIS_CAPS_PROVIDES_TIMING = 1 << 6, | |
53 }; | |
54 | |
55 // Status | |
56 typedef enum { | |
57 MPRIS_STATUS_PLAY = 0, | |
58 MPRIS_STATUS_PAUSE, | |
59 MPRIS_STATUS_STOP | |
60 } PlaybackStatus; | |
61 | |
62 // MPRIS / | |
63 gboolean mpris_root_identity(MprisRoot *obj, gchar **identity, | |
64 GError **error); | |
65 // MPRIS /Player | |
66 gboolean mpris_player_next(MprisPlayer *obj, GError **error); | |
67 gboolean mpris_player_prev(MprisPlayer *obj, GError **error); | |
68 gboolean mpris_player_pause(MprisPlayer *obj, GError **error); | |
69 gboolean mpris_player_stop(MprisPlayer *obj, GError **error); | |
70 gboolean mpris_player_play(MprisPlayer *obj, GError **error); | |
71 gboolean mpris_player_repeat(MprisPlayer *obj, gboolean rpt, GError **error); | |
72 gboolean mpris_player_quit(MprisPlayer *obj, GError **error); | |
73 gboolean mpris_player_get_status(MprisPlayer *obj, gint *status, | |
74 GError **error); | |
75 gboolean mpris_player_get_metadata(MprisPlayer *obj, GHashTable **metadata, | |
76 GError **error); | |
77 gboolean mpris_player_get_caps(MprisPlayer *obj, gint *capabilities, | |
78 GError **error); | |
79 gboolean mpris_player_volume_set(MprisPlayer *obj, gint vol, GError **error); | |
80 gboolean mpris_player_volume_get(MprisPlayer *obj, gint *vol, | |
81 GError **error); | |
82 gboolean mpris_player_position_set(MprisPlayer *obj, gint pos, GError **error); | |
83 gboolean mpris_player_position_get(MprisPlayer *obj, gint *pos, | |
84 GError **error); | |
85 enum { | |
86 TRACK_CHANGE_SIG, | |
87 STATUS_CHANGE_SIG, | |
88 CAPS_CHANGE_SIG, | |
89 LAST_SIG | |
90 }; | |
91 | |
92 gboolean mpris_emit_track_change(MprisPlayer *obj); | |
93 gboolean mpris_emit_status_change(MprisPlayer *obj, PlaybackStatus status); | |
94 gboolean mpris_emit_caps_change(MprisPlayer *obj); | |
95 | |
96 // MPRIS /TrackList | |
97 gboolean mpris_tracklist_get_metadata(MprisTrackList *obj, gint pos, | |
98 GHashTable **metadata, GError **error); | |
99 gboolean mpris_tracklist_get_current_track(MprisTrackList *obj, gint *pos, | |
100 GError **error); | |
101 gboolean mpris_tracklist_get_length(MprisTrackList *obj, gint *length, | |
102 GError **error); | |
103 gboolean mpris_tracklist_add_track(MprisTrackList *obj, gchar *uri, | |
104 gboolean play, GError **error); | |
105 gboolean mpris_tracklist_del_track(MprisTrackList *obj, gint pos, | |
106 GError **error); | |
107 gboolean mpris_tracklist_loop(MprisTrackList *obj, gboolean loop, | |
108 GError **error); | |
109 gboolean mpris_tracklist_random(MprisTrackList *obj, gboolean random, | |
110 GError **error); | |
111 | |
112 /* Legacy API */ | |
113 // Audacious General Information | |
114 gboolean audacious_rc_version(RemoteObject *obj, gchar **version, GError **error); | |
115 gboolean audacious_rc_quit(RemoteObject *obj, GError **error); | |
116 gboolean audacious_rc_eject(RemoteObject *obj, GError **error); | |
117 gboolean audacious_rc_main_win_visible(RemoteObject *obj, | |
118 gboolean *is_main_win, GError **error); | |
119 gboolean audacious_rc_show_main_win(RemoteObject *obj, gboolean show, | |
120 GError **error); | |
121 gboolean audacious_rc_equalizer_visible(RemoteObject *obj, gboolean *is_eq_win, | |
122 GError **error); | |
123 gboolean audacious_rc_show_equalizer(RemoteObject *obj, gboolean show, | |
124 GError **error); | |
125 gboolean audacious_rc_playlist_visible(RemoteObject *obj, | |
126 gboolean *is_pl_win, | |
127 GError **error); | |
128 gboolean audacious_rc_show_playlist(RemoteObject *obj, gboolean show, | |
129 GError **error); | |
130 gboolean audacious_rc_get_tuple_fields(RemoteObject *obj, gchar ***fields, | |
131 GError **error); | |
132 | |
133 // Playback Information/Manipulation | |
134 gboolean audacious_rc_play(RemoteObject *obj, GError **error); | |
135 gboolean audacious_rc_pause(RemoteObject *obj, GError **error); | |
136 gboolean audacious_rc_stop(RemoteObject *obj, GError **error); | |
137 gboolean audacious_rc_playing(RemoteObject *obj, gboolean *is_playing, | |
138 GError **error); | |
139 gboolean audacious_rc_paused(RemoteObject *obj, gboolean *is_paused, | |
140 GError **error); | |
141 gboolean audacious_rc_stopped(RemoteObject *obj, gboolean *is_stopped, | |
142 GError **error); | |
143 gboolean audacious_rc_status(RemoteObject *obj, gchar **status, | |
144 GError **error); | |
145 gboolean audacious_rc_info(RemoteObject *obj, gint *rate, gint *freq, | |
146 gint *nch, GError **error); | |
147 gboolean audacious_rc_time(RemoteObject *obj, gint *time, GError **error); | |
148 gboolean audacious_rc_seek(RemoteObject *obj, guint pos, GError **error); | |
149 gboolean audacious_rc_volume(RemoteObject *obj, gint *vl, gint *vr, | |
150 GError **error); | |
151 gboolean audacious_rc_set_volume(RemoteObject *obj, gint vl, gint vr, | |
152 GError **error); | |
153 gboolean audacious_rc_balance(RemoteObject *obj, gint *balance, | |
154 GError **error); | |
155 | |
156 // Playlist Information/Manipulation | |
157 gboolean audacious_rc_position(RemoteObject *obj, int *pos, GError **error); | |
158 gboolean audacious_rc_advance(RemoteObject *obj, GError **error); | |
159 gboolean audacious_rc_reverse(RemoteObject *obj, GError **error); | |
160 gboolean audacious_rc_length(RemoteObject *obj, int *length, | |
161 GError **error); | |
162 gboolean audacious_rc_song_title(RemoteObject *obj, guint pos, | |
163 gchar **title, GError **error); | |
164 gboolean audacious_rc_song_filename(RemoteObject *obj, guint pos, | |
165 gchar **filename, GError **error); | |
166 gboolean audacious_rc_song_length(RemoteObject *obj, guint pos, int *length, | |
167 GError **error); | |
168 gboolean audacious_rc_song_frames(RemoteObject *obj, guint pos, int *length, | |
169 GError **error); | |
170 gboolean audacious_rc_song_tuple(RemoteObject *obj, guint pos, gchar *tuple, | |
171 GValue *value, GError **error); | |
172 gboolean audacious_rc_jump(RemoteObject *obj, guint pos, GError **error); | |
173 gboolean audacious_rc_add(RemoteObject *obj, gchar *file, GError **error); | |
174 gboolean audacious_rc_add_url(RemoteObject *obj, gchar *url, | |
175 GError **error); | |
176 gboolean audacious_rc_delete(RemoteObject *obj, guint pos, GError **error); | |
177 gboolean audacious_rc_clear(RemoteObject *obj, GError **error); | |
178 gboolean audacious_rc_auto_advance(RemoteObject *obj, gboolean *is_advance, | |
179 GError **error); | |
180 gboolean audacious_rc_toggle_auto_advance(RemoteObject *obj, GError **error); | |
181 gboolean audacious_rc_repeat(RemoteObject *obj, gboolean *is_repeat, | |
182 GError **error); | |
183 gboolean audacious_rc_toggle_repeat(RemoteObject *obj, GError **error); | |
184 gboolean audacious_rc_shuffle(RemoteObject *obj, gboolean *is_shuffle, | |
185 GError **error); | |
186 gboolean audacious_rc_toggle_shuffle(RemoteObject *obj, GError **error); | |
187 | |
188 /* new */ | |
189 gboolean audacious_rc_show_prefs_box(RemoteObject *obj, gboolean show, GError **error); | |
190 gboolean audacious_rc_show_about_box(RemoteObject *obj, gboolean show, GError **error); | |
191 gboolean audacious_rc_show_jtf_box(RemoteObject *obj, gboolean show, GError **error); | |
192 gboolean audacious_rc_show_filebrowser(RemoteObject *obj, gboolean show, GError **error); //new Nov 8 | |
193 gboolean audacious_rc_play_pause(RemoteObject *obj, GError **error); | |
194 gboolean audacious_rc_activate(RemoteObject *obj, GError **error); | |
195 gboolean audacious_rc_queue_get_list_pos(RemoteObject *obj, gint qpos, gint *pos, GError **error); | |
196 gboolean audacious_rc_queue_get_queue_pos(RemoteObject *obj, gint pos, gint *qpos, GError **error); | |
197 gboolean audacious_rc_get_info(RemoteObject *obj, gint *rate, gint *freq, gint *nch, GError **error); | |
198 gboolean audacious_rc_toggle_aot(RemoteObject *obj, gboolean ontop, GError **error); | |
199 gboolean audacious_rc_get_playqueue_length(RemoteObject *obj, gint *length, GError **error); | |
200 gboolean audacious_rc_playqueue_add(RemoteObject *obj, gint pos, GError **error); | |
201 gboolean audacious_rc_playqueue_remove(RemoteObject *obj, gint pos, GError **error); | |
202 gboolean audacious_rc_playqueue_clear(RemoteObject *obj, GError **error); | |
203 gboolean audacious_rc_playqueue_is_queued(RemoteObject *obj, gint pos, gboolean *is_queued, GError **error); | |
204 gboolean audacious_rc_playlist_ins_url_string(RemoteObject *obj, gchar *url, gint pos, GError **error); | |
205 gboolean audacious_rc_playlist_enqueue_to_temp(RemoteObject *obj, gchar *url, GError **error); | |
206 gboolean audacious_rc_playlist_add(RemoteObject *obj, gpointer list, GError **error); | |
207 | |
208 /* new on nov 7 */ | |
209 gboolean audacious_rc_get_eq(RemoteObject *obj, gdouble *preamp, GArray **bands, GError **error); | |
210 gboolean audacious_rc_get_eq_preamp(RemoteObject *obj, gdouble *preamp, GError **error); | |
211 gboolean audacious_rc_get_eq_band(RemoteObject *obj, gint band, gdouble *value, GError **error); | |
212 gboolean audacious_rc_set_eq(RemoteObject *obj, gdouble preamp, GArray *bands, GError **error); | |
213 gboolean audacious_rc_set_eq_preamp(RemoteObject *obj, gdouble preamp, GError **error); | |
214 gboolean audacious_rc_set_eq_band(RemoteObject *obj, gint band, gdouble value, GError **error); | |
215 gboolean audacious_rc_equalizer_activate(RemoteObject *obj, gboolean active, GError **error); | |
216 | |
217 #endif /* AUDACIOUS_DBUS_SERVICE_H */ |