Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: alsa-devel@alsa-project.org, Clemens Ladisch <clemens@ladisch.de>
Subject: Re: [PATCH 5/6] control: add a function to add an element of bytes type
Date: Tue, 23 Feb 2016 10:37:42 +0100	[thread overview]
Message-ID: <s5h60xf22e1.wl-tiwai@suse.de> (raw)
In-Reply-To: <56CC24EA.8060505@sakamocchi.jp>

On Tue, 23 Feb 2016 10:22:50 +0100,
Takashi Sakamoto wrote:
> 
> Hi,
> 
> On Feb 23 2016 17:31, Clemens Ladisch wrote:
> > Takashi Sakamoto wrote:
> >> ALSA Ctl core allows userspace applications to add elements of bytes type,
> >> while there's no APIs for this purpose in alsa-lib.
> >>
> >> This commit adds the missing function.
> >
> >>   /**
> >> + * \brief Create and add an user-defined control element of bytes type.
> >> + * \param[in] ctl CTL handle.
> >> + * \param[in,out] id ID of the new control element.
> >> + * \param[in] channels The number of channels which a control element includes.
> >
> > For this control type, "count" might be a better name.
> > Or at least say in the description that this is the number of bytes.
> 
> For the name of this variable, I don't mind using 'count'. But then, in 
> next commit, snd_ctl_elem_add_bytes_set() has two arguments named 
> 'count'. And the consistency of API design is lost a bit.

How about naming it a bit more descriptive way, e.g. count_xxx?
"channel" isn't clearer than "count", IMO.


> I think that naming the variables depends on interpretation of 'struct 
> snd_ctl_elem_value', therefore it mostly depends on taste of each 
> developers. For example, to 'bytes' type element set, we can interpret 
> 'struct snd_ctl_elem_value.bytes' as either 'byte array in an element' 
> or 'data for each channels with int8_t (=char) value for an element'.
> 
> So I propose the design of ALSA control core. If possible, I'd like to 
> follow the design when adding new APIs for a consistent representation. 
> If the proposed design is not propper, we can change the design for 
> better shape. (but it will sometimes be a dull work depending on taste 
> of each developers.)
> 
> And, I note that the name of 'channel' is picked up from Mixer APIs in 
> alsa-lib. It doesn't come from my brain ;)

The mixer API is indeed focused on the mixer element, thus the concept
of channel would match in most cases (but not all, sure).  But control
API is designed a bit more generically, so I understand Clemens'
concern, too.


thanks,

Takashi

  reply	other threads:[~2016-02-23  9:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  0:48 [alsa-lib][PATCH 0/6] control: add APIs for control element set Takashi Sakamoto
2016-02-23  0:48 ` [PATCH 1/6] control: rename variables so that it represents the number of channels which an element has Takashi Sakamoto
2016-02-23  8:52   ` Takashi Sakamoto
2016-02-23  0:48 ` [PATCH 2/6] control: improve API documentation for functions to add elements Takashi Sakamoto
2016-02-23  0:48 ` [PATCH 3/6] control: improve API documentation for functions to set/get channel values for an element Takashi Sakamoto
2016-02-23  0:48 ` [PATCH 4/6] control: rename variables so that it represents a channel in element Takashi Sakamoto
2016-02-23  0:48 ` [PATCH 5/6] control: add a function to add an element of bytes type Takashi Sakamoto
2016-02-23  8:31   ` Clemens Ladisch
2016-02-23  9:22     ` Takashi Sakamoto
2016-02-23  9:37       ` Takashi Iwai [this message]
2016-02-23  0:48 ` [PATCH 6/6] control: add functions to add element set Takashi Sakamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h60xf22e1.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=o-takashi@sakamocchi.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox