Merge lp:~cjcurran/indicator-sound/banshee-offline-speciality into lp:~indicator-applet-developers/indicator-sound/trunk_3

Proposed by Conor Curran
Status: Merged
Merged at revision: 227
Proposed branch: lp:~cjcurran/indicator-sound/banshee-offline-speciality
Merge into: lp:~indicator-applet-developers/indicator-sound/trunk_3
Diff against target: 654 lines (+241/-70)
13 files modified
src/common-defs.h (+2/-1)
src/indicator-sound.c (+2/-2)
src/mpris2-controller.vala (+7/-7)
src/mpris2-watcher.vala (+1/-1)
src/player-controller.vala (+17/-11)
src/player-item.vala (+2/-2)
src/slider-menu-item.c (+23/-15)
src/transport-menu-item.vala (+46/-16)
src/transport-widget.c (+105/-3)
src/voip-input-widget.c (+2/-2)
src/volume-widget.c (+29/-7)
src/volume-widget.h (+1/-1)
vapi/common-defs.vapi (+4/-2)
To merge this branch: bzr merge lp:~cjcurran/indicator-sound/banshee-offline-speciality
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+54221@code.launchpad.net

This proposal supersedes a proposal from 2011-03-21.

Description of the change

Fixes bug attached. Mpt would like me to merge this feature. implementation is ideal but at least it is step in the right direction in order to deliver this user experience. I suspect the next issue will be for the clients to ensure that once their mpris interface is raised they must be able to accept mpris commands. This will ensure that the 1 second timeout which can found in this merge request can be removed

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Yeah, less that ideal. Could you put a TODO to that effect in the code so people coming after us reading it will understand why it is there, and that it should be eventually removed?

review: Approve
Revision history for this message
Conor Curran (cjcurran) wrote :

will do

230. By Conor Curran

add an important todo to remind myself of the need to get that timeout removed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/common-defs.h'
2--- src/common-defs.h 2011-03-17 16:10:03 +0000
3+++ src/common-defs.h 2011-03-21 15:53:27 +0000
4@@ -45,7 +45,8 @@
5
6 typedef enum {
7 TRANSPORT_STATE_PLAYING,
8- TRANSPORT_STATE_PAUSED
9+ TRANSPORT_STATE_PAUSED,
10+ TRANSPORT_STATE_LAUNCHING
11 }TransportState;
12
13 #define NOT_ACTIVE -1
14
15=== modified file 'src/indicator-sound.c'
16--- src/indicator-sound.c 2011-03-16 12:38:04 +0000
17+++ src/indicator-sound.c 2011-03-21 15:53:27 +0000
18@@ -539,7 +539,7 @@
19 voip_input_widget_update (VOIP_INPUT_WIDGET(priv->voip_widget), new_value);
20 }
21 else{
22- volume_widget_update (VOLUME_WIDGET(priv->volume_widget), new_value);
23+ volume_widget_update (VOLUME_WIDGET(priv->volume_widget), new_value, "keypress-update");
24 }
25 }
26 }
27@@ -660,7 +660,7 @@
28 value -= adj->step_increment;
29 }
30 //g_debug("indicator-sound-scroll - update slider with value %f", value);
31- volume_widget_update(VOLUME_WIDGET(priv->volume_widget), value);
32+ volume_widget_update(VOLUME_WIDGET(priv->volume_widget), value, "scroll updates");
33
34 sound_state_manager_show_notification (priv->state_manager, value);
35 }
36
37=== modified file 'src/mpris2-controller.vala'
38--- src/mpris2-controller.vala 2011-03-09 14:17:12 +0000
39+++ src/mpris2-controller.vala 2011-03-21 15:53:27 +0000
40@@ -127,10 +127,10 @@
41 Variant? artist_v = this.player.Metadata.lookup("xesam:artist");
42 if(artist_v != null){
43 Variant? v_artists = this.player.Metadata.lookup("xesam:artist");
44- debug("artists is of type %s", v_artists.get_type_string ());
45+ //debug("artists is of type %s", v_artists.get_type_string ());
46 string display_artists;
47 if(v_artists.get_type_string() == "s"){
48- debug("SPOTIFY is that you ?");
49+ //debug("SPOTIFY is that you ?");
50 display_artists = v_artists.get_string();
51 }
52 else{
53@@ -138,7 +138,7 @@
54 display_artists = string.joinv(", ", artists);
55 }
56 changed_updates.replace("xesam:artist", display_artists);
57- debug("artist : %s", (string)changed_updates.lookup("xesam:artist"));
58+ //debug("artist : %s", (string)changed_updates.lookup("xesam:artist"));
59 }
60 return changed_updates;
61 }
62@@ -226,12 +226,12 @@
63 false);
64 }
65 catch (IOError e){
66- debug("Could not fetch playlists because %s", e.message);
67+ //debug("Could not fetch playlists because %s", e.message);
68 return;
69 }
70
71 if( current_playlists != null ){
72- debug( "Size of the playlist array = %i", current_playlists.length );
73+ //debug( "Size of the playlist array = %i", current_playlists.length );
74 PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;
75 playlists_item.update(current_playlists);
76 }
77@@ -244,7 +244,7 @@
78 private bool fetch_active_playlist()
79 {
80 if (this.playlists.ActivePlaylist.valid == false){
81- debug(" We don't have an active playlist");
82+ //debug(" We don't have an active playlist");
83 }
84 PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;
85 playlists_item.active_playlist_update ( this.playlists.ActivePlaylist.details );
86@@ -257,7 +257,7 @@
87 this.playlists.ActivatePlaylist.begin(path);
88 }
89 catch(IOError e){
90- debug("Could not activate playlist %s because %s", (string)path, e.message);
91+ //debug("Could not activate playlist %s because %s", (string)path, e.message);
92 }
93 }
94 }
95
96=== modified file 'src/mpris2-watcher.vala'
97--- src/mpris2-watcher.vala 2011-01-31 19:14:47 +0000
98+++ src/mpris2-watcher.vala 2011-03-21 15:53:27 +0000
99@@ -168,4 +168,4 @@
100 delete xml_doc;
101 return result;
102 }
103-}
104\ No newline at end of file
105+}
106
107=== modified file 'src/player-controller.vala'
108--- src/player-controller.vala 2011-02-01 01:33:46 +0000
109+++ src/player-controller.vala 2011-03-21 15:53:27 +0000
110@@ -133,7 +133,8 @@
111 public void hibernate()
112 {
113 update_state(PlayerController.state.OFFLINE);
114- this.custom_items[widget_order.TRANSPORT].reset(TransportMenuitem.attributes_format());
115+ TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem;
116+ transport.change_play_state (Transport.State.PAUSED);
117 this.custom_items[widget_order.METADATA].reset(MetadataMenuitem.attributes_format());
118 TitleMenuitem title = this.custom_items[widget_order.TITLE] as TitleMenuitem;
119 title.toggle_active_triangle(false);
120@@ -143,20 +144,25 @@
121 public void update_layout()
122 {
123 PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem;
124-
125 if(this.current_state != state.CONNECTED){
126- this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE,
127+ this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE,
128 false);
129- this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
130- false);
131- playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE,
132- false );
133+ playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE,
134+ false );
135+ this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE,
136+ this.app_info.get_id() == "banshee.desktop");
137 return;
138 }
139- this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
140- this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()));
141- this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE,
142- true);
143+ this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE,
144+ this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()));
145+ if (this.app_info.get_id() == "banshee.desktop"){
146+ TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem;
147+ transport.handle_cached_action();
148+ }
149+ else{
150+ this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE,
151+ true);
152+ }
153 playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE,
154 this.use_playlists );
155 }
156
157=== modified file 'src/player-item.vala'
158--- src/player-item.vala 2011-02-17 18:54:58 +0000
159+++ src/player-item.vala 2011-03-21 15:53:27 +0000
160@@ -37,7 +37,7 @@
161
162 public void reset(HashSet<string> attrs){
163 foreach(string s in attrs){
164- debug("attempting to set prop %s to EMPTY", s);
165+ //debug("attempting to set prop %s to EMPTY", s);
166 this.property_set_int(s, EMPTY);
167 }
168 }
169@@ -50,7 +50,7 @@
170 */
171 public void update(HashTable<string, Variant?> data, HashSet<string> attributes)
172 {
173- debug("PlayerItem::update()");
174+ //debug("PlayerItem::update()");
175 if(data == null){
176 warning("PlayerItem::Update -> The hashtable was null - just leave it!");
177 return;
178
179=== modified file 'src/slider-menu-item.c'
180--- src/slider-menu-item.c 2011-03-15 12:46:57 +0000
181+++ src/slider-menu-item.c 2011-03-21 15:53:27 +0000
182@@ -69,7 +69,9 @@
183 static void
184 slider_menu_item_init (SliderMenuItem *self)
185 {
186+/*
187 g_debug("Building new Slider Menu Item");
188+*/
189 dbusmenu_menuitem_property_set( DBUSMENU_MENUITEM(self),
190 DBUSMENU_MENUITEM_PROP_TYPE,
191 DBUSMENU_VOLUME_MENUITEM_TYPE );
192@@ -101,21 +103,18 @@
193 GVariant * value,
194 guint timestamp)
195 {
196- GVariant* input = NULL;
197- input = value;
198- if (g_variant_is_of_type(value, G_VARIANT_TYPE_VARIANT) == TRUE) {
199- input = g_variant_get_variant(value);
200- }
201+ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE));
202+ g_return_if_fail (IS_SLIDER_MENU_ITEM (mi));
203
204- if (value != NULL){
205- if (IS_SLIDER_MENU_ITEM (mi)) {
206- SliderMenuItemPrivate* priv = SLIDER_MENU_ITEM_GET_PRIVATE (SLIDER_MENU_ITEM (mi));
207- gdouble volume_input = g_variant_get_double(input);
208- //g_debug ("slider menu item about to update volume %f", volume_input);
209- slider_menu_item_update_volume (SLIDER_MENU_ITEM (mi), volume_input);
210- device_ensure_sink_is_unmuted (priv->a_sink);
211- }
212- }
213+ SliderMenuItemPrivate* priv = SLIDER_MENU_ITEM_GET_PRIVATE (SLIDER_MENU_ITEM (mi));
214+ gdouble volume_input = g_variant_get_double (value);
215+/*
216+ g_debug ("slider menu item handle event with value %f on name %s",
217+ volume_input,
218+ name);
219+*/
220+ slider_menu_item_update_volume (SLIDER_MENU_ITEM (mi), volume_input);
221+ device_ensure_sink_is_unmuted (priv->a_sink);
222 }
223
224
225@@ -148,6 +147,10 @@
226 static void
227 slider_menu_item_update_volume (SliderMenuItem* self, gdouble percent)
228 {
229+/*
230+ g_debug ("slider menu item update volume - about to set the volume to %f", percent);
231+*/
232+
233 pa_cvolume new_volume;
234 pa_cvolume_init(&new_volume);
235 new_volume.channels = 1;
236@@ -174,12 +177,17 @@
237 gdouble volume_percent = ((gdouble) vol * 100) / PA_VOLUME_NORM;
238
239 GVariant* new_volume = g_variant_new_double (volume_percent);
240+/*
241+ g_debug ("slider menu item update - volume update to ui to %f", volume_percent);
242+*/
243 dbusmenu_menuitem_property_set_variant (DBUSMENU_MENUITEM(self),
244 DBUSMENU_VOLUME_MENUITEM_LEVEL,
245 new_volume);
246 if (priv->mute != update->mute){
247 priv->mute = update->mute;
248- g_debug ("volume menu item - update - mute = %i", update->mute);
249+/*
250+ g_debug ("volume menu item - update - mute on ui = %i", update->mute);
251+*/
252 GVariant* new_mute_update = g_variant_new_int32 (update->mute);
253 dbusmenu_menuitem_property_set_variant (DBUSMENU_MENUITEM(self),
254 DBUSMENU_VOLUME_MENUITEM_MUTE,
255
256=== modified file 'src/transport-menu-item.vala'
257--- src/transport-menu-item.vala 2011-03-09 14:17:12 +0000
258+++ src/transport-menu-item.vala 2011-03-21 15:53:27 +0000
259@@ -23,18 +23,44 @@
260 using Transport;
261
262 public class TransportMenuitem : PlayerItem
263-{
264-
265+{
266+ private Transport.Action cached_action;
267+
268+ private bool running {
269+ get{
270+ return this.owner.current_state == PlayerController.state.CONNECTED;
271+ }
272+ }
273+
274 public TransportMenuitem(PlayerController parent)
275 {
276 Object(item_type: MENUITEM_TYPE, owner: parent);
277- this.property_set_int(MENUITEM_PLAY_STATE, 1);
278- }
279-
280- public void change_play_state(Transport.State update)
281- {
282- //debug("UPDATING THE TRANSPORT DBUSMENUITEM PLAY STATE WITH VALUE %i",
283- // (int)update);
284+ }
285+ construct{
286+ this.property_set_int(MENUITEM_PLAY_STATE, (int)Transport.State.PAUSED);
287+ this.cached_action = Transport.Action.NO_ACTION;
288+ }
289+
290+ /**
291+ Please remove this timeout when the default player can handle mpris commands
292+ immediately once it raises its dbus interface
293+ **/
294+ public void handle_cached_action()
295+ {
296+ if (this.cached_action != Transport.Action.NO_ACTION){
297+ Timeout.add_seconds (1, send_cached_action);
298+ }
299+ }
300+
301+ private bool send_cached_action()
302+ {
303+ this.owner.mpris_bridge.transport_update(this.cached_action);
304+ this.cached_action = Transport.Action.NO_ACTION;
305+ return false;
306+ }
307+
308+ public void change_play_state (Transport.State update)
309+ {
310 int temp = (int)update;
311 this.property_set_int(MENUITEM_PLAY_STATE, temp);
312 }
313@@ -43,17 +69,21 @@
314 Variant input_value,
315 uint timestamp)
316 {
317- /*debug ( "Handle event in transport menu item - input variant is of type %s",
318- input_value.get_type_string() );*/
319 Variant v = input_value;
320- if ( input_value.is_of_type ( VariantType.VARIANT) ){
321+ if ( input_value.is_of_type (VariantType.VARIANT)){
322 v = input_value.get_variant();
323 }
324
325 int32 input = v.get_int32();
326- //debug("transport menu item -> handle_event with value %s", input.to_string());
327- //debug("transport owner name = %s", this.owner.app_info.get_name());
328- this.owner.mpris_bridge.transport_update((Transport.Action)input);
329+
330+ if (this.running == true){
331+ this.owner.mpris_bridge.transport_update((Transport.Action)input);
332+ }
333+ else{
334+ this.cached_action = (Transport.Action)input;
335+ this.owner.instantiate();
336+ this.property_set_int (MENUITEM_PLAY_STATE, (int)Transport.State.LAUNCHING);
337+ }
338 }
339
340 public static HashSet<string> attributes_format()
341@@ -63,4 +93,4 @@
342 return attrs;
343 }
344
345-}
346\ No newline at end of file
347+}
348
349=== modified file 'src/transport-widget.c'
350--- src/transport-widget.c 2011-03-11 12:49:42 +0000
351+++ src/transport-widget.c 2011-03-21 15:53:27 +0000
352@@ -85,6 +85,9 @@
353 gboolean has_focus;
354 gint hold_timer;
355 gint skip_frequency;
356+ gint launching_timer;
357+ gdouble launching_transparency;
358+ gboolean fade_out;
359 };
360
361 // TODO refactor the UI handlers, consolidate functionality between key press /release
362@@ -136,6 +139,7 @@
363 static void transport_widget_start_timing (TransportWidget* widget);
364 static gboolean transport_widget_trigger_seek (gpointer userdata);
365 static gboolean transport_widget_seek (gpointer userdata);
366+static gboolean transport_widget_fade_playbutton (gpointer userdata);
367
368
369 /// Init functions //////////////////////////////////////////////////////////
370@@ -168,6 +172,9 @@
371 priv->has_focus = FALSE;
372 priv->hold_timer = 0;
373 priv->skip_frequency = 0;
374+ priv->launching_timer = 0;
375+ priv->launching_transparency = 1.0f;
376+ priv->fade_out = TRUE;
377 priv->command_coordinates = g_hash_table_new_full(g_direct_hash,
378 g_direct_equal,
379 NULL,
380@@ -1733,6 +1740,61 @@
381 FALSE);
382 _finalize (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y);
383 }
384+ else if(priv->current_state == TRANSPORT_STATE_LAUNCHING)
385+ {
386+/*
387+ g_debug ("launching in draw");
388+*/
389+ _setup (&cr_surf, &surf, PLAY_WIDTH+6, PLAY_HEIGHT+6);
390+ _mask_play (cr_surf,
391+ PLAY_PADDING,
392+ PLAY_PADDING,
393+ PLAY_WIDTH - (2*PLAY_PADDING),
394+ PLAY_HEIGHT - (2*PLAY_PADDING));
395+
396+ double BUTTON_SHADOW_LAUNCHING[] = {color_button[3].r,
397+ color_button[3].g,
398+ color_button[3].b,
399+ priv->launching_transparency};
400+ double BUTTON_LAUNCHING_END[] = {color_button[0].r,
401+ color_button[0].g,
402+ color_button[0].b,
403+ priv->launching_transparency};
404+ double BUTTON_LAUNCHING_START[] = {color_button[1].r,
405+ color_button[1].g,
406+ color_button[1].b,
407+ priv->launching_transparency};
408+ _fill (cr_surf,
409+ PLAY_PADDING,
410+ PLAY_PADDING,
411+ PLAY_WIDTH - (2*PLAY_PADDING),
412+ PLAY_HEIGHT - (2*PLAY_PADDING),
413+ BUTTON_SHADOW_LAUNCHING,
414+ BUTTON_SHADOW_LAUNCHING,
415+ FALSE);
416+ _surface_blur (surf, 3);
417+ _finalize_repaint (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y + 0.5f, 3);
418+
419+ // draw play-button
420+ _setup (&cr_surf, &surf, PLAY_WIDTH, PLAY_HEIGHT);
421+ cairo_set_line_width (cr, 10.5);
422+ cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
423+ cairo_set_line_join(cr, CAIRO_LINE_JOIN_ROUND);
424+ _mask_play (cr_surf,
425+ PLAY_PADDING,
426+ PLAY_PADDING,
427+ PLAY_WIDTH - (2*PLAY_PADDING),
428+ PLAY_HEIGHT - (2*PLAY_PADDING));
429+ _fill (cr_surf,
430+ PLAY_PADDING,
431+ PLAY_PADDING,
432+ PLAY_WIDTH - (2*PLAY_PADDING),
433+ PLAY_HEIGHT - (2*PLAY_PADDING),
434+ BUTTON_LAUNCHING_START,
435+ BUTTON_LAUNCHING_END,
436+ FALSE);
437+ _finalize (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y);
438+ }
439 }
440
441 static void
442@@ -1750,6 +1812,30 @@
443 (TransportState)initial_state);
444 }
445
446+static gboolean
447+transport_widget_fade_playbutton (gpointer userdata)
448+{
449+ TransportWidget* bar = (TransportWidget*)userdata;
450+ g_return_val_if_fail(IS_TRANSPORT_WIDGET(bar), FALSE);
451+/*
452+ g_debug ("fade in /out timeout");
453+*/
454+ TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(bar);
455+ if (priv->launching_transparency == 1.0f){
456+ priv->fade_out = TRUE;
457+ }
458+ else if (priv->launching_transparency <= 0.3F){
459+ priv->fade_out = FALSE;
460+ }
461+ if (priv->fade_out == TRUE){
462+ priv->launching_transparency -= 0.05f;
463+ }
464+ else{
465+ priv->launching_transparency += 0.05f;
466+ }
467+ gtk_widget_queue_draw (GTK_WIDGET(bar));
468+ return TRUE;
469+}
470 /**
471 * transport_widget_update_state()
472 * Callback for updates from the other side of dbus
473@@ -1761,12 +1847,28 @@
474 //g_debug("transport_widget_update_state - with property %s", property);
475 TransportWidget* bar = (TransportWidget*)userdata;
476 g_return_if_fail(IS_TRANSPORT_WIDGET(bar));
477+ TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(bar);
478
479 if(g_ascii_strcasecmp(DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, property) == 0)
480 {
481- int update_value = g_variant_get_int32(value);
482- //g_debug("transport_widget_update_state - with value %i", update_value);
483- transport_widget_toggle_play_pause(bar, (TransportState)update_value);
484+ TransportState new_state = (TransportState)g_variant_get_int32(value);
485+ //g_debug("transport_widget_update_state - with value %i", update_value);
486+ if (new_state == TRANSPORT_STATE_LAUNCHING){
487+ priv->current_state = TRANSPORT_STATE_LAUNCHING;
488+ priv->launching_timer = g_timeout_add (100,
489+ transport_widget_fade_playbutton,
490+ bar);
491+ //g_debug("TransportWidget::toggle play state : %i", priv->current_state);
492+ }
493+ else{
494+ if (priv->launching_timer != 0){
495+ g_source_remove (priv->launching_timer);
496+ priv->launching_timer = 0;
497+ priv->fade_out = TRUE;
498+ priv->launching_transparency = 1.0f;
499+ }
500+ transport_widget_toggle_play_pause(bar, new_state);
501+ }
502 }
503 }
504
505
506=== modified file 'src/voip-input-widget.c'
507--- src/voip-input-widget.c 2011-03-16 12:11:27 +0000
508+++ src/voip-input-widget.c 2011-03-21 15:53:27 +0000
509@@ -129,9 +129,9 @@
510 g_return_if_fail (IS_VOIP_INPUT_WIDGET (userdata));
511 VoipInputWidget* mitem = VOIP_INPUT_WIDGET(userdata);
512 VoipInputWidgetPrivate * priv = VOIP_INPUT_WIDGET_GET_PRIVATE(mitem);
513- //g_debug("scrub-widget::property_update for prop %s", property);
514 if(g_ascii_strcasecmp(DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL, property) == 0){
515- if(priv->grabbed == FALSE){
516+ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE));
517+ if (priv->grabbed == FALSE){
518 GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_voip_input_slider);
519 GtkRange *range = (GtkRange*)slider;
520 gdouble update = g_variant_get_double (value);
521
522=== modified file 'src/volume-widget.c'
523--- src/volume-widget.c 2011-03-16 12:11:27 +0000
524+++ src/volume-widget.c 2011-03-21 15:53:27 +0000
525@@ -131,26 +131,33 @@
526 g_return_if_fail (IS_VOLUME_WIDGET (userdata));
527 VolumeWidget* mitem = VOLUME_WIDGET(userdata);
528 VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(mitem);
529-
530 if(g_ascii_strcasecmp(DBUSMENU_VOLUME_MENUITEM_LEVEL, property) == 0){
531 g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE) );
532 if(priv->grabbed == FALSE){
533 GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
534 GtkRange *range = (GtkRange*)slider;
535 gdouble update = g_variant_get_double (value);
536+/*
537+ g_debug ("volume widget volume prop update with %f", update);
538+*/
539 gtk_range_set_value(range, update);
540 update_accessible_desc(priv->indicator);
541 }
542 }
543 if(g_ascii_strcasecmp(DBUSMENU_VOLUME_MENUITEM_MUTE, property) == 0){
544+/*
545 g_debug ("volume widget - mute update ");
546+*/
547+ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32) );
548 if(priv->grabbed == FALSE){
549 GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
550 GtkRange *range = (GtkRange*)slider;
551 gint update = g_variant_get_int32 (value);
552 gdouble level;
553
554+/*
555 g_debug ("volume widget - mute update %i", update);
556+*/
557
558 if (update == 1){
559 level = 0;
560@@ -160,7 +167,9 @@
561 DBUSMENU_VOLUME_MENUITEM_LEVEL));
562 }
563 gtk_range_set_value(range, level);
564+/*
565 g_debug ("volume-widget - update mute with value %i", update);
566+*/
567 }
568 }
569 }
570@@ -197,8 +206,10 @@
571 {
572 g_return_val_if_fail (IS_VOLUME_WIDGET (user_data), FALSE);
573 VolumeWidget* mitem = VOLUME_WIDGET(user_data);
574- //g_debug ("changed value %f", new_value);
575- volume_widget_update(mitem, new_value);
576+/*
577+ g_debug ("changed value %f", new_value);
578+*/
579+ volume_widget_update(mitem, new_value, "change-value");
580 return FALSE;
581 }
582
583@@ -215,24 +226,35 @@
584 VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(mitem);
585 GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
586 gdouble current_value = CLAMP(gtk_range_get_value(GTK_RANGE(slider)), 0, 100);
587- //g_debug ("value changed %f", gtk_range_get_value(GTK_RANGE(slider)));
588+/*
589+ g_debug ("value changed %f", gtk_range_get_value(GTK_RANGE(slider)));
590+*/
591+
592 gint mute = g_variant_get_int32 (dbusmenu_menuitem_property_get_variant (priv->twin_item,
593 DBUSMENU_VOLUME_MENUITEM_MUTE));
594
595 if((current_value == 0 && mute != 1) || current_value == 100){
596- volume_widget_update(mitem, current_value);
597+/*
598+ g_debug ("value changed - actual set %f", current_value);
599+*/
600+ volume_widget_update(mitem, current_value, "value-changed");
601 }
602
603 return FALSE;
604 }
605
606 void
607-volume_widget_update(VolumeWidget* self, gdouble update)
608+volume_widget_update(VolumeWidget* self, gdouble update, gchar* label)
609 {
610+ gchar* source = NULL;
611+ source = label;
612+ if (label == NULL){
613+ source = "v widget update";
614+ }
615 VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(self);
616 gdouble clamped = CLAMP(update, 0, 100);
617 GVariant* new_volume = g_variant_new_double(clamped);
618- dbusmenu_menuitem_handle_event (priv->twin_item, "update", new_volume, 0);
619+ dbusmenu_menuitem_handle_event (priv->twin_item, source, new_volume, 0);
620 }
621
622 GtkWidget*
623
624=== modified file 'src/volume-widget.h'
625--- src/volume-widget.h 2011-02-22 00:32:51 +0000
626+++ src/volume-widget.h 2011-03-21 15:53:27 +0000
627@@ -47,7 +47,7 @@
628 GType volume_widget_get_type (void) G_GNUC_CONST;
629 GtkWidget* volume_widget_new(DbusmenuMenuitem *item, IndicatorObject* io);
630 GtkWidget* volume_widget_get_ido_slider(VolumeWidget* self);
631-void volume_widget_update(VolumeWidget* self, gdouble update);
632+void volume_widget_update(VolumeWidget* self, gdouble update, gchar* label);
633 void volume_widget_tidy_up (GtkWidget *widget);
634 gdouble volume_widget_get_current_volume ( GtkWidget *widget );
635
636
637=== modified file 'vapi/common-defs.vapi'
638--- vapi/common-defs.vapi 2011-03-09 18:00:36 +0000
639+++ vapi/common-defs.vapi 2011-03-21 15:53:27 +0000
640@@ -59,10 +59,12 @@
641 PLAY_PAUSE,
642 NEXT,
643 REWIND,
644- FORWIND
645+ FORWIND,
646+ NO_ACTION
647 }
648 public enum State{
649 PLAYING,
650- PAUSED
651+ PAUSED,
652+ LAUNCHING
653 }
654 }

Subscribers

People subscribed via source and target branches