mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
add new function pa_card_suspend()
This commit is contained in:
parent
bdfec1feba
commit
36362f624f
2 changed files with 19 additions and 0 deletions
|
|
@ -235,3 +235,20 @@ int pa_card_set_profile(pa_card *c, const char *name) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pa_card_suspend(pa_card *c, pa_bool_t suspend) {
|
||||||
|
pa_sink *sink;
|
||||||
|
pa_source *source;
|
||||||
|
uint32_t idx;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
pa_assert(c);
|
||||||
|
|
||||||
|
for (sink = pa_idxset_first(c->sinks, &idx); sink; sink = pa_idxset_next(c->sinks, &idx))
|
||||||
|
ret -= pa_sink_suspend(sink, suspend) < 0;
|
||||||
|
|
||||||
|
for (source = pa_idxset_first(c->sources, &idx); source; source = pa_idxset_next(c->sources, &idx))
|
||||||
|
ret -= pa_source_suspend(source, suspend) < 0;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,4 +95,6 @@ void pa_card_free(pa_card *c);
|
||||||
|
|
||||||
int pa_card_set_profile(pa_card *c, const char *name);
|
int pa_card_set_profile(pa_card *c, const char *name);
|
||||||
|
|
||||||
|
int pa_card_suspend(pa_card *c, pa_bool_t suspend);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue