diff options
author | Max Kellermann <max@duempel.org> | 2009-01-25 17:37:59 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-25 17:37:59 +0100 |
commit | 8695b9423233e9e8ad18ed7b4d56a020254fbdd6 (patch) | |
tree | d8053ae96ef50e9ab69499b5e8a2702364974cfa /src/mixer | |
parent | 763dd8c1dd4de451663474bafd13068eb6017bbb (diff) | |
download | mpd-8695b9423233e9e8ad18ed7b4d56a020254fbdd6.tar.gz mpd-8695b9423233e9e8ad18ed7b4d56a020254fbdd6.tar.xz mpd-8695b9423233e9e8ad18ed7b4d56a020254fbdd6.zip |
mixer: removed mixer_configure(), configure mixer in mixer_new()
Allocate the mixer object when it is configured.
Merged mixer_configure() into mixer_new(). mixer_new() was quite
useless anyway.
Diffstat (limited to '')
-rw-r--r-- | src/mixer_api.c | 10 | ||||
-rw-r--r-- | src/mixer_api.h | 3 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/mixer_api.c b/src/mixer_api.c index cd216415a..b0fea9a7a 100644 --- a/src/mixer_api.c +++ b/src/mixer_api.c @@ -38,11 +38,13 @@ void mixer_finish(struct mixer *mixer) } struct mixer * -mixer_new(const struct mixer_plugin *plugin) +mixer_new(const struct mixer_plugin *plugin, const struct config_param *param) { struct mixer *mixer = g_new(struct mixer, 1); mixer_init(mixer, plugin); + plugin->configure(mixer->data, param); + return mixer; } @@ -53,12 +55,6 @@ mixer_free(struct mixer *mixer) g_free(mixer); } -void mixer_configure(struct mixer *mixer, const struct config_param *param) -{ - assert(mixer != NULL && mixer->plugin != NULL); - mixer->plugin->configure(mixer->data, param); -} - bool mixer_open(struct mixer *mixer) { assert(mixer != NULL && mixer->plugin != NULL); diff --git a/src/mixer_api.h b/src/mixer_api.h index c563457c2..cc0d8327f 100644 --- a/src/mixer_api.h +++ b/src/mixer_api.h @@ -73,12 +73,11 @@ void mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin); void mixer_finish(struct mixer *mixer); struct mixer * -mixer_new(const struct mixer_plugin *plugin); +mixer_new(const struct mixer_plugin *plugin, const struct config_param *param); void mixer_free(struct mixer *mixer); -void mixer_configure(struct mixer *mixer, const struct config_param *param); bool mixer_open(struct mixer *mixer); bool mixer_control(struct mixer *mixer, int cmd, void *arg); void mixer_close(struct mixer *mixer); |