summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/cli-text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/cli-text.c')
-rw-r--r--src/pulsecore/cli-text.c67
1 files changed, 49 insertions, 18 deletions
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index 0f4a273d..79620398 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.c
@@ -54,6 +54,8 @@ char *pa_module_list_to_string(pa_core *c) {
pa_strbuf_printf(s, "%u module(s) loaded.\n", pa_idxset_size(c->modules));
for (m = pa_idxset_first(c->modules, &idx); m; m = pa_idxset_next(c->modules, &idx)) {
+ char *t;
+
pa_strbuf_printf(s, " index: %u\n"
"\tname: <%s>\n"
"\targument: <%s>\n"
@@ -64,6 +66,10 @@ char *pa_module_list_to_string(pa_core *c) {
pa_strempty(m->argument),
pa_module_get_n_used(m),
pa_yes_no(m->load_once));
+
+ t = pa_proplist_to_string_sep(m->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
+ pa_xfree(t);
}
return pa_strbuf_tostring_free(s);
@@ -91,8 +97,8 @@ char *pa_client_list_to_string(pa_core *c) {
if (client->module)
pa_strbuf_printf(s, "\towner module: %u\n", client->module->index);
- t = pa_proplist_to_string(client->proplist);
- pa_strbuf_printf(s, "\tproperties:\n%s", t);
+ t = pa_proplist_to_string_sep(client->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
}
@@ -107,7 +113,7 @@ char *pa_card_list_to_string(pa_core *c) {
s = pa_strbuf_new();
- pa_strbuf_printf(s, "%u card(s) available in.\n", pa_idxset_size(c->cards));
+ pa_strbuf_printf(s, "%u card(s) available.\n", pa_idxset_size(c->cards));
for (card = pa_idxset_first(c->cards, &idx); card; card = pa_idxset_next(c->cards, &idx)) {
char *t;
@@ -123,9 +129,22 @@ char *pa_card_list_to_string(pa_core *c) {
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);
+ t = pa_proplist_to_string_sep(card->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
+
+ if (card->profiles) {
+ pa_card_profile *p;
+ void *state = NULL;
+
+ pa_strbuf_puts(
+ s,
+ "\tprofiles:\n");
+
+ while ((p = pa_hashmap_iterate(card->profiles, &state, NULL)))
+ pa_strbuf_printf(s, "\t\t%s: %s\n", p->name, p->description);
+ }
+
}
return pa_strbuf_tostring_free(s);
@@ -167,6 +186,7 @@ char *pa_sink_list_to_string(pa_core *c) {
"\tflags: %s%s%s%s%s%s\n"
"\tstate: %s\n"
"\tvolume: %s%s%s\n"
+ "\t balance %0.2f\n"
"\tbase volume: %s%s%s\n"
"\tmuted: %s\n"
"\tcurrent latency: %0.2f ms\n"
@@ -192,6 +212,7 @@ char *pa_sink_list_to_string(pa_core *c) {
pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, FALSE)),
sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_sink_get_volume(sink, FALSE)) : "",
+ pa_cvolume_get_balance(&sink->channel_map, pa_sink_get_volume(sink, FALSE)),
pa_volume_snprint(v, sizeof(v), sink->base_volume),
sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), sink->base_volume) : "",
@@ -213,8 +234,8 @@ char *pa_sink_list_to_string(pa_core *c) {
if (sink->module)
pa_strbuf_printf(s, "\tmodule: %u\n", sink->module->index);
- t = pa_proplist_to_string(sink->proplist);
- pa_strbuf_printf(s, "\tproperties:\n%s", t);
+ t = pa_proplist_to_string_sep(sink->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
}
@@ -257,6 +278,7 @@ char *pa_source_list_to_string(pa_core *c) {
"\tflags: %s%s%s%s%s%s\n"
"\tstate: %s\n"
"\tvolume: %s%s%s\n"
+ "\t balance %0.2f\n"
"\tbase volume: %s%s%s\n"
"\tmuted: %s\n"
"\tcurrent latency: %0.2f ms\n"
@@ -280,6 +302,7 @@ char *pa_source_list_to_string(pa_core *c) {
pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source, FALSE)),
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_source_get_volume(source, FALSE)) : "",
+ pa_cvolume_get_balance(&source->channel_map, pa_source_get_volume(source, FALSE)),
pa_volume_snprint(v, sizeof(v), source->base_volume),
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), source->base_volume) : "",
@@ -301,8 +324,8 @@ char *pa_source_list_to_string(pa_core *c) {
if (source->module)
pa_strbuf_printf(s, "\tmodule: %u\n", source->module->index);
- t = pa_proplist_to_string(source->proplist);
- pa_strbuf_printf(s, "\tproperties:\n%s", t);
+ t = pa_proplist_to_string_sep(source->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
}
@@ -373,8 +396,8 @@ char *pa_source_output_list_to_string(pa_core *c) {
if (o->direct_on_input)
pa_strbuf_printf(s, "\tdirect on input: %u\n", o->direct_on_input->index);
- t = pa_proplist_to_string(o->proplist);
- pa_strbuf_printf(s, "\tproperties:\n%s", t);
+ t = pa_proplist_to_string_sep(o->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
}
@@ -399,7 +422,7 @@ char *pa_sink_input_list_to_string(pa_core *c) {
pa_strbuf_printf(s, "%u sink input(s) available.\n", pa_idxset_size(c->sink_inputs));
for (i = pa_idxset_first(c->sink_inputs, &idx); i; i = pa_idxset_next(c->sink_inputs, &idx)) {
- char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
+ char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
pa_usec_t cl;
if ((cl = pa_sink_input_get_requested_latency(i)) == (pa_usec_t) -1)
@@ -417,6 +440,8 @@ char *pa_sink_input_list_to_string(pa_core *c) {
"\tstate: %s\n"
"\tsink: %u <%s>\n"
"\tvolume: %s\n"
+ "\t %s\n"
+ "\t balance %0.2f\n"
"\tmuted: %s\n"
"\tcurrent latency: %0.2f ms\n"
"\trequested latency: %s\n"
@@ -436,6 +461,8 @@ char *pa_sink_input_list_to_string(pa_core *c) {
state_table[pa_sink_input_get_state(i)],
i->sink->index, i->sink->name,
pa_cvolume_snprint(cv, sizeof(cv), pa_sink_input_get_volume(i)),
+ pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_sink_input_get_volume(i)),
+ pa_cvolume_get_balance(&i->channel_map, pa_sink_input_get_volume(i)),
pa_yes_no(pa_sink_input_get_mute(i)),
(double) pa_sink_input_get_latency(i, NULL) / PA_USEC_PER_MSEC,
clt,
@@ -448,8 +475,8 @@ char *pa_sink_input_list_to_string(pa_core *c) {
if (i->client)
pa_strbuf_printf(s, "\tclient: %u <%s>\n", i->client->index, pa_strnull(pa_proplist_gets(i->client->proplist, PA_PROP_APPLICATION_NAME)));
- t = pa_proplist_to_string(i->proplist);
- pa_strbuf_printf(s, "\tproperties:\n%s", t);
+ t = pa_proplist_to_string_sep(i->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
}
@@ -462,7 +489,7 @@ char *pa_scache_list_to_string(pa_core *c) {
s = pa_strbuf_new();
- pa_strbuf_printf(s, "%u cache entries available.\n", c->scache ? pa_idxset_size(c->scache) : 0);
+ pa_strbuf_printf(s, "%u cache entrie(s) available.\n", c->scache ? pa_idxset_size(c->scache) : 0);
if (c->scache) {
pa_scache_entry *e;
@@ -470,7 +497,7 @@ char *pa_scache_list_to_string(pa_core *c) {
for (e = pa_idxset_first(c->scache, &idx); e; e = pa_idxset_next(c->scache, &idx)) {
double l = 0;
- char ss[PA_SAMPLE_SPEC_SNPRINT_MAX] = "n/a", cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX] = "n/a", *t;
+ char ss[PA_SAMPLE_SPEC_SNPRINT_MAX] = "n/a", cv[PA_CVOLUME_SNPRINT_MAX], cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX] = "n/a", *t;
if (e->memchunk.memblock) {
pa_sample_spec_snprint(ss, sizeof(ss), &e->sample_spec);
@@ -487,6 +514,8 @@ char *pa_scache_list_to_string(pa_core *c) {
"\tlength: %lu\n"
"\tduration: %0.1f s\n"
"\tvolume: %s\n"
+ "\t %s\n"
+ "\t balance %0.2f\n"
"\tlazy: %s\n"
"\tfilename: <%s>\n",
e->name,
@@ -496,11 +525,13 @@ char *pa_scache_list_to_string(pa_core *c) {
(long unsigned)(e->memchunk.memblock ? e->memchunk.length : 0),
l,
pa_cvolume_snprint(cv, sizeof(cv), &e->volume),
+ pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), &e->volume),
+ e->memchunk.memblock ? pa_cvolume_get_balance(&e->channel_map, &e->volume) : 0.0f,
pa_yes_no(e->lazy),
e->filename ? e->filename : "n/a");
- t = pa_proplist_to_string(e->proplist);
- pa_strbuf_printf(s, "\tproperties:\n%s", t);
+ t = pa_proplist_to_string_sep(e->proplist, "\n\t\t");
+ pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
}
}