summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-22 00:17:11 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-22 00:17:11 +0100
commit36362f624f985c14f757884c6d4fd6a079a4701b (patch)
tree7e0516d7a13e1eef7c162d8e1d449838aba077e4 /src/pulsecore
parentbdfec1feba2585aaa5ad88a2760da5c38f3466e9 (diff)
add new function pa_card_suspend()
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/card.c17
-rw-r--r--src/pulsecore/card.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index ac9e6d9f..8e1ba536 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -235,3 +235,20 @@ int pa_card_set_profile(pa_card *c, const char *name) {
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;
+}
diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
index 9aa8f374..b179831e 100644
--- a/src/pulsecore/card.h
+++ b/src/pulsecore/card.h
@@ -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_suspend(pa_card *c, pa_bool_t suspend);
+
#endif