diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2009-01-15 17:16:31 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2009-01-20 00:16:18 +0200 |
commit | 9c4f8e627a70fc610a81da2703eeddfde4a7e4fa (patch) | |
tree | 8b8096c7505eb452ffa270116db742eecaca8972 /src/pulsecore/sink.h | |
parent | f83111dd1710d7e0a3240879217e6d0c783c4a4b (diff) |
pulse: introspect sink state
Diffstat (limited to 'src/pulsecore/sink.h')
-rw-r--r-- | src/pulsecore/sink.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h index 507c1603..382b2d0e 100644 --- a/src/pulsecore/sink.h +++ b/src/pulsecore/sink.h @@ -27,6 +27,7 @@ typedef struct pa_sink pa_sink; #include <inttypes.h> +#include <pulse/def.h> #include <pulse/sample.h> #include <pulse/channelmap.h> #include <pulse/volume.h> @@ -42,18 +43,16 @@ typedef struct pa_sink pa_sink; #define PA_MAX_INPUTS_PER_SINK 32 -typedef enum pa_sink_state { - PA_SINK_INIT, - PA_SINK_RUNNING, - PA_SINK_SUSPENDED, - PA_SINK_IDLE, - PA_SINK_UNLINKED -} pa_sink_state_t; +/* anonymous enum extending pa_sink_state_t */ +enum { + PA_SINK_INIT = -2, + /* Initialization state */ -static inline pa_bool_t PA_SINK_IS_OPENED(pa_sink_state_t x) { - return x == PA_SINK_RUNNING || x == PA_SINK_IDLE; -} + PA_SINK_UNLINKED = -3 + /* The state when the sink is getting unregistered and removed from client access */ +}; +/* Returns true if sink is linked: registered and accessible from client side. */ static inline pa_bool_t PA_SINK_IS_LINKED(pa_sink_state_t x) { return x == PA_SINK_RUNNING || x == PA_SINK_IDLE || x == PA_SINK_SUSPENDED; } |