]> code.delx.au - pulseaudio/blob - src/pulsecore/cli-text.c
0f4a273dff19e30949a26983e5993ff881b4d411
[pulseaudio] / src / pulsecore / cli-text.c
1 /***
2 This file is part of PulseAudio.
3
4 Copyright 2004-2006 Lennart Poettering
5
6 PulseAudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2 of the License,
9 or (at your option) any later version.
10
11 PulseAudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with PulseAudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA.
20 ***/
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <string.h>
27
28 #include <pulse/volume.h>
29 #include <pulse/xmalloc.h>
30 #include <pulse/timeval.h>
31
32 #include <pulsecore/module.h>
33 #include <pulsecore/client.h>
34 #include <pulsecore/sink.h>
35 #include <pulsecore/source.h>
36 #include <pulsecore/sink-input.h>
37 #include <pulsecore/source-output.h>
38 #include <pulsecore/strbuf.h>
39 #include <pulsecore/sample-util.h>
40 #include <pulsecore/core-scache.h>
41 #include <pulsecore/macro.h>
42 #include <pulsecore/core-util.h>
43
44 #include "cli-text.h"
45
46 char *pa_module_list_to_string(pa_core *c) {
47 pa_strbuf *s;
48 pa_module *m;
49 uint32_t idx = PA_IDXSET_INVALID;
50 pa_assert(c);
51
52 s = pa_strbuf_new();
53
54 pa_strbuf_printf(s, "%u module(s) loaded.\n", pa_idxset_size(c->modules));
55
56 for (m = pa_idxset_first(c->modules, &idx); m; m = pa_idxset_next(c->modules, &idx)) {
57 pa_strbuf_printf(s, " index: %u\n"
58 "\tname: <%s>\n"
59 "\targument: <%s>\n"
60 "\tused: %i\n"
61 "\tload once: %s\n",
62 m->index,
63 m->name,
64 pa_strempty(m->argument),
65 pa_module_get_n_used(m),
66 pa_yes_no(m->load_once));
67 }
68
69 return pa_strbuf_tostring_free(s);
70 }
71
72 char *pa_client_list_to_string(pa_core *c) {
73 pa_strbuf *s;
74 pa_client *client;
75 uint32_t idx = PA_IDXSET_INVALID;
76 pa_assert(c);
77
78 s = pa_strbuf_new();
79
80 pa_strbuf_printf(s, "%u client(s) logged in.\n", pa_idxset_size(c->clients));
81
82 for (client = pa_idxset_first(c->clients, &idx); client; client = pa_idxset_next(c->clients, &idx)) {
83 char *t;
84 pa_strbuf_printf(
85 s,
86 " index: %u\n"
87 "\tdriver: <%s>\n",
88 client->index,
89 client->driver);
90
91 if (client->module)
92 pa_strbuf_printf(s, "\towner module: %u\n", client->module->index);
93
94 t = pa_proplist_to_string(client->proplist);
95 pa_strbuf_printf(s, "\tproperties:\n%s", t);
96 pa_xfree(t);
97 }
98
99 return pa_strbuf_tostring_free(s);
100 }
101
102 char *pa_card_list_to_string(pa_core *c) {
103 pa_strbuf *s;
104 pa_card *card;
105 uint32_t idx = PA_IDXSET_INVALID;
106 pa_assert(c);
107
108 s = pa_strbuf_new();
109
110 pa_strbuf_printf(s, "%u card(s) available in.\n", pa_idxset_size(c->cards));
111
112 for (card = pa_idxset_first(c->cards, &idx); card; card = pa_idxset_next(c->cards, &idx)) {
113 char *t;
114 pa_strbuf_printf(
115 s,
116 " index: %u\n"
117 "\tname: <%s>\n"
118 "\tdriver: <%s>\n",
119 card->index,
120 card->name,
121 card->driver);
122
123 if (card->module)
124 pa_strbuf_printf(s, "\towner module: %u\n", card->module->index);
125
126 t = pa_proplist_to_string(card->proplist);
127 pa_strbuf_printf(s, "\tproperties:\n%s", t);
128 pa_xfree(t);
129 }
130
131 return pa_strbuf_tostring_free(s);
132 }
133
134 char *pa_sink_list_to_string(pa_core *c) {
135 pa_strbuf *s;
136 pa_sink *sink;
137 uint32_t idx = PA_IDXSET_INVALID;
138 static const char* const state_table[] = {
139 [PA_SINK_INIT] = "INIT",
140 [PA_SINK_RUNNING] = "RUNNING",
141 [PA_SINK_SUSPENDED] = "SUSPENDED",
142 [PA_SINK_IDLE] = "IDLE",
143 [PA_SINK_UNLINKED] = "UNLINKED"
144 };
145 pa_assert(c);
146
147 s = pa_strbuf_new();
148
149 pa_strbuf_printf(s, "%u sink(s) available.\n", pa_idxset_size(c->sinks));
150
151 for (sink = pa_idxset_first(c->sinks, &idx); sink; sink = pa_idxset_next(c->sinks, &idx)) {
152 char ss[PA_SAMPLE_SPEC_SNPRINT_MAX],
153 cv[PA_CVOLUME_SNPRINT_MAX],
154 cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX],
155 v[PA_VOLUME_SNPRINT_MAX],
156 vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
157 cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
158 pa_usec_t min_latency, max_latency;
159
160 pa_sink_get_latency_range(sink, &min_latency, &max_latency);
161
162 pa_strbuf_printf(
163 s,
164 " %c index: %u\n"
165 "\tname: <%s>\n"
166 "\tdriver: <%s>\n"
167 "\tflags: %s%s%s%s%s%s\n"
168 "\tstate: %s\n"
169 "\tvolume: %s%s%s\n"
170 "\tbase volume: %s%s%s\n"
171 "\tmuted: %s\n"
172 "\tcurrent latency: %0.2f ms\n"
173 "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n"
174 "\tmax request: %lu KiB\n"
175 "\tmax rewind: %lu KiB\n"
176 "\tmonitor source: %u\n"
177 "\tsample spec: %s\n"
178 "\tchannel map: %s\n"
179 "\tused by: %u\n"
180 "\tlinked by: %u\n",
181 c->default_sink_name && !strcmp(sink->name, c->default_sink_name) ? '*' : ' ',
182 sink->index,
183 sink->name,
184 sink->driver,
185 sink->flags & PA_SINK_HARDWARE ? "HARDWARE " : "",
186 sink->flags & PA_SINK_NETWORK ? "NETWORK " : "",
187 sink->flags & PA_SINK_HW_MUTE_CTRL ? "HW_MUTE_CTRL " : "",
188 sink->flags & PA_SINK_HW_VOLUME_CTRL ? "HW_VOLUME_CTRL " : "",
189 sink->flags & PA_SINK_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
190 sink->flags & PA_SINK_LATENCY ? "LATENCY " : "",
191 state_table[pa_sink_get_state(sink)],
192 pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, FALSE)),
193 sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
194 sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_sink_get_volume(sink, FALSE)) : "",
195 pa_volume_snprint(v, sizeof(v), sink->base_volume),
196 sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
197 sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), sink->base_volume) : "",
198 pa_yes_no(pa_sink_get_mute(sink, FALSE)),
199 (double) pa_sink_get_latency(sink) / (double) PA_USEC_PER_MSEC,
200 (double) pa_sink_get_requested_latency(sink) / (double) PA_USEC_PER_MSEC,
201 (double) min_latency / PA_USEC_PER_MSEC,
202 (double) max_latency / PA_USEC_PER_MSEC,
203 (unsigned long) pa_sink_get_max_request(sink) / 1024,
204 (unsigned long) pa_sink_get_max_rewind(sink) / 1024,
205 sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
206 pa_sample_spec_snprint(ss, sizeof(ss), &sink->sample_spec),
207 pa_channel_map_snprint(cm, sizeof(cm), &sink->channel_map),
208 pa_sink_used_by(sink),
209 pa_sink_linked_by(sink));
210
211 if (sink->card)
212 pa_strbuf_printf(s, "\tcard: %u <%s>\n", sink->card->index, sink->card->name);
213 if (sink->module)
214 pa_strbuf_printf(s, "\tmodule: %u\n", sink->module->index);
215
216 t = pa_proplist_to_string(sink->proplist);
217 pa_strbuf_printf(s, "\tproperties:\n%s", t);
218 pa_xfree(t);
219 }
220
221 return pa_strbuf_tostring_free(s);
222 }
223
224 char *pa_source_list_to_string(pa_core *c) {
225 pa_strbuf *s;
226 pa_source *source;
227 uint32_t idx = PA_IDXSET_INVALID;
228 static const char* const state_table[] = {
229 [PA_SOURCE_INIT] = "INIT",
230 [PA_SOURCE_RUNNING] = "RUNNING",
231 [PA_SOURCE_SUSPENDED] = "SUSPENDED",
232 [PA_SOURCE_IDLE] = "IDLE",
233 [PA_SOURCE_UNLINKED] = "UNLINKED"
234 };
235 pa_assert(c);
236
237 s = pa_strbuf_new();
238
239 pa_strbuf_printf(s, "%u source(s) available.\n", pa_idxset_size(c->sources));
240
241 for (source = pa_idxset_first(c->sources, &idx); source; source = pa_idxset_next(c->sources, &idx)) {
242 char ss[PA_SAMPLE_SPEC_SNPRINT_MAX],
243 cv[PA_CVOLUME_SNPRINT_MAX],
244 cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX],
245 v[PA_VOLUME_SNPRINT_MAX],
246 vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
247 cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
248 pa_usec_t min_latency, max_latency;
249
250 pa_source_get_latency_range(source, &min_latency, &max_latency);
251
252 pa_strbuf_printf(
253 s,
254 " %c index: %u\n"
255 "\tname: <%s>\n"
256 "\tdriver: <%s>\n"
257 "\tflags: %s%s%s%s%s%s\n"
258 "\tstate: %s\n"
259 "\tvolume: %s%s%s\n"
260 "\tbase volume: %s%s%s\n"
261 "\tmuted: %s\n"
262 "\tcurrent latency: %0.2f ms\n"
263 "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n"
264 "\tmax rewind: %lu KiB\n"
265 "\tsample spec: %s\n"
266 "\tchannel map: %s\n"
267 "\tused by: %u\n"
268 "\tlinked by: %u\n",
269 c->default_source_name && !strcmp(source->name, c->default_source_name) ? '*' : ' ',
270 source->index,
271 source->name,
272 source->driver,
273 source->flags & PA_SOURCE_HARDWARE ? "HARDWARE " : "",
274 source->flags & PA_SOURCE_NETWORK ? "NETWORK " : "",
275 source->flags & PA_SOURCE_HW_MUTE_CTRL ? "HW_MUTE_CTRL " : "",
276 source->flags & PA_SOURCE_HW_VOLUME_CTRL ? "HW_VOLUME_CTRL " : "",
277 source->flags & PA_SOURCE_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
278 source->flags & PA_SOURCE_LATENCY ? "LATENCY " : "",
279 state_table[pa_source_get_state(source)],
280 pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source, FALSE)),
281 source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
282 source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_source_get_volume(source, FALSE)) : "",
283 pa_volume_snprint(v, sizeof(v), source->base_volume),
284 source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
285 source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), source->base_volume) : "",
286 pa_yes_no(pa_source_get_mute(source, FALSE)),
287 (double) pa_source_get_latency(source) / PA_USEC_PER_MSEC,
288 (double) pa_source_get_requested_latency(source) / PA_USEC_PER_MSEC,
289 (double) min_latency / PA_USEC_PER_MSEC,
290 (double) max_latency / PA_USEC_PER_MSEC,
291 (unsigned long) pa_source_get_max_rewind(source) / 1024,
292 pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
293 pa_channel_map_snprint(cm, sizeof(cm), &source->channel_map),
294 pa_source_used_by(source),
295 pa_source_linked_by(source));
296
297 if (source->monitor_of)
298 pa_strbuf_printf(s, "\tmonitor_of: %u\n", source->monitor_of->index);
299 if (source->card)
300 pa_strbuf_printf(s, "\tcard: %u <%s>\n", source->card->index, source->card->name);
301 if (source->module)
302 pa_strbuf_printf(s, "\tmodule: %u\n", source->module->index);
303
304 t = pa_proplist_to_string(source->proplist);
305 pa_strbuf_printf(s, "\tproperties:\n%s", t);
306 pa_xfree(t);
307 }
308
309 return pa_strbuf_tostring_free(s);
310 }
311
312
313 char *pa_source_output_list_to_string(pa_core *c) {
314 pa_strbuf *s;
315 pa_source_output *o;
316 uint32_t idx = PA_IDXSET_INVALID;
317 static const char* const state_table[] = {
318 [PA_SOURCE_OUTPUT_INIT] = "INIT",
319 [PA_SOURCE_OUTPUT_RUNNING] = "RUNNING",
320 [PA_SOURCE_OUTPUT_CORKED] = "CORKED",
321 [PA_SOURCE_OUTPUT_UNLINKED] = "UNLINKED"
322 };
323 pa_assert(c);
324
325 s = pa_strbuf_new();
326
327 pa_strbuf_printf(s, "%u source outputs(s) available.\n", pa_idxset_size(c->source_outputs));
328
329 for (o = pa_idxset_first(c->source_outputs, &idx); o; o = pa_idxset_next(c->source_outputs, &idx)) {
330 char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
331 pa_usec_t cl;
332
333 if ((cl = pa_source_output_get_requested_latency(o)) == (pa_usec_t) -1)
334 pa_snprintf(clt, sizeof(clt), "n/a");
335 else
336 pa_snprintf(clt, sizeof(clt), "%0.2f ms", (double) cl / PA_USEC_PER_MSEC);
337
338 pa_assert(o->source);
339
340 pa_strbuf_printf(
341 s,
342 " index: %u\n"
343 "\tdriver: <%s>\n"
344 "\tflags: %s%s%s%s%s%s%s%s\n"
345 "\tstate: %s\n"
346 "\tsource: %u <%s>\n"
347 "\tcurrent latency: %0.2f ms\n"
348 "\trequested latency: %s\n"
349 "\tsample spec: %s\n"
350 "\tchannel map: %s\n"
351 "\tresample method: %s\n",
352 o->index,
353 o->driver,
354 o->flags & PA_SOURCE_OUTPUT_VARIABLE_RATE ? "VARIABLE_RATE " : "",
355 o->flags & PA_SOURCE_OUTPUT_DONT_MOVE ? "DONT_MOVE " : "",
356 o->flags & PA_SOURCE_OUTPUT_START_CORKED ? "START_CORKED " : "",
357 o->flags & PA_SOURCE_OUTPUT_NO_REMAP ? "NO_REMAP " : "",
358 o->flags & PA_SOURCE_OUTPUT_NO_REMIX ? "NO_REMIX " : "",
359 o->flags & PA_SOURCE_OUTPUT_FIX_FORMAT ? "FIX_FORMAT " : "",
360 o->flags & PA_SOURCE_OUTPUT_FIX_RATE ? "FIX_RATE " : "",
361 o->flags & PA_SOURCE_OUTPUT_FIX_CHANNELS ? "FIX_CHANNELS " : "",
362 state_table[pa_source_output_get_state(o)],
363 o->source->index, o->source->name,
364 (double) pa_source_output_get_latency(o, NULL) / PA_USEC_PER_MSEC,
365 clt,
366 pa_sample_spec_snprint(ss, sizeof(ss), &o->sample_spec),
367 pa_channel_map_snprint(cm, sizeof(cm), &o->channel_map),
368 pa_resample_method_to_string(pa_source_output_get_resample_method(o)));
369 if (o->module)
370 pa_strbuf_printf(s, "\towner module: %u\n", o->module->index);
371 if (o->client)
372 pa_strbuf_printf(s, "\tclient: %u <%s>\n", o->client->index, pa_strnull(pa_proplist_gets(o->client->proplist, PA_PROP_APPLICATION_NAME)));
373 if (o->direct_on_input)
374 pa_strbuf_printf(s, "\tdirect on input: %u\n", o->direct_on_input->index);
375
376 t = pa_proplist_to_string(o->proplist);
377 pa_strbuf_printf(s, "\tproperties:\n%s", t);
378 pa_xfree(t);
379 }
380
381 return pa_strbuf_tostring_free(s);
382 }
383
384 char *pa_sink_input_list_to_string(pa_core *c) {
385 pa_strbuf *s;
386 pa_sink_input *i;
387 uint32_t idx = PA_IDXSET_INVALID;
388 static const char* const state_table[] = {
389 [PA_SINK_INPUT_INIT] = "INIT",
390 [PA_SINK_INPUT_RUNNING] = "RUNNING",
391 [PA_SINK_INPUT_DRAINED] = "DRAINED",
392 [PA_SINK_INPUT_CORKED] = "CORKED",
393 [PA_SINK_INPUT_UNLINKED] = "UNLINKED"
394 };
395
396 pa_assert(c);
397 s = pa_strbuf_new();
398
399 pa_strbuf_printf(s, "%u sink input(s) available.\n", pa_idxset_size(c->sink_inputs));
400
401 for (i = pa_idxset_first(c->sink_inputs, &idx); i; i = pa_idxset_next(c->sink_inputs, &idx)) {
402 char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t, clt[28];
403 pa_usec_t cl;
404
405 if ((cl = pa_sink_input_get_requested_latency(i)) == (pa_usec_t) -1)
406 pa_snprintf(clt, sizeof(clt), "n/a");
407 else
408 pa_snprintf(clt, sizeof(clt), "%0.2f ms", (double) cl / PA_USEC_PER_MSEC);
409
410 pa_assert(i->sink);
411
412 pa_strbuf_printf(
413 s,
414 " index: %u\n"
415 "\tdriver: <%s>\n"
416 "\tflags: %s%s%s%s%s%s%s%s\n"
417 "\tstate: %s\n"
418 "\tsink: %u <%s>\n"
419 "\tvolume: %s\n"
420 "\tmuted: %s\n"
421 "\tcurrent latency: %0.2f ms\n"
422 "\trequested latency: %s\n"
423 "\tsample spec: %s\n"
424 "\tchannel map: %s\n"
425 "\tresample method: %s\n",
426 i->index,
427 i->driver,
428 i->flags & PA_SINK_INPUT_VARIABLE_RATE ? "VARIABLE_RATE " : "",
429 i->flags & PA_SINK_INPUT_DONT_MOVE ? "DONT_MOVE " : "",
430 i->flags & PA_SINK_INPUT_START_CORKED ? "START_CORKED " : "",
431 i->flags & PA_SINK_INPUT_NO_REMAP ? "NO_REMAP " : "",
432 i->flags & PA_SINK_INPUT_NO_REMIX ? "NO_REMIX " : "",
433 i->flags & PA_SINK_INPUT_FIX_FORMAT ? "FIX_FORMAT " : "",
434 i->flags & PA_SINK_INPUT_FIX_RATE ? "FIX_RATE " : "",
435 i->flags & PA_SINK_INPUT_FIX_CHANNELS ? "FIX_CHANNELS " : "",
436 state_table[pa_sink_input_get_state(i)],
437 i->sink->index, i->sink->name,
438 pa_cvolume_snprint(cv, sizeof(cv), pa_sink_input_get_volume(i)),
439 pa_yes_no(pa_sink_input_get_mute(i)),
440 (double) pa_sink_input_get_latency(i, NULL) / PA_USEC_PER_MSEC,
441 clt,
442 pa_sample_spec_snprint(ss, sizeof(ss), &i->sample_spec),
443 pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map),
444 pa_resample_method_to_string(pa_sink_input_get_resample_method(i)));
445
446 if (i->module)
447 pa_strbuf_printf(s, "\tmodule: %u\n", i->module->index);
448 if (i->client)
449 pa_strbuf_printf(s, "\tclient: %u <%s>\n", i->client->index, pa_strnull(pa_proplist_gets(i->client->proplist, PA_PROP_APPLICATION_NAME)));
450
451 t = pa_proplist_to_string(i->proplist);
452 pa_strbuf_printf(s, "\tproperties:\n%s", t);
453 pa_xfree(t);
454 }
455
456 return pa_strbuf_tostring_free(s);
457 }
458
459 char *pa_scache_list_to_string(pa_core *c) {
460 pa_strbuf *s;
461 pa_assert(c);
462
463 s = pa_strbuf_new();
464
465 pa_strbuf_printf(s, "%u cache entries available.\n", c->scache ? pa_idxset_size(c->scache) : 0);
466
467 if (c->scache) {
468 pa_scache_entry *e;
469 uint32_t idx = PA_IDXSET_INVALID;
470
471 for (e = pa_idxset_first(c->scache, &idx); e; e = pa_idxset_next(c->scache, &idx)) {
472 double l = 0;
473 char ss[PA_SAMPLE_SPEC_SNPRINT_MAX] = "n/a", cv[PA_CVOLUME_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX] = "n/a", *t;
474
475 if (e->memchunk.memblock) {
476 pa_sample_spec_snprint(ss, sizeof(ss), &e->sample_spec);
477 pa_channel_map_snprint(cm, sizeof(cm), &e->channel_map);
478 l = (double) e->memchunk.length / (double) pa_bytes_per_second(&e->sample_spec);
479 }
480
481 pa_strbuf_printf(
482 s,
483 " name: <%s>\n"
484 "\tindex: %u\n"
485 "\tsample spec: %s\n"
486 "\tchannel map: %s\n"
487 "\tlength: %lu\n"
488 "\tduration: %0.1f s\n"
489 "\tvolume: %s\n"
490 "\tlazy: %s\n"
491 "\tfilename: <%s>\n",
492 e->name,
493 e->index,
494 ss,
495 cm,
496 (long unsigned)(e->memchunk.memblock ? e->memchunk.length : 0),
497 l,
498 pa_cvolume_snprint(cv, sizeof(cv), &e->volume),
499 pa_yes_no(e->lazy),
500 e->filename ? e->filename : "n/a");
501
502 t = pa_proplist_to_string(e->proplist);
503 pa_strbuf_printf(s, "\tproperties:\n%s", t);
504 pa_xfree(t);
505 }
506 }
507
508 return pa_strbuf_tostring_free(s);
509 }
510
511 char *pa_full_status_string(pa_core *c) {
512 pa_strbuf *s;
513 int i;
514
515 s = pa_strbuf_new();
516
517 for (i = 0; i < 8; i++) {
518 char *t = NULL;
519
520 switch (i) {
521 case 0:
522 t = pa_sink_list_to_string(c);
523 break;
524 case 1:
525 t = pa_source_list_to_string(c);
526 break;
527 case 2:
528 t = pa_sink_input_list_to_string(c);
529 break;
530 case 3:
531 t = pa_source_output_list_to_string(c);
532 break;
533 case 4:
534 t = pa_client_list_to_string(c);
535 break;
536 case 5:
537 t = pa_card_list_to_string(c);
538 break;
539 case 6:
540 t = pa_module_list_to_string(c);
541 break;
542 case 7:
543 t = pa_scache_list_to_string(c);
544 break;
545 }
546
547 pa_strbuf_puts(s, t);
548 pa_xfree(t);
549 }
550
551 return pa_strbuf_tostring_free(s);
552 }