aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-24 07:21:51 +0200
committerMax Kellermann <max@duempel.org>2008-09-24 07:21:51 +0200
commit5cf62133444d5a66791dbf5975484cf4de40eda8 (patch)
tree210250754b7e7b0ada8641f07edc511e72719a4a
parent08352184ac887fd37510ddb46aedaec1c99fcd44 (diff)
downloadmpd-5cf62133444d5a66791dbf5975484cf4de40eda8.tar.gz
mpd-5cf62133444d5a66791dbf5975484cf4de40eda8.tar.xz
mpd-5cf62133444d5a66791dbf5975484cf4de40eda8.zip
output: document the audio_output_plugin methods
Diffstat (limited to '')
-rw-r--r--src/output_api.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/output_api.h b/src/output_api.h
index e1dce077d..928ba04f1 100644
--- a/src/output_api.h
+++ b/src/output_api.h
@@ -31,25 +31,69 @@
struct audio_output;
+/**
+ * A plugin which controls an audio output device.
+ */
struct audio_output_plugin {
+ /**
+ * the plugin's name
+ */
const char *name;
+ /**
+ * Test if this plugin can provide a default output, in case
+ * none has been configured. This method is optional.
+ */
int (*test_default_device)(void);
+ /**
+ * Configure and initialize the device, but do not open it
+ * yet.
+ *
+ * @param ao an opaque pointer to the audio_output structure
+ * @param audio_format the configured audio format, or NULL if
+ * none is configured
+ * @param param the configuration section, or NULL if there is
+ * no configuration
+ * @return NULL on error, or an opaque pointer to the plugin's
+ * data
+ */
void *(*init)(struct audio_output *ao,
const struct audio_format *audio_format,
ConfigParam *param);
+ /**
+ * Free resources allocated by this device.
+ */
void (*finish)(void *data);
+ /**
+ * Really open the device.
+ * @param audio_format the audio format in which data is going
+ * to be delivered; may be modified by the plugin
+ */
int (*open)(void *data, struct audio_format *audio_format);
+ /**
+ * Play a chunk of audio data.
+ */
int (*play)(void *data, const char *playChunk, size_t size);
+ /**
+ * Try to cancel data which may still be in the device's
+ * buffers.
+ */
void (*cancel)(void *data);
+ /**
+ * Close the device.
+ */
void (*close)(void *data);
+ /**
+ * Display metadata for the next chunk. Optional method,
+ * because not all devices can display metadata.
+ */
void (*send_tag)(void *data, const struct tag *tag);
};