~oem-solutions-group/unity-2d/indicator-sound

« back to all changes in this revision

Viewing changes to src/pulse-manager.c

  • Committer: Ken VanDine
  • Date: 2010-09-14 19:13:49 UTC
  • mfrom: (28.2.108 indicator-sound)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: ken.vandine@canonical.com-20100914191349-pp888e13xbemy0kc
Tags: upstream-0.4.5
ImportĀ upstreamĀ versionĀ 0.4.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
/**
52
52
Future Refactoring notes
53
 
 - Push all UI updates out through update PA state in the service.
54
 
 - Collapse 3 update_sink_info into one. The essentially do the same thing from different contexts.
 
53
 - rewrite in vala.
 
54
 - make sure all state is kept in the service for volume icon switching.
55
55
**/
56
56
 
57
57
/**
147
147
  // Firstly check to see if we have any sinks
148
148
  // if not get the hell out of here !
149
149
  if (g_hash_table_size(sink_hash) < 1) {
150
 
    /*        g_debug("Sink_available returning false because sinks_hash is empty !!!");    */
 
150
    g_debug("Sink_available returning false because sinks_hash is empty !!!");   
151
151
    DEFAULT_SINK_INDEX = -1;
152
152
    return FALSE;
153
153
  }
163
163
 
164
164
  // Thirdly ensure the default sink index does not have the name "auto_null"
165
165
  sink_info* s = g_hash_table_lookup(sink_hash, GINT_TO_POINTER(DEFAULT_SINK_INDEX));
166
 
  // Up until now the most rebust method to test this is to manually remove the available sink device
 
166
  // Up until now the most robust method to test this is to manually remove the available sink device
167
167
  // kernel module and then reload (rmmod & modprobe).
168
168
  // TODO: Edge case of dynamic loading and unloading of sinks should be handled also.
169
169
  /*    g_debug("About to test for to see if the available sink is null - s->name = %s", s->name);*/
211
211
  if (GPOINTER_TO_INT(user_data) == 1) {
212
212
    sound_service_dbus_update_sink_mute(dbus_service, TRUE);
213
213
  } else {
214
 
    //sound_service_dbus_update_sink_volume(dbus_service, get_default_sink_volume());
215
214
                dbus_menu_manager_update_volume(get_default_sink_volume());
216
215
  }
217
216
 
411
410
          pa_volume_t vol = pa_cvolume_max(&s->volume);
412
411
          gdouble volume_percent = ((gdouble) vol * 100) / PA_VOLUME_NORM;
413
412
          /*                    g_debug("Updating volume from PA manager with volume = %f", volume_percent);*/
414
 
          //sound_service_dbus_update_sink_volume(dbus_service, volume_percent);
415
413
                dbus_menu_manager_update_volume(volume_percent);
416
414
        }
417
415
      }