X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mix.h;h=cad435e811e09a9d3d924f946608fd57cce81ed1;hp=a4105544daf526c857e86d9ff6a1ab2dab47cd9c;hb=ba83a291cd486e8ab53ac64d81b17d8f5705d715;hpb=db2cd7b5404f5f01d25b72beacb3e5245b1bb94c diff --git a/mix.h b/mix.h index a4105544..cad435e8 100644 --- a/mix.h +++ b/mix.h @@ -1,3 +1,7 @@ +/* Copyright (C) 2012 Andre Noll , see file COPYING. */ + +/** \file mix.h Mixer API for para_mixer. */ + /** * Opaque structure which corresponds to an instance of a mixer. * @@ -8,10 +12,14 @@ struct mixer_handle; /** * Operations provided by each mixer plugin. + * + * Each mixer plugin must define a non-static instance of this structure, with + * all pointers initialized to non-NULL values. No other symbols need to be + * exported. */ struct mixer { - /** Called on startup, must fill in all other members. */ - void (*init)(struct mixer *self); + /** Used to identify the mixer. */ + const char * const name; /** Return a handle that can be passed to other methods. */ int (*open)(const char *dev, struct mixer_handle **handle); /** Returns a string of all valid mixer channels. */ @@ -23,6 +31,9 @@ struct mixer { int (*get)(struct mixer_handle *handle); /** Change the value of the selected channel. */ int (*set)(struct mixer_handle *handle, int val); - /** Free all ressources associated with the given handle. */ + /** Free all resources associated with the given handle. */ void (*close)(struct mixer_handle **handle); }; + +/** Declared even if unsupported because it does not hurt and avoids ifdefs. */ +extern const struct mixer alsa_mixer, oss_mixer;