summaryrefslogtreecommitdiffstats
path: root/src/utils/pactl.c
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-05-16 22:23:24 +0100
committerColin Guthrie <colin@mageia.org>2011-06-22 22:45:27 +0100
commit4ab60d03778bf1e680d29c6ff37266978df44aa5 (patch)
tree3a68fcaf3e29bc798e5947d7d65b961975c0e373 /src/utils/pactl.c
parentdffc4d18d3a9f608f8b316f1e7057d13978ef44f (diff)
introspect: Get format of source output
This gets the negotiated format of source outputs in pa_context_get_source_output*(). Also prints the format and volume in 'pactl list'.
Diffstat (limited to 'src/utils/pactl.c')
-rw-r--r--src/utils/pactl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 894f8f7e..3bf983ec 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -639,7 +639,7 @@ static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info
}
static void get_source_output_info_callback(pa_context *c, const pa_source_output_info *i, int is_last, void *userdata) {
- char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX];
+ char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], f[PA_FORMAT_INFO_SNPRINT_MAX];
char *pl;
if (is_last < 0) {
@@ -680,6 +680,11 @@ static void get_source_output_info_callback(pa_context *c, const pa_source_outpu
"\tSource: %u\n"
"\tSample Specification: %s\n"
"\tChannel Map: %s\n"
+ "\tFormat: %s\n"
+ "\tMute: %s\n"
+ "\tVolume: %s\n"
+ "\t %s\n"
+ "\t balance %0.2f\n"
"\tBuffer Latency: %0.0f usec\n"
"\tSource Latency: %0.0f usec\n"
"\tResample method: %s\n"
@@ -691,6 +696,11 @@ static void get_source_output_info_callback(pa_context *c, const pa_source_outpu
i->source,
pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec),
pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map),
+ pa_format_info_snprint(f, sizeof(f), i->format),
+ pa_yes_no(i->mute),
+ pa_cvolume_snprint(cv, sizeof(cv), &i->volume),
+ pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), &i->volume),
+ pa_cvolume_get_balance(&i->volume, &i->channel_map),
(double) i->buffer_usec,
(double) i->source_usec,
i->resample_method ? i->resample_method : _("n/a"),