Update of /cvsroot/alsa/alsa-kernel/Documentation/DocBook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26965/Documentation/DocBook
Modified Files: writing-an-alsa-driver.tmpl Log Message: - fixed the example code of ctl info callback with enum type. Index: writing-an-alsa-driver.tmpl =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/Documentation/DocBook/writing-an-alsa-driver.tmpl,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- writing-an-alsa-driver.tmpl 26 Jan 2004 14:27:13 -0000 1.22 +++ writing-an-alsa-driver.tmpl 25 Feb 2004 11:21:41 -0000 1.23 @@ -3769,14 +3769,20 @@ <programlisting> <![CDATA[ static int snd_myctl_info(snd_kcontrol_t *kcontrol, - static char *texts[4] = { - "First", "Second", "Third", "Fourth" - }; - uinfo->value.enumerated.items = 4; - if (uinfo->value.enumerated.item > 3) - uinfo->value.enumerated.item = 3; - strcpy(uinfo->value.enumerated.name, - texts[uinfo->value.enumerated.item]); + snd_ctl_elem_info_t *uinfo) + { + static char *texts[4] = { + "First", "Second", "Third", "Fourth" + }; + uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; + uinfo->count = 1; + uinfo->value.enumerated.items = 4; + if (uinfo->value.enumerated.item > 3) + uinfo->value.enumerated.item = 3; + strcpy(uinfo->value.enumerated.name, + texts[uinfo->value.enumerated.item]); + return 0; + } ]]> </programlisting> </informalexample> ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog