Update of /cvsroot/alsa/alsa-lib/src/control
In directory sc8-pr-cvs1:/tmp/cvs-serv20736/src/control

Modified Files:
        control.c control_hw.c 
Log Message:
Added snd_ctl_elem_info_get_dimensions() and snd_ctl_elem_info_get_dimension() 
functions.


Index: control.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/control/control.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- control.c   12 Feb 2003 21:57:50 -0000      1.95
+++ control.c   1 Apr 2003 13:58:11 -0000       1.96
@@ -1543,7 +1543,7 @@
 }
 
 /**
- * \brief Get info about values passing policy from a CTL element id/info
+ * \brief (DEPRECATED) Get info about values passing policy from a CTL element value
  * \param obj CTL element id/info
  * \return 0 if element value need to be passed by contents, 1 if need to be passed 
with a pointer
  */
@@ -1552,6 +1552,7 @@
        assert(obj);
        return !!(obj->access & SNDRV_CTL_ELEM_ACCESS_INDIRECT);
 }
+link_warning(snd_ctl_elem_info_is_indirect, "Warning: snd_ctl_elem_info_is_indirect 
is deprecated, do not use it");
 
 /**
  * \brief Get owner of a locked element
@@ -1681,6 +1682,49 @@
        assert(obj->type == SND_CTL_ELEM_TYPE_ENUMERATED);
        return obj->value.enumerated.name;
 }
+
+/**
+ * \brief Get count of dimensions for given element
+ * \param obj CTL element id/info
+ * \return zero value if no dimensions are defined, otherwise positive value with 
count of dimensions
+ */
+#ifndef DOXYGEN
+int INTERNAL(snd_ctl_elem_info_get_dimensions)(const snd_ctl_elem_info_t *obj)
+#else
+int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj)
+#endif
+{
+       int i;
+
+       assert(obj);
+       if (obj->access & SNDRV_CTL_ELEM_ACCESS_DINDIRECT)
+               return 0;                       /* FIXME: implement indirect access as 
well */
+       for (i = 3; i >= 0; i++)
+               if (obj->dimen.d[0])
+                       break;
+       return i >= 0 ? i + 1 : 0;
+}
+use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, 
snd_ctl_elem_info_get_dimensions, ALSA_0.9.3);
+
+/**
+ * \brief Get specified of dimension width for given element
+ * \param obj CTL element id/info
+ * \return zero value if no dimension width is defined, otherwise positive value with 
with of specified dimension
+ */
+#ifndef DOXYGEN
+int INTERNAL(snd_ctl_elem_info_get_dimension)(const snd_ctl_elem_info_t *obj, 
unsigned int idx)
+#else
+int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx)
+#endif
+{
+       assert(obj);
+       if (obj->access & SNDRV_CTL_ELEM_ACCESS_DINDIRECT)
+               return 0;                       /* FIXME: implement indirect access as 
well */
+       if (idx >= 3)
+               return 0;
+       return obj->dimen.d[0];
+}
+use_default_symbol_version(__snd_ctl_elem_info_get_dimension, 
snd_ctl_elem_info_get_dimension, ALSA_0.9.3);
 
 /**
  * \brief Get CTL element identifier of a CTL element id/info

Index: control_hw.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/control/control_hw.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- control_hw.c        5 Feb 2003 11:00:16 -0000       1.36
+++ control_hw.c        1 Apr 2003 13:58:12 -0000       1.37
@@ -39,7 +39,7 @@
 #endif
 
 #define SNDRV_FILE_CONTROL     "/dev/snd/controlC%i"
-#define SNDRV_CTL_VERSION_MAX  SNDRV_PROTOCOL_VERSION(2, 0, 0)
+#define SNDRV_CTL_VERSION_MAX  SNDRV_PROTOCOL_VERSION(2, 0, 2)
 
 typedef struct {
        int card;



-------------------------------------------------------
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