]> code.delx.au - pulseaudio/commitdiff
add new function pa_card_suspend()
authorLennart Poettering <lennart@poettering.net>
Wed, 21 Jan 2009 23:17:11 +0000 (00:17 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Jan 2009 23:17:11 +0000 (00:17 +0100)
src/pulsecore/card.c
src/pulsecore/card.h

index ac9e6d9f5905bc2ca921901d116286c30bcdcc12..8e1ba536559738f46ca1696878d97f69fbe1543f 100644 (file)
@@ -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;
+}
index 9aa8f374fc449a803d99f2a02669b2e42bd81be6..b179831ed5afd4ee66bc21a9b22123ef7baed8ab 100644 (file)
@@ -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