00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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