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