~cjcurran/indicator-sound/notifications-moved-service-side

« back to all changes in this revision

Viewing changes to src/device.c

  • Committer: Conor Curran
  • Date: 2011-06-24 14:54:23 UTC
  • Revision ID: conor.curran@canonical.com-20110624145423-xm3xx5d0maoojk6i
stripped the notification stuff from the indicator and put in place the flag to determine when to send notifications from the device object

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
  VoipInputMenuItem*  voip_input_menu_item;
35
35
  SoundState          current_sound_state;
36
36
  SoundServiceDbus*   service;
 
37
  gboolean            scroll_update;
37
38
};
38
39
 
39
40
#define DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DEVICE_TYPE, DevicePrivate))
69
70
  priv->voip_input_menu_item = NULL;
70
71
  priv->current_sound_state = UNAVAILABLE;
71
72
  priv->service = NULL;
72
 
 
 
73
  priv->scroll_update = FALSE;
 
74
  
73
75
  // Init our menu items.
74
76
  priv->mute_menuitem = g_object_new (MUTE_MENU_ITEM_TYPE, NULL);
75
77
  priv->voip_input_menu_item = g_object_new (VOIP_INPUT_MENU_ITEM_TYPE, NULL);;
107
109
}
108
110
 
109
111
void
 
112
device_set_scroll_update (Device* self, gboolean update)
 
113
{
 
114
  DevicePrivate* priv = DEVICE_GET_PRIVATE(self);
 
115
  priv->scroll_update = update;
 
116
}
 
117
 
 
118
void
110
119
device_sink_update (Device* self,
111
120
                    const pa_sink_info* update)
112
121
{
113
122
  DevicePrivate* priv = DEVICE_GET_PRIVATE (self);
114
123
  slider_menu_item_update (priv->volume_slider_menuitem, update);
115
 
 
 
124
  if (priv->scroll_update == TRUE ){
 
125
    g_debug ("Send out a notification !!");
 
126
    priv->scroll_update = FALSE;
 
127
  }
116
128
  SoundState state = device_get_state_from_volume (self);
117
129
  if (priv->current_sound_state != state){
118
130
    priv->current_sound_state  = state;