本文整理汇总了C++中x_check_conn函数的典型用法代码示例。如果您正苦于以下问题:C++ x_check_conn函数的具体用法?C++ x_check_conn怎么用?C++ x_check_conn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了x_check_conn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xmmsc_broadcast_playback_current_id
/**
* Request the current id broadcast. This will be called then the
* current playing id is changed. New song for example.
*/
xmmsc_result_t *
xmmsc_broadcast_playback_current_id (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_broadcast_msg (c, XMMS_IPC_SIGNAL_PLAYBACK_CURRENTID);
}
示例2: xmmsc_visualization_init
xmmsc_result_t *
xmmsc_visualization_init (xmmsc_connection_t *c)
{
xmmsc_result_t *res = NULL;
x_check_conn (c, 0);
c->visc++;
c->visv = realloc (c->visv, sizeof (xmmsc_visualization_t*) * c->visc);
if (!c->visv) {
x_oom ();
c->visc = 0;
}
if (c->visc > 0) {
int vv = c->visc-1;
if (!(c->visv[vv] = x_new0 (xmmsc_visualization_t, 1))) {
x_oom ();
} else {
c->visv[vv]->idx = vv;
c->visv[vv]->state = VIS_NEW;
res = xmmsc_send_msg_no_arg (c, XMMS_IPC_OBJECT_VISUALIZATION, XMMS_IPC_CMD_VISUALIZATION_REGISTER);
if (res) {
xmmsc_result_visc_set (res, c->visv[vv]);
}
}
}
return res;
}
示例3: xmmsc_broadcast_playback_status
/**
* Requests the playback status broadcast. This will be called when
* events like play, stop and pause is triggered.
*/
xmmsc_result_t *
xmmsc_broadcast_playback_status (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_broadcast_msg (c, XMMS_IPC_SIGNAL_PLAYBACK_STATUS);
}
示例4: xmmsc_visualization_start
xmmsc_result_t *
xmmsc_visualization_start (xmmsc_connection_t *c, int vv)
{
xmmsc_result_t *res;
xmmsc_visualization_t *v;
x_check_conn (c, 0);
v = get_dataset (c, vv);
x_api_error_if (!v, "with unregistered/unconnected visualization dataset", 0);
switch (v->state) {
case VIS_WORKING:
case VIS_ERRORED:
break;
case VIS_NEW:
#ifdef HAVE_SEMTIMEDOP
/* first try unixshm */
v->type = VIS_UNIXSHM;
res = setup_shm_prepare (c, vv);
v->state = VIS_TRYING_UNIXSHM;
break;
#endif
case VIS_TO_TRY_UDP:
v->type = VIS_UDP;
res = setup_udp_prepare (c, vv);
v->state = VIS_TRYING_UDP;
break;
default:
v->state = VIS_ERRORED;
x_api_warning ("out of sequence");
break;
}
return res;
}
示例5: xmmsc_broadcast_playlist_current_pos
/**
* Request the playlist current pos broadcast. When the position
* in the playlist is changed this will be called.
*/
xmmsc_result_t *
xmmsc_broadcast_playlist_current_pos (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_broadcast_msg (c, XMMS_IPC_SIGNAL_PLAYLIST_CURRENT_POS);
}
示例6: xmmsc_playback_pause
xmmsc_result_t *
xmmsc_playback_pause (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_msg_no_arg (c, XMMS_IPC_OBJECT_PLAYBACK, XMMS_IPC_CMD_PAUSE);
}
示例7: xmmsc_playback_tickle
/**
* Stop decoding of current song. This will start decoding of the song
* set with xmmsc_playlist_set_next, or the current song again if no
* xmmsc_playlist_set_next was executed.
*/
xmmsc_result_t *
xmmsc_playback_tickle (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_msg_no_arg (c, XMMS_IPC_OBJECT_PLAYBACK, XMMS_IPC_CMD_DECODER_KILL);
}
示例8: xmmsc_broadcast_playlist_loaded
/**
* Request the playlist_loaded broadcast. This will be called
* if a playlist is loaded server-side. The argument will be a string
* with the playlist name.
*/
xmmsc_result_t *
xmmsc_broadcast_playlist_loaded (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_broadcast_msg (c, XMMS_IPC_SIGNAL_PLAYLIST_LOADED);
}
示例9: xmmsc_playlist_insert_collection
/**
* Queries the medialib for media and inserts the matching ones to
* the current playlist at the given position.
*
* @param c The connection structure.
* @param playlist The playlist in which to insert the media.
* @param pos A position in the playlist
* @param coll The collection to find media in the medialib.
* @param order The list of properties by which to order the matching
* media, passed as an #xmmsv_t list of strings.
*/
xmmsc_result_t *
xmmsc_playlist_insert_collection (xmmsc_connection_t *c, const char *playlist,
int pos, xmmsv_coll_t *coll,
xmmsv_t *order)
{
xmms_ipc_msg_t *msg;
x_check_conn (c, NULL);
/* default to the active playlist */
if (playlist == NULL) {
playlist = XMMS_ACTIVE_PLAYLIST;
}
/* default to empty ordering */
msg = xmms_ipc_msg_new (XMMS_IPC_OBJECT_PLAYLIST, XMMS_IPC_CMD_INSERT_COLL);
xmms_ipc_msg_put_string (msg, playlist);
xmms_ipc_msg_put_int32 (msg, pos);
xmms_ipc_msg_put_collection (msg, coll);
xmms_ipc_msg_put_value_list (msg, order); /* purposedly skip typing */
return xmmsc_send_msg (c, msg);
}
示例10: xmmsc_broadcast_collection_changed
/**
* Request the collection changed broadcast from the server. Everytime someone
* manipulates a collection this will be emitted.
*/
xmmsc_result_t*
xmmsc_broadcast_collection_changed (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_broadcast_msg (c, XMMS_IPC_SIGNAL_COLLECTION_CHANGED);
}
示例11: xmmsc_medialib_get_id_encoded
/**
* Search for a entry (URL) in the medialib db and return its ID number
*
* Same as #xmmsc_medialib_get_id but expects a encoded URL instead
*
* @param conn The #xmmsc_connection_t
* @param url The URL to search for
*/
xmmsc_result_t *
xmmsc_medialib_get_id_encoded (xmmsc_connection_t *conn, const char *url)
{
x_check_conn (conn, NULL);
return do_methodcall (conn, XMMS_IPC_CMD_GET_ID, url);
}
示例12: xmmsc_coll_query_ids
/**
* List the ids of all media matched by the given collection.
* A list of ordering properties can be specified, as well as offsets
* to only retrieve part of the result set.
*
* @param conn The connection to the server.
* @param coll The collection used to query.
* @param order The list of properties to order by, passed as an #xmmsv_t list of strings.
* @param limit_start The offset at which to start retrieving results (0 to disable).
* @param limit_len The maximum number of entries to retrieve (0 to disable).
*/
xmmsc_result_t*
xmmsc_coll_query_ids (xmmsc_connection_t *conn, xmmsv_coll_t *coll,
xmmsv_t *order, int limit_start,
int limit_len)
{
xmms_ipc_msg_t *msg;
x_check_conn (conn, NULL);
x_api_error_if (!coll, "with a NULL collection", NULL);
/* default to empty ordering */
if (!order) {
order = xmmsv_new_list ();
} else {
xmmsv_ref (order);
}
msg = xmms_ipc_msg_new (XMMS_IPC_OBJECT_COLLECTION, XMMS_IPC_CMD_QUERY_IDS);
xmms_ipc_msg_put_collection (msg, coll);
xmms_ipc_msg_put_int32 (msg, limit_start);
xmms_ipc_msg_put_int32 (msg, limit_len);
xmms_ipc_msg_put_value_list (msg, order); /* purposedly skip typing */
xmmsv_unref (order);
return xmmsc_send_msg (conn, msg);
}
示例13: xmmsc_signal_playback_playtime
/**
* Request the playback_playtime signal. Will update the
* time we have played the current entry.
*/
xmmsc_result_t *
xmmsc_signal_playback_playtime (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_signal_msg (c, XMMS_IPC_SIGNAL_PLAYBACK_PLAYTIME);
}
示例14: xmmsc_broadcast_medialib_entry_changed
/**
* Request the medialib_entry_changed broadcast. This will be called
* if a entry changes on the serverside. The argument will be an medialib
* id.
*/
xmmsc_result_t *
xmmsc_broadcast_medialib_entry_changed (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_broadcast_msg (c, XMMS_IPC_SIGNAL_MEDIALIB_ENTRY_UPDATE);
}
示例15: xmmsc_playlist_current_active
/**
* Retrive the name of the active playlist
*/
xmmsc_result_t *
xmmsc_playlist_current_active (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_msg_no_arg (c, XMMS_IPC_OBJECT_PLAYLIST, XMMS_IPC_CMD_CURRENT_ACTIVE);
}