X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=mix.h;fp=mix.h;h=a4105544daf526c857e86d9ff6a1ab2dab47cd9c;hb=46af7dd81149caee0409535d5d9884ed9fa5af0e;hp=0000000000000000000000000000000000000000;hpb=7024574d05fe8571c763d11c61626a9ac4980267;p=paraslash.git diff --git a/mix.h b/mix.h new file mode 100644 index 00000000..a4105544 --- /dev/null +++ b/mix.h @@ -0,0 +1,28 @@ +/** + * Opaque structure which corresponds to an instance of a mixer. + * + * A pointer to a structure of this type is returned by ->open(). This pointer + * must be passed to most other methods of \ref struct mixer. + */ +struct mixer_handle; + +/** + * Operations provided by each mixer plugin. + */ +struct mixer { + /** Called on startup, must fill in all other members. */ + void (*init)(struct mixer *self); + /** 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. */ + char *(*get_channels)(struct mixer_handle *handle); + /** Select the channel for subsequent get/set operations. */ + int (*set_channel)(struct mixer_handle *handle, + const char *mixer_channel); + /** Return the (normalized) current value of the selected channel. */ + 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. */ + void (*close)(struct mixer_handle **handle); +};