diff options
author | Max Kellermann <max@duempel.org> | 2009-01-25 17:45:16 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-25 17:45:16 +0100 |
commit | 936449c6225624102d0a6cb78f9bb4da84375d60 (patch) | |
tree | 790c03c5f7769197bc81e058055921a0d246af26 /src/mixer_api.h | |
parent | dc575106c296435940482cc2655804c71ee2d934 (diff) | |
download | mpd-936449c6225624102d0a6cb78f9bb4da84375d60.tar.gz mpd-936449c6225624102d0a6cb78f9bb4da84375d60.tar.xz mpd-936449c6225624102d0a6cb78f9bb4da84375d60.zip |
mixer_api: removed struct mixer_data
The mixer plugins should re-use the mixer struct and incorporate it in
their object class.
Diffstat (limited to '')
-rw-r--r-- | src/mixer_api.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mixer_api.h b/src/mixer_api.h index 50a9cb165..b79d02a1c 100644 --- a/src/mixer_api.h +++ b/src/mixer_api.h @@ -28,41 +28,42 @@ extern const struct mixer_plugin alsa_mixer; extern const struct mixer_plugin oss_mixer; -struct mixer_data; - struct mixer_plugin { /** * Alocates and configures a mixer device. */ - struct mixer_data *(*init)(const struct config_param *param); + struct mixer *(*init)(const struct config_param *param); /** * Finish and free mixer data */ - void (*finish)(struct mixer_data *data); + void (*finish)(struct mixer *data); /** * Open mixer device */ - bool (*open)(struct mixer_data *data); + bool (*open)(struct mixer *data); /** * Control mixer device. */ - bool (*control)(struct mixer_data *data, int cmd, void *arg); + bool (*control)(struct mixer *data, int cmd, void *arg); /** * Close mixer device */ - void (*close)(struct mixer_data *data); + void (*close)(struct mixer *data); }; struct mixer { const struct mixer_plugin *plugin; - struct mixer_data *data; }; -void mixer_finish(struct mixer *mixer); +static inline void +mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin) +{ + mixer->plugin = plugin; +} struct mixer * mixer_new(const struct mixer_plugin *plugin, const struct config_param *param); |