XMMS2
Defines | Functions

Config

XMMSServer

Controls configuration for the server. More...

Defines

#define XMMS_CONFIG_VERSION   2
 Config file version.

Functions

const gchar * xmms_config_property_lookup_get_string (xmms_config_t *conf, const gchar *key, xmms_error_t *err)
 Config functions.
xmms_config_property_txmms_config_lookup (const gchar *path)
 Look up a config key from the global config.
const gchar * xmms_config_property_get_name (const xmms_config_property_t *prop)
 Get the name of a config property.
void xmms_config_property_set_data (xmms_config_property_t *prop, const gchar *data)
 Set the data of the config property to a new value.
const gchar * xmms_config_property_get_string (const xmms_config_property_t *prop)
 Return the value of a config property as a string.
gint xmms_config_property_get_int (const xmms_config_property_t *prop)
 Return the value of a config property as an int.
gfloat xmms_config_property_get_float (const xmms_config_property_t *prop)
 Return the value of a config property as a float.
void xmms_config_property_callback_set (xmms_config_property_t *prop, xmms_object_handler_t cb, gpointer userdata)
 Set a callback function for a config property.
void xmms_config_property_callback_remove (xmms_config_property_t *prop, xmms_object_handler_t cb, gpointer userdata)
 Remove a callback from a config property.
xmms_config_property_txmms_config_property_register (const gchar *path, const gchar *default_value, xmms_object_handler_t cb, gpointer userdata)
 Register a new config property.

Detailed Description

Controls configuration for the server.

The configuration is saved to, and loaded from an XML file. It's split into plugin, client and core parts. This documents the configuration for parts inside the server. For plugin config see each server object's documentation.


Define Documentation

#define XMMS_CONFIG_VERSION   2

Config file version.

Definition at line 128 of file config.c.

Referenced by xmms_config_init(), and xmms_config_save().


Function Documentation

xmms_config_property_t* xmms_config_lookup ( const gchar *  path)

Look up a config key from the global config.

Parameters:
pathA configuration path. Could be core.myconfig or effect.foo.myconfig
Returns:
An xmms_config_property_t

Definition at line 174 of file config.c.

Referenced by xmms_config_property_lookup_get_string(), xmms_plugin_config_lookup(), xmms_sqlite_create(), and xmms_sqlite_open().

void xmms_config_property_callback_remove ( xmms_config_property_t prop,
xmms_object_handler_t  cb,
gpointer  userdata 
)

Remove a callback from a config property.

Parameters:
propThe config property
cbThe callback to remove

Definition at line 310 of file config.c.

void xmms_config_property_callback_set ( xmms_config_property_t prop,
xmms_object_handler_t  cb,
gpointer  userdata 
)

Set a callback function for a config property.

This will be called each time the property's value changes.

Parameters:
propThe config property
cbThe callback to set
userdataData to pass on to the callback

Definition at line 290 of file config.c.

Referenced by xmms_config_property_register().

gfloat xmms_config_property_get_float ( const xmms_config_property_t prop)

Return the value of a config property as a float.

Parameters:
propThe config property
Returns:
value as float

Definition at line 273 of file config.c.

gint xmms_config_property_get_int ( const xmms_config_property_t prop)

Return the value of a config property as an int.

Parameters:
propThe config property
Returns:
value as int

Definition at line 258 of file config.c.

Referenced by xmms_output_new(), xmms_playlist_init(), and xmms_sqlite_create().

const gchar* xmms_config_property_get_name ( const xmms_config_property_t prop)

Get the name of a config property.

Parameters:
propThe config property
Returns:
Name of config property

Definition at line 192 of file config.c.

const gchar* xmms_config_property_get_string ( const xmms_config_property_t prop)

Return the value of a config property as a string.

Parameters:
propThe config property
Returns:
value as string

Definition at line 246 of file config.c.

Referenced by main(), on_config_ipcsocket_change(), xmms_bindata_init(), xmms_config_property_lookup_get_string(), xmms_sqlite_create(), and xmms_sqlite_open().

const gchar* xmms_config_property_lookup_get_string ( xmms_config_t conf,
const gchar *  key,
xmms_error_t err 
)

Config functions.

Lookup config key and return its associated value as a string. This is a convenient function to make it easier to get a configuration value rather than having to call xmms_config_property_get_string separately.

Parameters:
confGlobal config
keyConfiguration property to lookup
errif error occurs this will be filled in
Returns:
A string with the value. If the value is an int it will return NULL

Definition at line 152 of file config.c.

xmms_config_property_t* xmms_config_property_register ( const gchar *  path,
const gchar *  default_value,
xmms_object_handler_t  cb,
gpointer  userdata 
)

Register a new config property.

This should be called from the init code as XMMS2 won't allow set/get on properties that haven't been registered.

Parameters:
pathThe path in the config tree.
default_valueIf the value was not found in the configfile, what should we use?
cbA callback function that will be called if the value is changed by the client. Can be set to NULL.
userdataData to pass to the callback function.
Returns:
A newly allocated xmms_config_property_t for the registered property.

Definition at line 337 of file config.c.

Referenced by main(), xmms_bindata_init(), xmms_medialib_init(), xmms_output_new(), xmms_playlist_init(), and xmms_plugin_config_property_register().

void xmms_config_property_set_data ( xmms_config_property_t prop,
const gchar *  data 
)

Set the data of the config property to a new value.

Parameters:
propThe config property
dataThe value to set

Definition at line 205 of file config.c.

Referenced by main(), and xmms_config_property_register().