summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-08-22 14:15:43 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-08-22 14:15:43 +0000
commit84aca873392c957faa5974485633ce4081a416e2 (patch)
tree960000aed03bc9b642decc28c6378d65088f42cf
parent674a1d6355ebd5c1e9ffc2e7663b747f60ac70b5 (diff)
Add Playing and Stopped signals to sink inteface.
-rw-r--r--audio/audio-api.txt8
-rw-r--r--audio/sink.c14
2 files changed, 21 insertions, 1 deletions
diff --git a/audio/audio-api.txt b/audio/audio-api.txt
index 7e06b1f6..6a4041c0 100644
--- a/audio/audio-api.txt
+++ b/audio/audio-api.txt
@@ -245,6 +245,14 @@ Signals void Connected()
Sent when the device has been disconnected from.
+ void Playing()
+
+ Sent when a stream with remote device is started.
+
+ void Stopped()
+
+ Sent when a stream with remote device is suspended.
+
org.bluez.audio.Source interface
================================
diff --git a/audio/sink.c b/audio/sink.c
index c09c019f..8141eff5 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -113,9 +113,19 @@ static void stream_state_changed(struct avdtp_stream *stream,
AUDIO_SINK_INTERFACE,
"Connected",
DBUS_TYPE_INVALID);
+ else if (old_state == AVDTP_STATE_STREAMING)
+ dbus_connection_emit_signal(dev->conn, dev->path,
+ AUDIO_SINK_INTERFACE,
+ "Stopped",
+ DBUS_TYPE_INVALID);
break;
- case AVDTP_STATE_CONFIGURED:
case AVDTP_STATE_STREAMING:
+ dbus_connection_emit_signal(dev->conn, dev->path,
+ AUDIO_SINK_INTERFACE,
+ "Playing",
+ DBUS_TYPE_INVALID);
+ break;
+ case AVDTP_STATE_CONFIGURED:
case AVDTP_STATE_CLOSING:
case AVDTP_STATE_ABORTING:
default:
@@ -259,6 +269,8 @@ static DBusMethodVTable sink_methods[] = {
static DBusSignalVTable sink_signals[] = {
{ "Connected", "" },
{ "Disconnected", "" },
+ { "Playing", "" },
+ { "Stopped", "" },
{ NULL, NULL }
};