Allow hint for ctl, hwdep, timer and seq

Like pcm and rawmidi, each object parser needs to accept the hint
component.  Now a new local function _snd_conf_generic_id() was
introduced to replace each call of "comment" and "type" field checks.

Also, the two existing identical functions for pcm and rawmidi are
removed and the new function is used commonly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2015-04-30 14:52:35 +02:00
parent 46d98392d0
commit 7d9972c6ad
12 changed files with 25 additions and 54 deletions

View file

@ -7059,18 +7059,6 @@ int snd_pcm_slave_conf(snd_config_t *root, snd_config_t *conf,
return err;
}
int snd_pcm_conf_generic_id(const char *id)
{
static const char ids[3][8] = { "comment", "type", "hint" };
unsigned int k;
for (k = 0; k < sizeof(ids) / sizeof(ids[0]); ++k) {
if (strcmp(id, ids[k]) == 0)
return 1;
}
return 0;
}
static void snd_pcm_set_ptr(snd_pcm_t *pcm, snd_pcm_rbptr_t *rbptr,
volatile snd_pcm_uframes_t *hw_ptr, int fd, off_t offset)
{