Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

sbase.h

00001 /*
00002  *  Mixer Interface - simple abstact module - base library
00003  *  Copyright (c) 2005 by Jaroslav Kysela <perex@suse.cz>
00004  *
00005  *
00006  *   This library is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU Lesser General Public License as
00008  *   published by the Free Software Foundation; either version 2.1 of
00009  *   the License, or (at your option) any later version.
00010  *
00011  *   This program is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU Lesser General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU Lesser General Public
00017  *   License along with this library; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019  *
00020  */
00021 
00022 #ifndef __SMIXER_BASE_H
00023 
00024 #include "list.h"
00025 
00026 #define MAX_CHANNEL     6
00027 
00028 #define SID_MASTER      0
00029 #define SID_HEADPHONE   1
00030 #define SID_FRONT       2
00031 #define SID_PCM         3
00032 #define SID_CD          4
00033 
00034 struct melem_sids {
00035         unsigned short sid;
00036         const char *sname;
00037         unsigned short sindex;
00038         unsigned short weight;
00039         unsigned int chanmap[2];
00040         struct sm_elem_ops *sops;
00041 };
00042 
00043 #define PURPOSE_VOLUME          0
00044 #define PURPOSE_SWITCH          1
00045 #define PURPOSE_ENUMLIST        2
00046 
00047 struct helem_selector {
00048         snd_ctl_elem_iface_t iface;
00049         const char *name;
00050         unsigned short index;
00051         unsigned short sid;
00052         unsigned short purpose;
00053         unsigned short caps;
00054 };
00055 
00056 struct helem_base {
00057         struct list_head list;
00058         snd_hctl_elem_t *helem;
00059         unsigned short purpose;
00060         unsigned int caps;
00061         unsigned int inactive: 1;
00062         long min, max;
00063         unsigned int count;
00064 };
00065 
00066 struct selem_base {
00067         sm_selem_t selem;
00068         struct list_head helems;
00069         unsigned short sid;
00070         struct {
00071                 unsigned int chanmap;
00072                 unsigned int forced_range: 1;
00073                 long min, max;
00074                 long vol[MAX_CHANNEL];
00075         } dir[2];
00076 };
00077 
00078 struct bclass_selector {
00079         struct list_head list;
00080         struct helem_selector *selectors;
00081         unsigned int count;
00082 };
00083 
00084 struct bclass_sid {
00085         struct list_head list;
00086         struct melem_sids *sids;
00087         unsigned int count;
00088 };
00089 
00090 typedef struct bclass_base_ops {
00091         int (*event)(snd_mixer_class_t *class, unsigned int mask,
00092                      snd_hctl_elem_t *helem, snd_mixer_elem_t *melem);
00093         int (*selreg)(snd_mixer_class_t *class,
00094                       struct helem_selector *selectors,
00095                       unsigned int count);
00096         int (*sidreg)(snd_mixer_class_t *class,
00097                       struct melem_sids *sids,
00098                       unsigned int count);
00099 } bclass_base_ops_t;
00100 
00101 struct bclass_private {
00102         struct list_head selectors;
00103         struct list_head sids;
00104         void *dl_sbase;
00105         bclass_base_ops_t ops;
00106 };
00107 
00108 int mixer_simple_basic_dlopen(snd_mixer_class_t *class,
00109                               bclass_base_ops_t **ops);
00110 
00111 #endif /* __SMIXER_BASE_H */

Generated on Mon Sep 12 21:08:12 2005 for ALSA project - the C library reference by  doxygen 1.4.4