static int pa_cli_command_help(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_modules(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_clients(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
+static int pa_cli_command_cards(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_sinks(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_sources(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_sink_inputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
{ "list-clients", pa_cli_command_clients, "List loaded clients", 1 },
{ "list-sink-inputs", pa_cli_command_sink_inputs, "List sink inputs", 1 },
{ "list-source-outputs", pa_cli_command_source_outputs, "List source outputs", 1 },
+ { "list-cards", pa_cli_command_cards, "List cards", 1 },
{ "stat", pa_cli_command_stat, "Show memory block statistics", 1 },
{ "info", pa_cli_command_info, "Show comprehensive status", 1 },
{ "ls", pa_cli_command_info, NULL, 1 },
return 0;
}
+static int pa_cli_command_cards(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
+ char *s;
+
+ pa_core_assert_ref(c);
+ pa_assert(t);
+ pa_assert(buf);
+ pa_assert(fail);
+
+ pa_assert_se(s = pa_card_list_to_string(c));
+ pa_strbuf_puts(buf, s);
+ pa_xfree(s);
+ return 0;
+}
+
static int pa_cli_command_sinks(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
char *s;
pa_cli_command_sinks(c, t, buf, fail);
pa_cli_command_sources(c, t, buf, fail);
pa_cli_command_clients(c, t, buf, fail);
+ pa_cli_command_cards(c, t, buf, fail);
pa_cli_command_sink_inputs(c, t, buf, fail);
pa_cli_command_source_outputs(c, t, buf, fail);
pa_cli_command_scache_list(c, t, buf, fail);
return pa_strbuf_tostring_free(s);
}
+char *pa_card_list_to_string(pa_core *c) {
+ pa_strbuf *s;
+ pa_card *card;
+ uint32_t idx = PA_IDXSET_INVALID;
+ pa_assert(c);
+
+ s = pa_strbuf_new();
+
+ pa_strbuf_printf(s, "%u card(s) available in.\n", pa_idxset_size(c->cards));
+
+ for (card = pa_idxset_first(c->cards, &idx); card; card = pa_idxset_next(c->cards, &idx)) {
+ char *t;
+ pa_strbuf_printf(
+ s,
+ " index: %u\n"
+ "\tname: <%s>\n"
+ "\tdriver: <%s>\n",
+ card->index,
+ card->name,
+ card->driver);
+
+ if (card->module)
+ pa_strbuf_printf(s, "\towner module: %u\n", card->module->index);
+
+ t = pa_proplist_to_string(card->proplist);
+ pa_strbuf_printf(s, "\tproperties:\n%s", t);
+ pa_xfree(t);
+ }
+
+ return pa_strbuf_tostring_free(s);
+}
+
char *pa_sink_list_to_string(pa_core *c) {
pa_strbuf *s;
pa_sink *sink;
pa_sink_used_by(sink),
pa_sink_linked_by(sink));
+ if (sink->card)
+ pa_strbuf_printf(s, "\tcard: %u <%s>\n", sink->card->index, sink->card->name);
if (sink->module)
pa_strbuf_printf(s, "\tmodule: %u\n", sink->module->index);
if (source->monitor_of)
pa_strbuf_printf(s, "\tmonitor_of: %u\n", source->monitor_of->index);
+ if (source->card)
+ pa_strbuf_printf(s, "\tcard: %u <%s>\n", source->card->index, source->card->name);
if (source->module)
pa_strbuf_printf(s, "\tmodule: %u\n", source->module->index);
s = pa_strbuf_new();
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < 9; i++) {
char *t = NULL;
switch (i) {
t = pa_client_list_to_string(c);
break;
case 5:
- t = pa_module_list_to_string(c);
+ t = pa_card_list_to_string(c);
break;
case 6:
- t = pa_scache_list_to_string(c);
+ t = pa_module_list_to_string(c);
break;
case 7:
+ t = pa_scache_list_to_string(c);
+ break;
+ case 8:
t = pa_autoload_list_to_string(c);
break;
}