diff options
-rw-r--r-- | data/com.canonical.Unity.Greeter.Broadcast.xml | 24 | ||||
-rw-r--r-- | service/service.c | 54 | ||||
-rw-r--r-- | tests/manual | 25 |
3 files changed, 103 insertions, 0 deletions
diff --git a/data/com.canonical.Unity.Greeter.Broadcast.xml b/data/com.canonical.Unity.Greeter.Broadcast.xml index 020505e..5a4276a 100644 --- a/data/com.canonical.Unity.Greeter.Broadcast.xml +++ b/data/com.canonical.Unity.Greeter.Broadcast.xml @@ -11,6 +11,18 @@ <arg type="s" name="username" direction="in" /> </method> + <method name="RequestSoundPlayPause"> + <arg type="s" name="username" direction="in" /> + </method> + + <method name="RequestSoundNext"> + <arg type="s" name="username" direction="in" /> + </method> + + <method name="RequestSoundPrev"> + <arg type="s" name="username" direction="in" /> + </method> + <!-- To the Session --> <signal name="StartUrl"> <arg type="s" name="username" direction="out" /> @@ -21,6 +33,18 @@ <arg type="s" name="username" direction="out" /> </signal> + <signal name="SoundPlayPause"> + <arg type="s" name="username" direction="out" /> + </signal> + + <signal name="SoundNext"> + <arg type="s" name="username" direction="out" /> + </signal> + + <signal name="SoundPrev"> + <arg type="s" name="username" direction="out" /> + </signal> + <!-- Other --> </interface> </node> diff --git a/service/service.c b/service/service.c index bec6d9c..88f0ffa 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-url-start", G_CALLBACK (on_handle_request_url_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, 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 <dd>If there is a PIN set the dialog should be shown, enter the PIN</dd> <dd>The session should open with the selected app in focus</dd> </dl> + +Test-case unity-greeter-session-broadcast/sound-control-relay +<dl> + <dt>NOTE: This test requires the separated greeter to land before it can be executed</dt> + <dt>Start Music playing using the music app (may require copying music to the device)</dt> + <dd>Music should be playing out the speaker</dd> + <dt>Open the Sound Indicator</dt> + <dd>The music player should be listed</dd> + <dd>The currently playing song should be shown</dd> + <dt>Lock the screen of the device</dt> + <dd>Music should still be playing out the speaker</dd> + <dt>Click the power button to cause the screen to turn on</dt> + <dd>The screen should contain the lock screen</dd> + <dt>Open the Sound Indicator</dt> + <dd>The music player should be listed</dd> + <dd>The currently playing song should be shown</dd> + <dt>Press the Pause button</dt> + <dd>The music should stop playing</dd> + <dt>Press the Play button</dt> + <dd>The music should continue where it left off</dd> + <dt>Press the Next button</dt> + <dd>The music should switch to the next track</dd> + <dt>Press the Previous button</dt> + <dd>The music should switch to the previously playing track</dd> +</dl> |