aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_plugin.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-16 01:39:00 +0100
committerMax Kellermann <max@duempel.org>2009-02-16 01:39:00 +0100
commit37bc31d161d486d0499cf64123b7561f57dd0c53 (patch)
tree54cb688aecd4f30f1afbf0f4d87d48a7abbe4fba /src/output_plugin.h
parent79b50b7d9c2ef84e0b74345a31a9b2f96d2690cd (diff)
downloadmpd-37bc31d161d486d0499cf64123b7561f57dd0c53.tar.gz
mpd-37bc31d161d486d0499cf64123b7561f57dd0c53.tar.xz
mpd-37bc31d161d486d0499cf64123b7561f57dd0c53.zip
output_plugin: replaced method "control()" with "mixer()"
The output plugin shouldn't know any specifics of the mixer API. Make it return the mixer object, and let the caller deal with it.
Diffstat (limited to 'src/output_plugin.h')
-rw-r--r--src/output_plugin.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/output_plugin.h b/src/output_plugin.h
index 0166322fc..b652dc44e 100644
--- a/src/output_plugin.h
+++ b/src/output_plugin.h
@@ -64,6 +64,15 @@ struct audio_output_plugin {
void (*finish)(void *data);
/**
+ * Returns the mixer device associated with this audio output.
+ * This does not actually open the mixer device yet.
+ *
+ * @return the mixer object, or NULL if there is no mixer
+ * attached to this audio output
+ */
+ struct mixer *(*get_mixer)(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
@@ -104,12 +113,6 @@ struct audio_output_plugin {
* for continue to pause
*/
bool (*pause)(void *data);
-
- /**
- * Control the device. Usualy used for implementing
- * set and get mixer levels
- */
- bool (*control)(void *data, int cmd, void *arg);
};
static inline bool
@@ -135,6 +138,14 @@ ao_plugin_finish(const struct audio_output_plugin *plugin, void *data)
plugin->finish(data);
}
+static inline struct mixer *
+ao_plugin_get_mixer(const struct audio_output_plugin *plugin, void *data)
+{
+ return plugin->get_mixer != NULL
+ ? plugin->get_mixer(data)
+ : NULL;
+}
+
static inline bool
ao_plugin_open(const struct audio_output_plugin *plugin,
void *data, struct audio_format *audio_format)