summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-07-28 20:58:33 +0000
committerLennart Poettering <lennart@poettering.net>2007-07-28 20:58:33 +0000
commit5fbb8e12d6d7a881100f53ea77f646b2bb32fc08 (patch)
tree14f2d9683d3a75a40802e644872b6e92eef48d15
parent10cb0483d943f37da0851a665f5a17fa2dc92522 (diff)
add PA_SINK_OPENED/PA_SOURCE_OPENED macros for easier checking for _IDLE or _RUNNING states
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1555 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/pulsecore/sink.h6
-rw-r--r--src/pulsecore/source.h4
2 files changed, 9 insertions, 1 deletions
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index dab97453..958279c5 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -157,5 +157,9 @@ void pa_sink_render_into(pa_sink*s, pa_memchunk *target);
void pa_sink_render_into_full(pa_sink *s, pa_memchunk *target);
int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, pa_memchunk *chunk);
-
+
+static inline int PA_SINK_OPENED(pa_sink_state_t x) {
+ return x == PA_SINK_RUNNING || x == PA_SINK_IDLE;
+}
+
#endif
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index 4db2dedf..e2b02ceb 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -148,4 +148,8 @@ unsigned pa_source_used_by(pa_source *s);
void pa_source_post(pa_source*s, const pa_memchunk *b);
int pa_source_process_msg(pa_msgobject *o, int code, void *userdata, pa_memchunk *chunk);
+static inline int PA_SOURCE_OPENED(pa_source_state_t x) {
+ return x == PA_SOURCE_RUNNING || x == PA_SOURCE_IDLE;
+}
+
#endif