diff options
author | Ted Gould <ted@gould.cx> | 2014-03-24 14:57:29 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-03-24 14:57:29 +0000 |
commit | 4999139dbd3c18121c4cd4047acc184a752de903 (patch) | |
tree | 260039b31a9603cb4b2cc9b9ddab7168408283d2 | |
parent | 788ce491db24c607aad64b3a51573b5bb82890bf (diff) | |
parent | 2a37cca87e0894769ba0a6ad1f0cb63bd6b4c8bf (diff) | |
download | ayatana-greeter-session-broadcast-4999139dbd3c18121c4cd4047acc184a752de903.tar.gz ayatana-greeter-session-broadcast-4999139dbd3c18121c4cd4047acc184a752de903.tar.bz2 ayatana-greeter-session-broadcast-4999139dbd3c18121c4cd4047acc184a752de903.zip |
Sound menu action support
-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 5d29ca5..af08286 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="StartApplication"> <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 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, 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> |