From 4ab60d03778bf1e680d29c6ff37266978df44aa5 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 16 May 2011 22:23:24 +0100 Subject: 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'. --- src/utils/pactl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/utils') 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"), -- cgit