forked from pool/alsa-utils
Takashi Iwai
141a404e6c
- Backport alsa-utils fixes from upstream: 0001-alsamixer-fix-display-of-active-inactive-controls.patch 0002-alsaloop-libsamplerate-requires-specific-formats-for.patch 0003-alsaloop-another-try-to-force-correct-formats-for-li.patch 0004-alsamixer-fix-build-on-uClibc.patch 0005-alsactl-init-Mute-CD-Playback-volume-by-default.patch 0006-Revert-alsactl-Display-help-for-names-command.patch 0007-alsaucm-Add-list1-command-for-non-tuple-lists.patch 0008-alsaucm-Don-t-double-free-empty-lists.patch 0009-aplay-Add-i-option-for-interactive-mode.patch 0010-aplay-Avoid-recursive-signal-handling.patch 0012-alsaloop-Use-AM_CFLAGS-in-Makefile.am.patch 0013-Updated-COPYING-with-the-recent-FSF-address.patch 0014-alsamixer-Fix-64bit-issues.patch 0015-aplay-Add-include-files-for-mkdir.patch 0016-aplay-Use-standard-endian-convesions.patch OBS-URL: https://build.opensuse.org/request/show/72632 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=33
91 lines
2.6 KiB
Diff
91 lines
2.6 KiB
Diff
From 16bdb41b87d1f4baa3a54a4af0b85abd98cf9159 Mon Sep 17 00:00:00 2001
|
|
From: Stephen Warren <swarren@nvidia.com>
|
|
Date: Thu, 2 Jun 2011 16:45:12 -0600
|
|
Subject: [PATCH 07/16] alsaucm: Add list1 command for non-tuple lists
|
|
|
|
snd_use_case_get_list returns lists of strings that are either:
|
|
a) A sequence of single strings
|
|
b) A sequence of pairs of strings all flattened into a single list
|
|
|
|
The current list command assumes layout (b) above, and hence prints
|
|
nothing when printing a single-entry list that's actually in layout (a).
|
|
Add a new command "list1" to dump lists in layout (a).
|
|
|
|
Signed-off-by: Stephen Warren <swarren@nvidia.com>
|
|
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
---
|
|
alsaucm/usecase.c | 29 +++++++++++++++++++++--------
|
|
1 files changed, 21 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/alsaucm/usecase.c b/alsaucm/usecase.c
|
|
index 83781d0..f24e63e 100644
|
|
--- a/alsaucm/usecase.c
|
|
+++ b/alsaucm/usecase.c
|
|
@@ -63,7 +63,8 @@ enum uc_cmd {
|
|
OM_RESET,
|
|
OM_RELOAD,
|
|
OM_LISTCARDS,
|
|
- OM_LIST,
|
|
+ OM_LIST2,
|
|
+ OM_LIST1,
|
|
|
|
/* set/get */
|
|
OM_SET,
|
|
@@ -87,7 +88,8 @@ static struct cmd cmds[] = {
|
|
{ OM_RESET, 0, 1, "reset" },
|
|
{ OM_RELOAD, 0, 1, "reload" },
|
|
{ OM_LISTCARDS, 0, 0, "listcards" },
|
|
- { OM_LIST, 1, 1, "list" },
|
|
+ { OM_LIST1, 1, 1, "list1" },
|
|
+ { OM_LIST2, 1, 1, "list" },
|
|
{ OM_SET, 2, 1, "set" },
|
|
{ OM_GET, 1, 1, "get" },
|
|
{ OM_GETI, 1, 1, "geti" },
|
|
@@ -172,7 +174,7 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
|
|
{
|
|
const char **list, *str;
|
|
long lval;
|
|
- int err, i;
|
|
+ int err, i, j, entries;
|
|
|
|
if (cmd->opencard && context->uc_mgr == NULL) {
|
|
fprintf(stderr, "%s: command '%s' requires an open card\n",
|
|
@@ -233,7 +235,17 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
|
|
}
|
|
snd_use_case_free_list(list, err);
|
|
break;
|
|
- case OM_LIST:
|
|
+ case OM_LIST1:
|
|
+ case OM_LIST2:
|
|
+ switch (cmd->code) {
|
|
+ case OM_LIST1:
|
|
+ entries = 1;
|
|
+ break;
|
|
+ case OM_LIST2:
|
|
+ entries = 2;
|
|
+ break;
|
|
+ }
|
|
+
|
|
err = snd_use_case_get_list(context->uc_mgr,
|
|
argv[0],
|
|
&list);
|
|
@@ -246,10 +258,11 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
|
|
}
|
|
if (err == 0)
|
|
printf(" list is empty\n");
|
|
- for (i = 0; i < err / 2; i++) {
|
|
- printf(" %i: %s\n", i, list[i*2]);
|
|
- if (list[i*2+1])
|
|
- printf(" %s\n", list[i*2+1]);
|
|
+ for (i = 0; i < err / entries; i++) {
|
|
+ printf(" %i: %s\n", i, list[i*entries]);
|
|
+ for (j = 0; j < entries - 1; j++)
|
|
+ if (list[i*entries+j+1])
|
|
+ printf(" %s\n", list[i*entries+j+1]);
|
|
}
|
|
snd_use_case_free_list(list, err);
|
|
break;
|
|
--
|
|
1.7.5.3
|
|
|