Update of /cvsroot/alsa/alsa-kernel/include
In directory sc8-pr-cvs1:/tmp/cvs-serv17648/include

Modified Files:
        asound.h control.h trident.h 
Log Message:
Control API update
- separated volatile data from snd_kcontrol_t to reduce space for multi elements
- added multi elements
- changed trident driver to use multi elements
- added dimen union to the info structure to describe matrix


Index: asound.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/asound.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- asound.h    3 Mar 2003 18:51:34 -0000       1.29
+++ asound.h    1 Apr 2003 13:55:43 -0000       1.30
@@ -681,7 +681,7 @@
  *                                                                          *
  ****************************************************************************/
 
-#define SNDRV_CTL_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 1)
+#define SNDRV_CTL_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 2)
 
 struct sndrv_ctl_card_info {
        int card;                       /* card number */
@@ -726,7 +726,8 @@
 #define SNDRV_CTL_ELEM_ACCESS_INACTIVE         (1<<8)  /* control does actually 
nothing, but may be updated */
 #define SNDRV_CTL_ELEM_ACCESS_LOCK             (1<<9)  /* write lock */
 #define SNDRV_CTL_ELEM_ACCESS_OWNER            (1<<10) /* write lock owner */
-#define SNDRV_CTL_ELEM_ACCESS_INDIRECT         (1<<31) /* indirect access */
+#define SNDRV_CTL_ELEM_ACCESS_DINDIRECT                (1<<30) /* indirect access for 
matrix dimensions in the info structure */
+#define SNDRV_CTL_ELEM_ACCESS_INDIRECT         (1<<31) /* indirect access for element 
value in the value structure */
 
 /* for further details see the ACPI and PCI power management specification */
 #define SNDRV_CTL_POWER_D0             0x0000  /* full On */
@@ -778,7 +779,11 @@
                } enumerated;
                unsigned char reserved[128];
        } value;
-       unsigned char reserved[64];
+       union {
+               unsigned short d[4];            /* dimensions */
+               unsigned short *d_ptr;          /* indirect */
+       } dimen;
+       unsigned char reserved[64-4*sizeof(unsigned short)];
 };
 
 struct sndrv_ctl_elem_value {

Index: control.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/control.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- control.h   25 Nov 2002 18:15:03 -0000      1.5
+++ control.h   1 Apr 2003 13:55:43 -0000       1.6
@@ -49,18 +49,24 @@
        unsigned char *name;            /* ASCII name of item */
        unsigned int index;             /* index of item */
        unsigned int access;            /* access rights */
+       unsigned int count;             /* count of same elements */
        snd_kcontrol_info_t *info;
        snd_kcontrol_get_t *get;
        snd_kcontrol_put_t *put;
        unsigned long private_value;
 } snd_kcontrol_new_t;
 
+typedef struct _snd_kcontrol_volatile {
+       snd_ctl_file_t *owner;  /* locked */
+       pid_t owner_pid;
+       unsigned int access;    /* access rights */
+} snd_kcontrol_volatile_t;
+
 struct _snd_kcontrol {
        struct list_head list;          /* list of controls */
        snd_ctl_elem_id_t id;
-       snd_ctl_file_t *owner;          /* locked */
-       pid_t owner_pid;
-       unsigned int access;            /* access rights */
+       unsigned int count;             /* count of same elements */
+       snd_kcontrol_volatile_t *vd;    /* volatile data */
        snd_kcontrol_info_t *info;
        snd_kcontrol_get_t *get;
        snd_kcontrol_put_t *put;
@@ -100,7 +106,7 @@
 
 void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id);
 
-snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol);
+snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access);
 snd_kcontrol_t *snd_ctl_new1(snd_kcontrol_new_t * kcontrolnew, void * private_data);
 void snd_ctl_free_one(snd_kcontrol_t * kcontrol);
 int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol);
@@ -116,5 +122,34 @@
 int snd_ctl_unregister(snd_card_t *card);
 int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn);
 int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn);
+
+static inline unsigned int snd_ctl_get_ioffnum(snd_kcontrol_t *kctl, 
snd_ctl_elem_id_t *id)
+{
+       return id->numid - kctl->id.numid;
+}
+
+static inline unsigned int snd_ctl_get_ioffidx(snd_kcontrol_t *kctl, 
snd_ctl_elem_id_t *id)
+{
+       return id->index - kctl->id.index;
+}
+
+static inline unsigned int snd_ctl_get_ioff(snd_kcontrol_t *kctl, snd_ctl_elem_id_t 
*id)
+{
+       if (id->numid) {
+               return snd_ctl_get_ioffnum(kctl, id);
+       } else {
+               return snd_ctl_get_ioffidx(kctl, id);
+       }
+}
+
+static inline snd_ctl_elem_id_t *snd_ctl_build_ioff(snd_ctl_elem_id_t *dst_id,
+                                                   snd_kcontrol_t *src_kctl,
+                                                   unsigned int offset)
+{
+       *dst_id = src_kctl->id;
+       dst_id->index += offset;
+       dst_id->numid += offset;
+       return dst_id;
+}
 
 #endif /* __SOUND_CONTROL_H */

Index: trident.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/trident.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- trident.h   10 Mar 2003 13:35:36 -0000      1.12
+++ trident.h   1 Apr 2003 13:55:43 -0000       1.13
@@ -403,10 +403,6 @@
        unsigned char rvol;             /* rear volume */
        unsigned char cvol;             /* center volume */
        unsigned char pad;
-       snd_kcontrol_t *ctl_vol;        /* front volume */
-       snd_kcontrol_t *ctl_pan;        /* pan */
-       snd_kcontrol_t *ctl_rvol;       /* rear volume */
-       snd_kcontrol_t *ctl_cvol;       /* center volume */
 };
 
 struct _snd_trident {
@@ -458,6 +454,10 @@
 
        unsigned int musicvol_wavevol;
        snd_trident_pcm_mixer_t pcm_mixer[32];
+       snd_kcontrol_t *ctl_vol;        /* front volume */
+       snd_kcontrol_t *ctl_pan;        /* pan */
+       snd_kcontrol_t *ctl_rvol;       /* rear volume */
+       snd_kcontrol_t *ctl_cvol;       /* center volume */
 
        spinlock_t reg_lock;
 



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to