All of lore.kernel.org
 help / color / mirror / Atom feed
* .dimen ?
@ 2003-05-18 17:05 Giuliano Pochini
  2003-05-20  8:51 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Giuliano Pochini @ 2003-05-18 17:05 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]



In struct sndrv_ctl_elem_info what is the union .dimen for ?  A grep(1)
in all sources show that it's referenced only in
snd_ctl_elem_info_get_dimension() and
snd_ctl_elem_info_get_dimensions(). The latter seems quite buggy (patch
against 0.9.3 is attached).

Bye.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 570 bytes --]

--- ./src/control/control.c.old	Sun May 18 16:53:36 2003
+++ ./src/control/control.c	Sun May 18 16:55:59 2003
@@ -1699,10 +1699,10 @@
 	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;
+	for (i = 3; i >= 0; i--)
+		if (obj->dimen.d[i])
+			return(i+1);
+	return 0;
 }
 use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info_get_dimensions, ALSA_0.9.3);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: .dimen ?
  2003-05-18 17:05 .dimen ? Giuliano Pochini
@ 2003-05-20  8:51 ` Takashi Iwai
  2003-05-20  9:58   ` Giuliano Pochini
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2003-05-20  8:51 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: alsa-devel

At 18 May 2003 17:05:33 +0000,
Giuliano Pochini wrote:
> 
> [1  <text/plain (7bit)>]
> 
> 
> In struct sndrv_ctl_elem_info what is the union .dimen for ?

it was introduced to describe the size of matrix controls.
basically the control API accepts the linear index, so user (or
alsa-lib) needs to map the multi-dimensional array to the linear
index.  the dimen field specifies the number of elements in each
dimension.  (up to 4 dimensions are supposed.)
so far, no driver supports this feature yet, though...


> A grep(1)
> in all sources show that it's referenced only in
> snd_ctl_elem_info_get_dimension() and
> snd_ctl_elem_info_get_dimensions(). The latter seems quite buggy (patch
> against 0.9.3 is attached).

thanks, patch is applied to cvs.


ciao,

Takashi


-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: .dimen ?
  2003-05-20  8:51 ` Takashi Iwai
@ 2003-05-20  9:58   ` Giuliano Pochini
  0 siblings, 0 replies; 3+ messages in thread
From: Giuliano Pochini @ 2003-05-20  9:58 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel


On 20-May-2003 Takashi Iwai wrote:
>> In struct sndrv_ctl_elem_info what is the union .dimen for ?
>
> it was introduced to describe the size of matrix controls.
> basically the control API accepts the linear index, so user (or
> alsa-lib) needs to map the multi-dimensional array to the linear
> index.  the dimen field specifies the number of elements in each
> dimension.  (up to 4 dimensions are supposed.)
> so far, no driver supports this feature yet, though...

Fine, it's very useful. I'll try it ASAP.


Bye.



-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-20  9:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-18 17:05 .dimen ? Giuliano Pochini
2003-05-20  8:51 ` Takashi Iwai
2003-05-20  9:58   ` Giuliano Pochini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.