X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mix.h;h=cad435e811e09a9d3d924f946608fd57cce81ed1;hp=60c4392fabab76bb58ad1c2ee0ee211d52469ad7;hb=6bded356ec89b1344049ff702e6c6babaeccd439;hpb=837cd1ab890645d9fd7d0d85139fdf076d987ea4 diff --git a/mix.h b/mix.h index 60c4392f..cad435e8 100644 --- a/mix.h +++ b/mix.h @@ -1,10 +1,6 @@ -/* - * Copyright (C) 2012 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2012 Andre Noll , 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. @@ -16,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. */ @@ -34,3 +34,6 @@ struct mixer { /** 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;