diff options
| -rw-r--r-- | audio/audio-api.txt | 8 | ||||
| -rw-r--r-- | audio/sink.c | 14 | 
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 }  };  | 
