Data Structures | |
struct | xmms_output_methods_St |
Output functions that lets XMMS2 talk to the soundcard. More... | |
Defines | |
#define | XMMS_OUTPUT_API_VERSION 6 |
The current API version. | |
#define | XMMS_OUTPUT_PLUGIN(shname, name, ver, desc, setupfunc) XMMS_PLUGIN(XMMS_PLUGIN_TYPE_OUTPUT, XMMS_OUTPUT_API_VERSION, shname, name, ver, desc, (gboolean (*)(gpointer))setupfunc) |
Register the output plugin. | |
#define | XMMS_OUTPUT_METHODS_INIT(m) memset (&m, 0, sizeof (xmms_output_methods_t)) |
Initialize the xmms_output_methods_t struct. | |
#define | xmms_output_format_add(output, fmt, ch, rate) |
Add a format that the output plugin can feed the soundcard with. | |
Typedefs | |
typedef struct xmms_output_St | xmms_output_t |
typedef struct xmms_output_plugin_St | xmms_output_plugin_t |
typedef struct xmms_output_methods_St | xmms_output_methods_t |
Output functions that lets XMMS2 talk to the soundcard. | |
Functions | |
void | xmms_output_plugin_methods_set (xmms_output_plugin_t *output, xmms_output_methods_t *methods) |
Register the output plugin functions. | |
gpointer | xmms_output_private_data_get (xmms_output_t *output) |
Retrieve the private data for the plugin that was set with xmms_output_private_data_set. | |
void | xmms_output_private_data_set (xmms_output_t *output, gpointer data) |
Set the private data for the plugin that can be retrived with xmms_output_private_data_get later. | |
void | xmms_output_stream_type_add (xmms_output_t *output,...) |
Add format to list of supported formats. | |
gint | xmms_output_read (xmms_output_t *output, char *buffer, gint len) |
Read a number of bytes of data from the output buffer into a buffer. | |
void | xmms_output_set_error (xmms_output_t *output, xmms_error_t *error) |
Set an error. | |
guint | xmms_output_current_id (xmms_output_t *output, xmms_error_t *error) |
Get the current medialib id. | |
gboolean | xmms_output_plugin_format_set_always (xmms_output_plugin_t *plugin) |
Check if an output plugin needs format updates on each track change. | |
xmms_config_property_t * | xmms_output_plugin_config_property_register (xmms_output_plugin_t *plugin, const gchar *name, const gchar *default_value, xmms_object_handler_t cb, gpointer userdata) |
Register a configuration directive in the plugin setup function. | |
xmms_config_property_t * | xmms_output_config_property_register (xmms_output_t *output, const gchar *name, const gchar *default_value, xmms_object_handler_t cb, gpointer userdata) |
Register a configuration directive. | |
xmms_config_property_t * | xmms_output_config_lookup (xmms_output_t *output, const gchar *path) |
Lookup a configuration directive for the output plugin. |
#define XMMS_OUTPUT_API_VERSION 6 |
#define xmms_output_format_add | ( | output, | |||
fmt, | |||||
ch, | |||||
rate | ) |
Value:
xmms_output_stream_type_add (output, \ XMMS_STREAM_TYPE_MIMETYPE, \ "audio/pcm", \ XMMS_STREAM_TYPE_FMT_FORMAT, \ fmt, \ XMMS_STREAM_TYPE_FMT_CHANNELS, \ ch, \ XMMS_STREAM_TYPE_FMT_SAMPLERATE, \ rate, \ XMMS_STREAM_TYPE_END)
output | an output object | |
fmt | a xmms_sample_format_t | |
ch | the number of channels | |
rate | the sample rate |
Definition at line 275 of file xmms_outputplugin.h.
#define XMMS_OUTPUT_METHODS_INIT | ( | m | ) | memset (&m, 0, sizeof (xmms_output_methods_t)) |
Initialize the xmms_output_methods_t struct.
This should be run before any functions are associated.
m | the xmms_output_methods_t struct to initialize |
Definition at line 235 of file xmms_outputplugin.h.
#define XMMS_OUTPUT_PLUGIN | ( | shname, | |||
name, | |||||
ver, | |||||
desc, | |||||
setupfunc | ) | XMMS_PLUGIN(XMMS_PLUGIN_TYPE_OUTPUT, XMMS_OUTPUT_API_VERSION, shname, name, ver, desc, (gboolean (*)(gpointer))setupfunc) |
Register the output plugin.
shname | short name of the plugin | |
name | long name of the plugin | |
ver | the version of the plugin, usually the XMMS_VERSION macro | |
desc | a description of the plugin | |
setupfunc | the function that sets up the plugin functions |
Definition at line 226 of file xmms_outputplugin.h.
typedef struct xmms_output_methods_St xmms_output_methods_t |
Output functions that lets XMMS2 talk to the soundcard.
An output plugin can behave in two diffrent ways. It can either use it's own event system, or it can depend on the one XMMS2 provides. If the architechture uses its own event mechanism the plugin should not implement open/close/write. Instead a status function is implemented which will be notified on playback status updates, and perform the proper actions based on this.
typedef struct xmms_output_plugin_St xmms_output_plugin_t |
Definition at line 51 of file xmms_outputplugin.h.
typedef struct xmms_output_St xmms_output_t |
Definition at line 43 of file xmms_outputplugin.h.
xmms_config_property_t* xmms_output_config_lookup | ( | xmms_output_t * | output, | |
const gchar * | path | |||
) |
Lookup a configuration directive for the output plugin.
output | an output object | |
path | the path to the configuration value |
xmms_config_property_t* xmms_output_config_property_register | ( | xmms_output_t * | output, | |
const gchar * | name, | |||
const gchar * | default_value, | |||
xmms_object_handler_t | cb, | |||
gpointer | userdata | |||
) |
Register a configuration directive.
As an optional, but recomended functionality the plugin can decide to subscribe on the configuration value and will thus be notified when it changes by passing a callback, and if needed, userdata.
output | an output object | |
name | the name of the configuration directive | |
default_value | the default value of the configuration directive | |
cb | the function to call on configuration value changes | |
userdata | a user specified variable to be passed to the callback |
guint xmms_output_current_id | ( | xmms_output_t * | output, | |
xmms_error_t * | error | |||
) |
xmms_config_property_t* xmms_output_plugin_config_property_register | ( | xmms_output_plugin_t * | plugin, | |
const gchar * | name, | |||
const gchar * | default_value, | |||
xmms_object_handler_t | cb, | |||
gpointer | userdata | |||
) |
Register a configuration directive in the plugin setup function.
As an optional, but recomended functionality the plugin can decide to subscribe on the configuration value and will thus be notified when it changes by passing a callback, and if needed, userdata.
plugin | an output plugin object | |
name | the name of the configuration directive | |
default_value | the default value of the configuration directive | |
cb | the function to call on configuration value changes | |
userdata | a user specified variable to be passed to the callback |
Definition at line 145 of file outputplugin.c.
gboolean xmms_output_plugin_format_set_always | ( | xmms_output_plugin_t * | plugin | ) |
Check if an output plugin needs format updates on each track change.
plugin | an output plugin object |
Definition at line 225 of file outputplugin.c.
void xmms_output_plugin_methods_set | ( | xmms_output_plugin_t * | output, | |
xmms_output_methods_t * | methods | |||
) |
Register the output plugin functions.
Performs basic validation, see xmms_output_methods_St for more information.
output | an output plugin object | |
methods | a struct pointing to the plugin specific functions |
Definition at line 86 of file outputplugin.c.
gpointer xmms_output_private_data_get | ( | xmms_output_t * | output | ) |
Retrieve the private data for the plugin that was set with xmms_output_private_data_set.
output | an output object |
void xmms_output_private_data_set | ( | xmms_output_t * | output, | |
gpointer | data | |||
) |
Set the private data for the plugin that can be retrived with xmms_output_private_data_get later.
output | an output object | |
data | the private data |
gint xmms_output_read | ( | xmms_output_t * | output, | |
char * | buffer, | |||
gint | len | |||
) |
Read a number of bytes of data from the output buffer into a buffer.
This is typically used when the output plugin is event driven, and is then used when the status is set to playing, and the output needs more data from xmms2 to write to the soundcard.
output | an output object | |
buffer | a buffer to store the read data in | |
len | the number of bytes to read |
void xmms_output_set_error | ( | xmms_output_t * | output, | |
xmms_error_t * | error | |||
) |
void xmms_output_stream_type_add | ( | xmms_output_t * | output, | |
... | ||||
) |
Add format to list of supported formats.
Should be called from initialisation function for every supported format. Any call to the format_set function will be with one of these formats.
output | an output object | |
... | pairs of xmms_stream_type_key_t, value |