MPD 0.17~git
|
A plugin which controls an audio output device. More...
#include <output_plugin.h>
Data Fields | |
const char * | name |
the plugin's name | |
bool(* | test_default_device )(void) |
Test if this plugin can provide a default output, in case none has been configured. | |
struct audio_output *(* | init )(const struct config_param *param, GError **error) |
Configure and initialize the device, but do not open it yet. | |
void(* | finish )(struct audio_output *data) |
Free resources allocated by this device. | |
bool(* | enable )(struct audio_output *data, GError **error_r) |
Enable the device. | |
void(* | disable )(struct audio_output *data) |
Disables the device. | |
bool(* | open )(struct audio_output *data, struct audio_format *audio_format, GError **error) |
Really open the device. | |
void(* | close )(struct audio_output *data) |
Close the device. | |
unsigned(* | delay )(struct audio_output *data) |
Returns a positive number if the output thread shall delay the next call to play() or pause(). | |
void(* | send_tag )(struct audio_output *data, const struct tag *tag) |
Display metadata for the next chunk. | |
size_t(* | play )(struct audio_output *data, const void *chunk, size_t size, GError **error) |
Play a chunk of audio data. | |
void(* | drain )(struct audio_output *data) |
Wait until the device has finished playing. | |
void(* | cancel )(struct audio_output *data) |
Try to cancel data which may still be in the device's buffers. | |
bool(* | pause )(struct audio_output *data) |
Pause the device. | |
struct mixer_plugin * | mixer_plugin |
The mixer plugin associated with this output plugin. |
A plugin which controls an audio output device.
Definition at line 35 of file output_plugin.h.
void(* audio_output_plugin::cancel)(struct audio_output *data) |
Try to cancel data which may still be in the device's buffers.
Definition at line 136 of file output_plugin.h.
void(* audio_output_plugin::close)(struct audio_output *data) |
Close the device.
Definition at line 98 of file output_plugin.h.
unsigned(* audio_output_plugin::delay)(struct audio_output *data) |
Returns a positive number if the output thread shall delay the next call to play() or pause().
This should be implemented instead of doing a sleep inside the plugin, because this allows MPD to listen to commands meanwhile.
Definition at line 108 of file output_plugin.h.
void(* audio_output_plugin::disable)(struct audio_output *data) |
Disables the device.
It is closed before this method is called.
Definition at line 82 of file output_plugin.h.
void(* audio_output_plugin::drain)(struct audio_output *data) |
Wait until the device has finished playing.
Definition at line 130 of file output_plugin.h.
bool(* audio_output_plugin::enable)(struct audio_output *data, GError **error_r) |
Enable the device.
This may allocate resources, preparing for the device to be opened. Enabling a device cannot fail: if an error occurs during that, it should be reported by the open() method.
error_r | location to store the error occurring, or NULL to ignore errors |
Definition at line 76 of file output_plugin.h.
void(* audio_output_plugin::finish)(struct audio_output *data) |
Free resources allocated by this device.
Definition at line 64 of file output_plugin.h.
struct audio_output*(* audio_output_plugin::init)(const struct config_param *param, GError **error) [read] |
Configure and initialize the device, but do not open it yet.
param | the configuration section, or NULL if there is no configuration |
error | location to store the error occurring, or NULL to ignore errors |
Definition at line 58 of file output_plugin.h.
The mixer plugin associated with this output plugin.
This may be NULL if no mixer plugin is implemented. When created, this mixer plugin gets the same config_param as this audio output device.
Definition at line 157 of file output_plugin.h.
const char* audio_output_plugin::name |
the plugin's name
Definition at line 39 of file output_plugin.h.
bool(* audio_output_plugin::open)(struct audio_output *data, struct audio_format *audio_format, GError **error) |
Really open the device.
audio_format | the audio format in which data is going to be delivered; may be modified by the plugin |
error | location to store the error occurring, or NULL to ignore errors |
Definition at line 92 of file output_plugin.h.
bool(* audio_output_plugin::pause)(struct audio_output *data) |
Pause the device.
If supported, it may perform a special action, which keeps the device open, but does not play anything. Output plugins like "shout" might want to play silence during pause, so their clients won't be disconnected. Plugins which do not support pausing will simply be closed, and have to be reopened when unpaused.
Definition at line 149 of file output_plugin.h.
size_t(* audio_output_plugin::play)(struct audio_output *data, const void *chunk, size_t size, GError **error) |
Play a chunk of audio data.
error | location to store the error occurring, or NULL to ignore errors |
Definition at line 123 of file output_plugin.h.
void(* audio_output_plugin::send_tag)(struct audio_output *data, const struct tag *tag) |
Display metadata for the next chunk.
Optional method, because not all devices can display metadata.
Definition at line 114 of file output_plugin.h.
bool(* audio_output_plugin::test_default_device)(void) |
Test if this plugin can provide a default output, in case none has been configured.
This method is optional.
Definition at line 45 of file output_plugin.h.