XmmsClient
|
This functions are used to connect a client software to the XMMS2 daemon. More...
Modules | |
Collections | |
All modules related to collection handling. | |
ConfigControl | |
This controls configuration values on the XMMS server. | |
MedialibControl | |
This controls the medialib. | |
PlaybackControl | |
This controls the playback. | |
PlaylistControl | |
This controls the playlist. | |
Result | |
Result manipulation and error handlingEach command to the server will return a xmmsc_result_t to the programmer. | |
StatsFunctions | |
This module contains functions to access information and statistics of the XMMS server. | |
Visualization | |
This manages the visualization transfer. | |
IOFunctions | |
Functions for integrating the xmms client library with an existing mainloop. | |
Functions | |
xmmsc_connection_t * | xmmsc_init (const char *clientname) |
Initializes a xmmsc_connection_t. More... | |
int | xmmsc_connect (xmmsc_connection_t *c, const char *ipcpath) |
Connects to the XMMS server. More... | |
void | xmmsc_disconnect_callback_set (xmmsc_connection_t *c, xmmsc_disconnect_func_t callback, void *userdata) |
Set the disconnect callback. More... | |
void | xmmsc_disconnect_callback_set_full (xmmsc_connection_t *c, xmmsc_disconnect_func_t callback, void *userdata, xmmsc_user_data_free_func_t free_func) |
char * | xmmsc_get_last_error (xmmsc_connection_t *c) |
Returns a string that descibes the last error. More... | |
void | xmmsc_unref (xmmsc_connection_t *c) |
Dereference the xmmsc_connection_t and free the memory when reference count reaches zero. More... | |
xmmsc_connection_t * | xmmsc_ref (xmmsc_connection_t *c) |
References the xmmsc_connection_t. More... | |
void | xmmsc_lock_set (xmmsc_connection_t *c, void *lock, void(*lockfunc)(void *), void(*unlockfunc)(void *)) |
Set locking functions for a connection. More... | |
xmmsc_result_t * | xmmsc_quit (xmmsc_connection_t *c) |
Tell the server to quit. More... | |
xmmsc_result_t * | xmmsc_broadcast_quit (xmmsc_connection_t *c) |
Request the quit broadcast. More... | |
const char * | xmmsc_userconfdir_get (char *buf, int len) |
Get the absolute path to the user config dir. More... | |
This functions are used to connect a client software to the XMMS2 daemon.
For proper integration with a client you need to hook the XMMSIPC to your clients mainloop. XMMS2 ships with a couple of default mainloop integrations but can easily be extended to fit your own application.
There are three kinds of messages that will be involved in communication with the XMMS2 server.
Each client command will return a xmmsc_result_t which holds the command id that will be used to map the result back to the right caller. The xmmsc_result_t is used to get the result from the server.
xmmsc_result_t* xmmsc_broadcast_quit | ( | xmmsc_connection_t * | c | ) |
Request the quit broadcast.
Will be called when the server is terminating.
int xmmsc_connect | ( | xmmsc_connection_t * | c, |
const char * | ipcpath | ||
) |
Connects to the XMMS server.
If ipcpath is NULL, it will try to open the default path.
c | The connection to the server. This must be initialized with xmmsc_init first. |
ipcpath | The IPC path, it's broken down like this: <protocol>://<path>[:<port>]. If ipcpath is NULL it will default to "unix:///tmp/xmms-ipc-<username>"
|
void xmmsc_disconnect_callback_set | ( | xmmsc_connection_t * | c, |
xmmsc_disconnect_func_t | callback, | ||
void * | userdata | ||
) |
Set the disconnect callback.
It will be called when client will be disconnected.
void xmmsc_disconnect_callback_set_full | ( | xmmsc_connection_t * | c, |
xmmsc_disconnect_func_t | callback, | ||
void * | userdata, | ||
xmmsc_user_data_free_func_t | free_func | ||
) |
Referenced by xmmsc_disconnect_callback_set().
char* xmmsc_get_last_error | ( | xmmsc_connection_t * | c | ) |
Returns a string that descibes the last error.
xmmsc_connection_t* xmmsc_init | ( | const char * | clientname | ) |
Initializes a xmmsc_connection_t.
Returns NULL if you runned out of memory.
void xmmsc_lock_set | ( | xmmsc_connection_t * | c, |
void * | lock, | ||
void(*)(void *) | lockfunc, | ||
void(*)(void *) | unlockfunc | ||
) |
Set locking functions for a connection.
Allows simultanous usage of a connection from several threads.
c | connection |
lock | the locking primitive passed to the lock and unlock functions |
lockfunc | function called when entering critical region, called with lock as argument. |
unlockfunc | funciotn called when leaving critical region. |
xmmsc_result_t* xmmsc_quit | ( | xmmsc_connection_t * | c | ) |
Tell the server to quit.
This will terminate the server. If you only want to disconnect, use xmmsc_unref()
xmmsc_connection_t* xmmsc_ref | ( | xmmsc_connection_t * | c | ) |
References the xmmsc_connection_t.
c | the connection to reference. |
Referenced by xmmsc_init().
void xmmsc_unref | ( | xmmsc_connection_t * | c | ) |
Dereference the xmmsc_connection_t and free the memory when reference count reaches zero.
const char* xmmsc_userconfdir_get | ( | char * | buf, |
int | len | ||
) |
Get the absolute path to the user config dir.
buf | A char buffer |
len | The length of buf (XMMS_PATH_MAX is a good choice) |