diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-10-02 16:52:31 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-10-02 16:52:31 -0300 |
commit | bd95a9317b206429768786da3d3b42d643a358b3 (patch) | |
tree | 68a62a630532d2ae5fb006732d3d6403709e5423 | |
parent | 430814a41d1ba988d35ef33a1202b4dcb2db939c (diff) |
Add code to emit PropertyChanged on control interface.
-rw-r--r-- | audio/control.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/audio/control.c b/audio/control.c index 2c86ff25..6326eb53 100644 --- a/audio/control.c +++ b/audio/control.c @@ -418,12 +418,20 @@ static void avctp_unref(struct avctp *session) { sessions = g_slist_remove(sessions, session); - if (session->state == AVCTP_STATE_CONNECTED) + if (session->state == AVCTP_STATE_CONNECTED) { + gboolean value = FALSE; g_dbus_emit_signal(session->dev->conn, session->dev->path, AUDIO_CONTROL_INTERFACE, "Disconnected", DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(session->dev->conn, + session->dev->path, + AUDIO_CONTROL_INTERFACE, + "Connected", + DBUS_TYPE_BOOLEAN, &value); + } + if (session->sock >= 0) close(session->sock); if (session->io) @@ -601,6 +609,7 @@ static void init_uinput(struct avctp *session) static void avctp_connect_session(struct avctp *session) { GIOChannel *io; + gboolean value; session->state = AVCTP_STATE_CONNECTED; session->dev = manager_find_device(&session->dst, NULL, FALSE); @@ -611,9 +620,15 @@ static void avctp_connect_session(struct avctp *session) init_uinput(session); + value = TRUE; g_dbus_emit_signal(session->dev->conn, session->dev->path, AUDIO_CONTROL_INTERFACE, "Connected", DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(session->dev->conn, + session->dev->path, + AUDIO_CONTROL_INTERFACE, + "Connected", + DBUS_TYPE_BOOLEAN, &value); if (session->io) g_source_remove(session->io); |