Merge lp:~ted/unity-greeter-session-broadcast/sound-control into lp:unity-greeter-session-broadcast/14.04

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 34
Merged at revision: 32
Proposed branch: lp:~ted/unity-greeter-session-broadcast/sound-control
Merge into: lp:unity-greeter-session-broadcast/14.04
Diff against target: 153 lines (+103/-0)
3 files modified
data/com.canonical.Unity.Greeter.Broadcast.xml (+24/-0)
service/service.c (+54/-0)
tests/manual (+25/-0)
To merge this branch: bzr merge lp:~ted/unity-greeter-session-broadcast/sound-control
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+208894@code.launchpad.net

Commit message

Sound menu action support

Description of the change

Adds support for signaling the menu items in the sound menu from the greeter.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/com.canonical.Unity.Greeter.Broadcast.xml'
2--- data/com.canonical.Unity.Greeter.Broadcast.xml 2013-09-12 14:07:54 +0000
3+++ data/com.canonical.Unity.Greeter.Broadcast.xml 2014-02-28 22:43:30 +0000
4@@ -11,6 +11,18 @@
5 <arg type="s" name="username" direction="in" />
6 </method>
7
8+ <method name="RequestSoundPlayPause">
9+ <arg type="s" name="username" direction="in" />
10+ </method>
11+
12+ <method name="RequestSoundNext">
13+ <arg type="s" name="username" direction="in" />
14+ </method>
15+
16+ <method name="RequestSoundPrev">
17+ <arg type="s" name="username" direction="in" />
18+ </method>
19+
20 <!-- To the Session -->
21 <signal name="StartApplication">
22 <arg type="s" name="username" direction="out" />
23@@ -21,6 +33,18 @@
24 <arg type="s" name="username" direction="out" />
25 </signal>
26
27+ <signal name="SoundPlayPause">
28+ <arg type="s" name="username" direction="out" />
29+ </signal>
30+
31+ <signal name="SoundNext">
32+ <arg type="s" name="username" direction="out" />
33+ </signal>
34+
35+ <signal name="SoundPrev">
36+ <arg type="s" name="username" direction="out" />
37+ </signal>
38+
39 <!-- Other -->
40 </interface>
41 </node>
42
43=== modified file 'service/service.c'
44--- service/service.c 2013-09-12 14:07:54 +0000
45+++ service/service.c 2014-02-28 22:43:30 +0000
46@@ -47,6 +47,45 @@
47 return TRUE;
48 }
49
50+static gboolean
51+on_handle_request_sound_play_pause (ServiceIfaceComCanonicalUnityGreeterBroadcast *object,
52+ GDBusMethodInvocation *invocation,
53+ const gchar *arg_username)
54+{
55+ /* Simply pass the request on */
56+ service_iface_com_canonical_unity_greeter_broadcast_emit_sound_play_pause (object,
57+ arg_username);
58+ service_iface_com_canonical_unity_greeter_broadcast_complete_request_sound_play_pause (object,
59+ invocation);
60+ return TRUE;
61+}
62+
63+static gboolean
64+on_handle_request_sound_next (ServiceIfaceComCanonicalUnityGreeterBroadcast *object,
65+ GDBusMethodInvocation *invocation,
66+ const gchar *arg_username)
67+{
68+ /* Simply pass the request on */
69+ service_iface_com_canonical_unity_greeter_broadcast_emit_sound_next (object,
70+ arg_username);
71+ service_iface_com_canonical_unity_greeter_broadcast_complete_request_sound_next (object,
72+ invocation);
73+ return TRUE;
74+}
75+
76+static gboolean
77+on_handle_request_sound_prev (ServiceIfaceComCanonicalUnityGreeterBroadcast *object,
78+ GDBusMethodInvocation *invocation,
79+ const gchar *arg_username)
80+{
81+ /* Simply pass the request on */
82+ service_iface_com_canonical_unity_greeter_broadcast_emit_sound_prev (object,
83+ arg_username);
84+ service_iface_com_canonical_unity_greeter_broadcast_complete_request_sound_prev (object,
85+ invocation);
86+ return TRUE;
87+}
88+
89 static void
90 on_bus_acquired (GDBusConnection *connection,
91 const gchar *name,
92@@ -83,6 +122,7 @@
93
94 interface = service_iface_com_canonical_unity_greeter_broadcast_skeleton_new ();
95
96+ /* Application Launching */
97 g_signal_connect (interface,
98 "handle-request-application-start",
99 G_CALLBACK (on_handle_request_application_start),
100@@ -92,6 +132,20 @@
101 G_CALLBACK (on_handle_request_home_shown),
102 NULL);
103
104+ /* Sound stuff */
105+ g_signal_connect (interface,
106+ "handle-request-sound-play-pause",
107+ G_CALLBACK (on_handle_request_sound_play_pause),
108+ NULL);
109+ g_signal_connect (interface,
110+ "handle-request-sound-next",
111+ G_CALLBACK (on_handle_request_sound_next),
112+ NULL);
113+ g_signal_connect (interface,
114+ "handle-request-sound-prev",
115+ G_CALLBACK (on_handle_request_sound_prev),
116+ NULL);
117+
118 owner_id = g_bus_own_name (G_BUS_TYPE_SYSTEM,
119 "com.canonical.Unity.Greeter.Broadcast",
120 G_BUS_NAME_OWNER_FLAGS_NONE,
121
122=== modified file 'tests/manual'
123--- tests/manual 2014-02-05 05:18:45 +0000
124+++ tests/manual 2014-02-28 22:43:30 +0000
125@@ -11,3 +11,28 @@
126 <dd>If there is a PIN set the dialog should be shown, enter the PIN</dd>
127 <dd>The session should open with the selected app in focus</dd>
128 </dl>
129+
130+Test-case unity-greeter-session-broadcast/sound-control-relay
131+<dl>
132+ <dt>NOTE: This test requires the separated greeter to land before it can be executed</dt>
133+ <dt>Start Music playing using the music app (may require copying music to the device)</dt>
134+ <dd>Music should be playing out the speaker</dd>
135+ <dt>Open the Sound Indicator</dt>
136+ <dd>The music player should be listed</dd>
137+ <dd>The currently playing song should be shown</dd>
138+ <dt>Lock the screen of the device</dt>
139+ <dd>Music should still be playing out the speaker</dd>
140+ <dt>Click the power button to cause the screen to turn on</dt>
141+ <dd>The screen should contain the lock screen</dd>
142+ <dt>Open the Sound Indicator</dt>
143+ <dd>The music player should be listed</dd>
144+ <dd>The currently playing song should be shown</dd>
145+ <dt>Press the Pause button</dt>
146+ <dd>The music should stop playing</dd>
147+ <dt>Press the Play button</dt>
148+ <dd>The music should continue where it left off</dd>
149+ <dt>Press the Next button</dt>
150+ <dd>The music should switch to the next track</dd>
151+ <dt>Press the Previous button</dt>
152+ <dd>The music should switch to the previously playing track</dd>
153+</dl>

Subscribers

People subscribed via source and target branches