aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer_api.h
diff options
context:
space:
mode:
authorViliam Mateicka <viliam.mateicka@gmail.com>2009-01-10 17:53:33 +0100
committerMax Kellermann <max@duempel.org>2009-01-10 17:55:38 +0100
commit11c29cccb3409fb4d0fea5171a56230253583864 (patch)
tree6ab080de10e9f0d3c4acf48b24815689f9fc4be5 /src/mixer_api.h
parent8ebe7bfb250f2b1048d6e7f6c2477717daaad8e9 (diff)
downloadmpd-11c29cccb3409fb4d0fea5171a56230253583864.tar.gz
mpd-11c29cccb3409fb4d0fea5171a56230253583864.tar.xz
mpd-11c29cccb3409fb4d0fea5171a56230253583864.zip
Introducing mixer api
This patch tryes to introduce pluggable mixer (struct mixer_plugin) along with some basic infrastructure (mixer_* functions). Instance of mixer (struct mixer) is used in alsa and oss output plugin
Diffstat (limited to '')
-rw-r--r--src/mixer_api.h74
1 files changed, 51 insertions, 23 deletions
diff --git a/src/mixer_api.h b/src/mixer_api.h
index 43dc3299d..67d08427c 100644
--- a/src/mixer_api.h
+++ b/src/mixer_api.h
@@ -4,30 +4,58 @@
#include "conf.h"
-/**
- * alsa mixer
+/*
+ * list of currently implemented mixers
*/
-struct alsa_mixer;
-
-struct alsa_mixer *alsa_mixer_init(void);
-void alsa_mixer_finish(struct alsa_mixer *am);
-void alsa_mixer_configure(struct alsa_mixer *am, ConfigParam *param);
-bool alsa_mixer_open(struct alsa_mixer *am);
-bool alsa_mixer_control(struct alsa_mixer *am, int cmd, void *arg);
-void alsa_mixer_close(struct alsa_mixer *am);
-
-/**
- * oss mixer
- */
-
-struct oss_mixer;
-
-struct oss_mixer *oss_mixer_init(void);
-void oss_mixer_finish(struct oss_mixer *am);
-void oss_mixer_configure(struct oss_mixer *am, ConfigParam *param);
-bool oss_mixer_open(struct oss_mixer *am);
-bool oss_mixer_control(struct oss_mixer *am, int cmd, void *arg);
-void oss_mixer_close(struct oss_mixer *am);
+extern struct mixer_plugin alsa_mixer;
+extern struct mixer_plugin oss_mixer;
+
+struct mixer_data;
+
+struct mixer_plugin {
+
+ /**
+ * Allocate and initialize mixer data
+ */
+ struct mixer_data *(*init)(void);
+
+ /**
+ * Finish and free mixer data
+ */
+ void (*finish)(struct mixer_data *data);
+
+ /**
+ * Setup and configure mixer
+ */
+ void (*configure)(struct mixer_data *data, ConfigParam *param);
+
+ /**
+ * Open mixer device
+ */
+ bool (*open)(struct mixer_data *data);
+
+ /**
+ * Control mixer device.
+ */
+ bool (*control)(struct mixer_data *data, int cmd, void *arg);
+
+ /**
+ * Close mixer device
+ */
+ void (*close)(struct mixer_data *data);
+};
+
+struct mixer {
+ struct mixer_plugin *plugin;
+ struct mixer_data *data;
+};
+
+void mixer_init(struct mixer *mixer, struct mixer_plugin *plugin);
+void mixer_finish(struct mixer *mixer);
+void mixer_configure(struct mixer *mixer, ConfigParam *param);
+bool mixer_open(struct mixer *mixer);
+bool mixer_control(struct mixer *mixer, int cmd, void *arg);
+void mixer_close(struct mixer *mixer);
#endif