summaryrefslogtreecommitdiffstats
path: root/src/utils/pacat.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-02-12 03:18:05 +0100
committerLennart Poettering <lennart@poettering.net>2009-02-12 03:18:05 +0100
commit823431e44732a0824658c82de29aaa92f8f39f79 (patch)
treebdad5ae9f4e0f47221905ccedf0c192c09c86aaf /src/utils/pacat.c
parent4bd9737725b85d90a7cf12b82528c2de70a7fbfe (diff)
allow sending meta/policy events to clients
Diffstat (limited to 'src/utils/pacat.c')
-rw-r--r--src/utils/pacat.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 2d88e7f9..10015ce4 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -238,6 +238,18 @@ static void stream_moved_callback(pa_stream *s, void *userdata) {
fprintf(stderr, _("Stream moved to device %s (%u, %ssuspended).%s \n"), pa_stream_get_device_name(s), pa_stream_get_device_index(s), pa_stream_is_suspended(s) ? "" : _("not "), CLEAR_LINE);
}
+static void stream_event_callback(pa_stream *s, const char *name, pa_proplist *pl, void *userdata) {
+ char *t;
+
+ assert(s);
+ assert(name);
+ assert(pl);
+
+ t = pa_proplist_to_string_sep(pl, ", ");
+ fprintf(stderr, "Got event '%s', properties '%s'\n", name, t);
+ pa_xfree(t);
+}
+
/* This is called whenever the context status changes */
static void context_state_callback(pa_context *c, void *userdata) {
assert(c);
@@ -271,6 +283,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
pa_stream_set_underflow_callback(stream, stream_underflow_callback, NULL);
pa_stream_set_overflow_callback(stream, stream_overflow_callback, NULL);
pa_stream_set_started_callback(stream, stream_started_callback, NULL);
+ pa_stream_set_event_callback(stream, stream_event_callback, NULL);
if (latency > 0) {
memset(&buffer_attr, 0, sizeof(buffer_attr));