mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	include list of sinks/source in card dump
This commit is contained in:
		
							parent
							
								
									967c17a190
								
							
						
					
					
						commit
						d5e088ded7
					
				
					 1 changed files with 17 additions and 3 deletions
				
			
		| 
						 | 
					@ -117,6 +117,10 @@ char *pa_card_list_to_string(pa_core *c) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (card = pa_idxset_first(c->cards, &idx); card; card = pa_idxset_next(c->cards, &idx)) {
 | 
					    for (card = pa_idxset_first(c->cards, &idx); card; card = pa_idxset_next(c->cards, &idx)) {
 | 
				
			||||||
        char *t;
 | 
					        char *t;
 | 
				
			||||||
 | 
					        pa_sink *sink;
 | 
				
			||||||
 | 
					        pa_source *source;
 | 
				
			||||||
 | 
					        uint32_t sidx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        pa_strbuf_printf(
 | 
					        pa_strbuf_printf(
 | 
				
			||||||
                s,
 | 
					                s,
 | 
				
			||||||
                "    index: %u\n"
 | 
					                "    index: %u\n"
 | 
				
			||||||
| 
						 | 
					@ -137,9 +141,7 @@ char *pa_card_list_to_string(pa_core *c) {
 | 
				
			||||||
            pa_card_profile *p;
 | 
					            pa_card_profile *p;
 | 
				
			||||||
            void *state = NULL;
 | 
					            void *state = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            pa_strbuf_puts(
 | 
					            pa_strbuf_puts(s, "\tprofiles:\n");
 | 
				
			||||||
                    s,
 | 
					 | 
				
			||||||
                    "\tprofiles:\n");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            while ((p = pa_hashmap_iterate(card->profiles, &state, NULL)))
 | 
					            while ((p = pa_hashmap_iterate(card->profiles, &state, NULL)))
 | 
				
			||||||
                pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
 | 
					                pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
 | 
				
			||||||
| 
						 | 
					@ -150,6 +152,18 @@ char *pa_card_list_to_string(pa_core *c) {
 | 
				
			||||||
                    s,
 | 
					                    s,
 | 
				
			||||||
                    "\tactive profile: <%s>\n",
 | 
					                    "\tactive profile: <%s>\n",
 | 
				
			||||||
                    card->active_profile->name);
 | 
					                    card->active_profile->name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!pa_idxset_isempty(card->sinks)) {
 | 
				
			||||||
 | 
					            pa_strbuf_puts(s, "\tsinks:\n");
 | 
				
			||||||
 | 
					            for (sink = pa_idxset_first(card->sinks, &sidx); sink; sink = pa_idxset_next(card->sinks, &sidx))
 | 
				
			||||||
 | 
					                pa_strbuf_printf(s, "\t\t%s/#%u: %s\n", sink->name, sink->index, pa_strna(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_DESCRIPTION)));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!pa_idxset_isempty(card->sources)) {
 | 
				
			||||||
 | 
					            pa_strbuf_puts(s, "\tsources:\n");
 | 
				
			||||||
 | 
					            for (source = pa_idxset_first(card->sources, &sidx); source; source = pa_idxset_next(card->sources, &sidx))
 | 
				
			||||||
 | 
					                pa_strbuf_printf(s, "\t\t%s/#%u: %s\n", source->name, source->index, pa_strna(pa_proplist_gets(source->proplist, PA_PROP_DEVICE_DESCRIPTION)));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return pa_strbuf_tostring_free(s);
 | 
					    return pa_strbuf_tostring_free(s);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue