diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-10-02 16:42:54 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-10-02 16:42:54 -0300 |
commit | 29c9f3163143a8c63b9a3020e85bb5bd7a8cb3ac (patch) | |
tree | cba61d1ae30d3e21937dd8620d39ed33a9295040 /audio | |
parent | 21691bc11dad5395ea157873c2e7fdf35237a7c9 (diff) |
Add code to emit PropertyChanged on sink interface.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/sink.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/audio/sink.c b/audio/sink.c index ab0a161d..e90ad0e3 100644 --- a/audio/sink.c +++ b/audio/sink.c @@ -91,6 +91,10 @@ static void stream_state_changed(struct avdtp_stream *stream, AUDIO_SINK_INTERFACE, "Disconnected", DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(dev->conn, dev->path, + AUDIO_SINK_INTERFACE, + "Connected", + DBUS_TYPE_BOOLEAN, &value); if (sink->disconnect) { DBusMessage *reply; struct pending_request *p; @@ -112,22 +116,42 @@ static void stream_state_changed(struct avdtp_stream *stream, sink->cb_id = 0; break; case AVDTP_STATE_OPEN: - if (old_state == AVDTP_STATE_CONFIGURED) + if (old_state == AVDTP_STATE_CONFIGURED) { + value = TRUE; g_dbus_emit_signal(dev->conn, dev->path, AUDIO_SINK_INTERFACE, "Connected", DBUS_TYPE_INVALID); - else if (old_state == AVDTP_STATE_STREAMING) + dbus_connection_emit_property_changed(dev->conn, + dev->path, + AUDIO_SINK_INTERFACE, + "Connected", + DBUS_TYPE_BOOLEAN, + &value); + } else if (old_state == AVDTP_STATE_STREAMING) { + value = FALSE; g_dbus_emit_signal(dev->conn, dev->path, AUDIO_SINK_INTERFACE, "Stopped", DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(dev->conn, + dev->path, + AUDIO_SINK_INTERFACE, + "Playing", + DBUS_TYPE_BOOLEAN, + &value); + } break; case AVDTP_STATE_STREAMING: + value = TRUE; g_dbus_emit_signal(dev->conn, dev->path, AUDIO_SINK_INTERFACE, "Playing", DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(dev->conn, dev->path, + AUDIO_SINK_INTERFACE, + "Playing", + DBUS_TYPE_BOOLEAN, &value); break; case AVDTP_STATE_CONFIGURED: case AVDTP_STATE_CLOSING: |