-/*
- * Copyright (C) 2012-2013 Andre Noll <maan@systemlinux.org>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2012 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
-/** \file mix.h Mixer API (used by para_fade). */
+/** \file mix.h Mixer API for para_mixer. */
/**
* Opaque structure which corresponds to an instance of a mixer.
/**
* 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. */
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;