This functions are used to connect a client software to the XMMS2 daemon. More...



All modules related to collection handling.


This controls configuration values on the XMMS server.


This controls the medialib.


This controls the playback.


This controls the playlist.


Result manipulation and error handling

Each command to the server will return a xmmsc_result_t to the programmer.


This module contains functions to access informations and statistics of the XMMS server.


This manages the visualization transfer.


Functions for integrating the xmms client library with an existing mainloop.


xmmsc_connection_txmmsc_init (const char *clientname)
 Initializes a xmmsc_connection_t.
int xmmsc_connect (xmmsc_connection_t *c, const char *ipcpath)
 Connects to the XMMS server.
void xmmsc_disconnect_callback_set (xmmsc_connection_t *c, xmmsc_disconnect_func_t callback, void *userdata)
 Set the disconnect callback.
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.
void xmmsc_unref (xmmsc_connection_t *c)
 Dereference the xmmsc_connection_t and free the memory when reference count reaches zero.
xmmsc_connection_txmmsc_ref (xmmsc_connection_t *c)
 References the xmmsc_connection_t.
void xmmsc_lock_set (xmmsc_connection_t *c, void *lock, void(*lockfunc)(void *), void(*unlockfunc)(void *))
 Set locking functions for a connection.
xmmsc_result_txmmsc_quit (xmmsc_connection_t *c)
 Tell the server to quit.
xmmsc_result_txmmsc_broadcast_quit (xmmsc_connection_t *c)
 Request the quit broadcast.
const char * xmmsc_userconfdir_get (char *buf, int len)
 Get the absolute path to the user config dir.

Detailed Description

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.

Function Documentation

xmmsc_result_t* xmmsc_broadcast_quit ( xmmsc_connection_t c  ) 

Request the quit broadcast.

Will be called when the server is terminating.

Definition at line 305 of file xmmsclient.c.

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>"

  • Protocol could be "tcp" or "unix"
  • Path is either the UNIX socket, or the ipnumber of the server.
  • Port is only used when the protocol tcp.
TRUE on success and FALSE if some problem occured. call xmmsc_get_last_error to find out.
See also:

Definition at line 153 of file xmmsclient.c.

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.

Definition at line 198 of file xmmsclient.c.

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 

Definition at line 206 of file xmmsclient.c.

Referenced by xmmsc_disconnect_callback_set().

char* xmmsc_get_last_error ( xmmsc_connection_t c  ) 

Returns a string that descibes the last error.

Definition at line 219 of file xmmsclient.c.

xmmsc_connection_t* xmmsc_init ( const char *  clientname  ) 

Initializes a xmmsc_connection_t.

Returns NULL if you runned out of memory.

a xmmsc_connection_t that should be unreferenced with xmmsc_unref.
See also:

Definition at line 91 of file xmmsclient.c.

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.

Definition at line 281 of file xmmsclient.c.

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()

Definition at line 293 of file xmmsclient.c.

xmmsc_connection_t* xmmsc_ref ( xmmsc_connection_t c  ) 

References the xmmsc_connection_t.

c the connection to reference.

Definition at line 248 of file xmmsclient.c.

Referenced by xmmsc_init(), and xmmsc_result_new().

void xmmsc_unref ( xmmsc_connection_t c  ) 

Dereference the xmmsc_connection_t and free the memory when reference count reaches zero.

Definition at line 230 of file xmmsclient.c.

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 (PATH_MAX is a good choice)
A pointer to buf, or NULL if an error occurred.

Definition at line 320 of file xmmsclient.c.

Generated on Tue Feb 23 18:17:57 2010 for XmmsClient by  doxygen 1.6.1