~mterry/indicator-sound/add-greeter-mode

« back to all changes in this revision

Viewing changes to src/voip-input-menu-item.c

  • Committer: Conor Curran
  • Date: 2011-05-18 09:45:49 UTC
  • mfrom: (233.2.2 indicator-sound)
  • Revision ID: conor.curran@canonical.com-20110518094549-99wr42gsoj8jfgwp
source monitoring now happens even if the application is not voip specific therefore the voip slider has now become a generic mic input gain slider - hurray 

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
  pa_channel_map      channel_map;
36
36
  pa_volume_t         base_volume;
37
37
  gint                source_index;
38
 
  gint                sink_input_index;
 
38
  gint                source_output_index;
39
39
  gint                client_index;
40
40
};
41
41
 
82
82
                                       FALSE );
83
83
 
84
84
  priv->source_index     = NOT_ACTIVE;
85
 
  priv->sink_input_index = NOT_ACTIVE;
 
85
  priv->source_output_index = NOT_ACTIVE;
86
86
  priv->client_index     = NOT_ACTIVE;
87
87
  priv->mute             = NOT_ACTIVE;
88
88
}
183
183
 
184
184
gboolean
185
185
voip_input_menu_item_is_interested (VoipInputMenuItem* item,
186
 
                                    gint sink_input_index,
 
186
                                    gint source_output_index,
187
187
                                    gint client_index)
188
188
{
189
189
  VoipInputMenuItemPrivate* priv = VOIP_INPUT_MENU_ITEM_GET_PRIVATE (item);
190
190
  // Check to make sure we are not handling another voip beforehand and that we
191
191
  // have an active sink (might need to match up at start up)
192
 
  if (priv->sink_input_index != NOT_ACTIVE &&
 
192
  if (priv->source_output_index != NOT_ACTIVE &&
193
193
      priv->source_index != NOT_ACTIVE){
194
194
    return FALSE;
195
195
  }
196
196
  
197
 
  priv->sink_input_index = sink_input_index;
 
197
  priv->source_output_index = source_output_index;
198
198
  priv->client_index     = client_index;
199
199
 
200
200
  return TRUE;
204
204
voip_input_menu_item_is_active (VoipInputMenuItem* item)
205
205
{
206
206
  VoipInputMenuItemPrivate* priv = VOIP_INPUT_MENU_ITEM_GET_PRIVATE (item);
207
 
  return (priv->sink_input_index != NOT_ACTIVE && priv->client_index != NOT_ACTIVE);
 
207
  return (priv->source_output_index != NOT_ACTIVE && priv->client_index != NOT_ACTIVE);
208
208
}
209
209
 
210
210
 
223
223
}
224
224
 
225
225
gint
226
 
voip_input_menu_item_get_sink_input_index (VoipInputMenuItem* item)
 
226
voip_input_menu_item_get_source_output_index (VoipInputMenuItem* item)
227
227
{
228
228
  VoipInputMenuItemPrivate* priv = VOIP_INPUT_MENU_ITEM_GET_PRIVATE (item);
229
229
 
230
 
  return priv->sink_input_index;
 
230
  return priv->source_output_index;
231
231
}
232
232
 
233
233
/**
250
250
{
251
251
  VoipInputMenuItemPrivate* priv = VOIP_INPUT_MENU_ITEM_GET_PRIVATE (item);
252
252
  priv->client_index = NOT_ACTIVE;
253
 
  priv->sink_input_index = NOT_ACTIVE;
 
253
  priv->source_output_index = NOT_ACTIVE;
254
254
  voip_input_menu_item_enable (item, FALSE);
255
255
}
256
256