/* SPDX-License-Identifier: GPL-2.0 */ /** \file mix.h Mixer API for para_mixer. */ /** * 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. * * 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 { /** 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. */ 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)(const struct mixer_handle *handle); /** Change the value of the selected channel. */ int (*set)(struct mixer_handle *handle, int val); /** Free all resources associated with the given handle. */ void (*close)(struct mixer_handle *handle); }; /* * The alsa_mixer structure is declared even on *BSD where the alsa API is * unsupported. This does not hurt, and it avoids ifdefs. */ extern const struct mixer alsa_mixer, oss_mixer;