00001
00002
00003
00004
00005
00006
00007 #ifndef PLAYBACK_H_
00008 # define PLAYBACK_H_
00009
00010 #include <dbus/dbus.h>
00011 #include <stdint.h>
00012 #include <unistd.h>
00013 #include <sys/types.h>
00014
00015 #include <libplayback/playback-macros.h>
00016 #include <libplayback/playback-types.h>
00017
00022 PB_BEGIN_DECLS
00023
00031 typedef struct pb_playback_s pb_playback_t;
00032
00038 typedef struct pb_req_s pb_req_t;
00039
00058 typedef void (* PBStateRequest) (pb_playback_t *pb, enum pb_state_e req_state, pb_req_t* ext_req, void *data);
00059
00067 typedef void (* PBStateHint) (pb_playback_t *pb, const int allowed_state[], void *data);
00068
00077 typedef void (* PBPrivacyCb) (int override, const char *error, void *data);
00078
00087 typedef void (* PBMuteCb) (int mute, const char *error, void *data);
00088
00097 typedef void (* PBBluetoothCb) (enum pb_bt_override_status_e, const char *error, void *data);
00098
00099
00100
00101
00120 typedef void (* PBStateReply) (pb_playback_t *pb, enum pb_state_e granted_state, const char *reason,
00121 pb_req_t* req, void *data);
00122
00137 pb_playback_t * pb_playback_new_2 (DBusConnection *connection,
00138 enum pb_class_e pb_class, uint32_t flags, enum pb_state_e pb_state,
00139 PBStateRequest state_req_handler, void *data);
00140
00154 pb_playback_t * pb_playback_new (DBusConnection *connection,
00155 enum pb_class_e pb_class, enum pb_state_e pb_state,
00156 PBStateRequest state_req_handler, void *data);
00157
00158 void pb_playback_set_state_hint (pb_playback_t *pb, PBStateHint state_hint_handler, void *data);
00159
00175 pb_req_t* pb_playback_req_state (pb_playback_t *pb, enum pb_state_e pb_state, PBStateReply state_reply, void *data);
00176
00177
00178
00179
00189 int pb_get_privacy_override(DBusConnection *connection);
00190
00201 int pb_req_privacy_override(DBusConnection *connection, int override);
00202
00214 int pb_get_mute(DBusConnection *connection);
00215
00227 int pb_req_mute(DBusConnection *connection, int mute);
00228
00241 int pb_get_bluetooth_override(DBusConnection *connection);
00242
00253 int pb_req_bluetooth_override(DBusConnection *connection, int override);
00254
00255
00265 void pb_set_privacy_override_cb(DBusConnection *connection, PBPrivacyCb privacy_cb, void *data);
00266
00276 void pb_set_mute_cb(DBusConnection *connection, PBMuteCb mute_cb, void *data);
00277
00287 void pb_set_bluetooth_override_cb(DBusConnection *connection, PBBluetoothCb bluetooth_cb, void *data);
00288
00299 void pb_playback_set_pid(pb_playback_t *pb, pid_t pid);
00300 void pb_playback_set_stream(pb_playback_t *pb, char *stream);
00301
00302 int pb_playback_req_discarded (pb_playback_t *pb, pb_req_t *req, const char *reason);
00303 int pb_playback_req_completed (pb_playback_t *pb, pb_req_t *req);
00304
00305 void pb_playback_destroy (pb_playback_t *pb);
00306
00307 PB_END_DECLS
00308
00309 #endif