From fc160ff366af18963333022ccfa7f704f0380e54 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 26 Feb 2014 09:40:09 -0600 Subject: Adding in sound API for the dbus interface --- data/com.canonical.Unity.Greeter.Broadcast.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/data/com.canonical.Unity.Greeter.Broadcast.xml b/data/com.canonical.Unity.Greeter.Broadcast.xml index 5d29ca5..af08286 100644 --- a/data/com.canonical.Unity.Greeter.Broadcast.xml +++ b/data/com.canonical.Unity.Greeter.Broadcast.xml @@ -11,6 +11,18 @@ + + + + + + + + + + + + @@ -21,6 +33,18 @@ + + + + + + + + + + + + -- cgit v1.2.3 From 812ba63f54089024f6ee61fe752046a36d6e973b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 26 Feb 2014 09:47:32 -0600 Subject: Reflecting the sound methods --- service/service.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/service/service.c b/service/service.c index 425e8ac..7a83fb0 100644 --- a/service/service.c +++ b/service/service.c @@ -47,6 +47,45 @@ on_handle_request_home_shown (ServiceIfaceComCanonicalUnityGreeterBroadcast *obj return TRUE; } +static gboolean +on_handle_request_sound_play_pause (ServiceIfaceComCanonicalUnityGreeterBroadcast *object, + GDBusMethodInvocation *invocation, + const gchar *arg_username) +{ + /* Simply pass the request on */ + service_iface_com_canonical_unity_greeter_broadcast_emit_sound_play_pause (object, + arg_username); + service_iface_com_canonical_unity_greeter_broadcast_complete_request_sound_play_pause (object, + invocation); + return TRUE; +} + +static gboolean +on_handle_request_sound_next (ServiceIfaceComCanonicalUnityGreeterBroadcast *object, + GDBusMethodInvocation *invocation, + const gchar *arg_username) +{ + /* Simply pass the request on */ + service_iface_com_canonical_unity_greeter_broadcast_emit_sound_next (object, + arg_username); + service_iface_com_canonical_unity_greeter_broadcast_complete_request_sound_next (object, + invocation); + return TRUE; +} + +static gboolean +on_handle_request_sound_prev (ServiceIfaceComCanonicalUnityGreeterBroadcast *object, + GDBusMethodInvocation *invocation, + const gchar *arg_username) +{ + /* Simply pass the request on */ + service_iface_com_canonical_unity_greeter_broadcast_emit_sound_prev (object, + arg_username); + service_iface_com_canonical_unity_greeter_broadcast_complete_request_sound_prev (object, + invocation); + return TRUE; +} + static void on_bus_acquired (GDBusConnection *connection, const gchar *name, @@ -83,6 +122,7 @@ main (int argc, char * argv[]) interface = service_iface_com_canonical_unity_greeter_broadcast_skeleton_new (); + /* Application Launching */ g_signal_connect (interface, "handle-request-application-start", G_CALLBACK (on_handle_request_application_start), @@ -92,6 +132,20 @@ main (int argc, char * argv[]) G_CALLBACK (on_handle_request_home_shown), NULL); + /* Sound stuff */ + g_signal_connect (interface, + "handle-request-sound-play-pause", + G_CALLBACK (on_handle_request_sound_play_pause), + NULL); + g_signal_connect (interface, + "handle-request-sound-next", + G_CALLBACK (on_handle_request_sound_next), + NULL); + g_signal_connect (interface, + "handle-request-sound-prev", + G_CALLBACK (on_handle_request_sound_prev), + NULL); + owner_id = g_bus_own_name (G_BUS_TYPE_SYSTEM, "com.canonical.Unity.Greeter.Broadcast", G_BUS_NAME_OWNER_FLAGS_NONE, -- cgit v1.2.3 From 2a37cca87e0894769ba0a6ad1f0cb63bd6b4c8bf Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 26 Feb 2014 15:18:09 -0600 Subject: Adding an acceptance test fo the sound features --- tests/manual | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/manual b/tests/manual index c05689f..b98e06b 100644 --- a/tests/manual +++ b/tests/manual @@ -11,3 +11,28 @@ Test-case unity-greeter-session-broadcast/application-on-greeter
If there is a PIN set the dialog should be shown, enter the PIN
The session should open with the selected app in focus
+ +Test-case unity-greeter-session-broadcast/sound-control-relay +
+
NOTE: This test requires the separated greeter to land before it can be executed
+
Start Music playing using the music app (may require copying music to the device)
+
Music should be playing out the speaker
+
Open the Sound Indicator
+
The music player should be listed
+
The currently playing song should be shown
+
Lock the screen of the device
+
Music should still be playing out the speaker
+
Click the power button to cause the screen to turn on
+
The screen should contain the lock screen
+
Open the Sound Indicator
+
The music player should be listed
+
The currently playing song should be shown
+
Press the Pause button
+
The music should stop playing
+
Press the Play button
+
The music should continue where it left off
+
Press the Next button
+
The music should switch to the next track
+
Press the Previous button
+
The music should switch to the previously playing track
+
-- cgit v1.2.3