Beispiel #1
0
void apply_prefs(gint alsa_change) {
  gint* vol_meter_clrs;
  scroll_step = g_key_file_get_integer_with_default(keyFile,"PNMixer","MouseScrollStep",1);

  if (g_key_file_get_boolean_with_default(keyFile,"PNMixer","EnableHotKeys",FALSE)) {
    gint mk,uk,dk,mm,um,dm,hstep;
    mk = g_key_file_get_integer_with_default(keyFile,"PNMixer", "VolMuteKey", -1);
    uk = g_key_file_get_integer_with_default(keyFile,"PNMixer", "VolUpKey", -1);
    dk = g_key_file_get_integer_with_default(keyFile,"PNMixer", "VolDownKey", -1);
    mm = g_key_file_get_integer_with_default(keyFile,"PNMixer", "VolMuteMods", 0);
    um = g_key_file_get_integer_with_default(keyFile,"PNMixer", "VolUpMods", 0);
    dm = g_key_file_get_integer_with_default(keyFile,"PNMixer", "VolDownMods", 0);
    hstep = g_key_file_get_integer_with_default(keyFile,"PNMixer", "HotkeyVolumeStep", 1);
    grab_keys(mk,uk,dk,mm,um,dm,hstep);
  } else 
    grab_keys(-1,-1,-1,0,0,0,1); // will actually just ungrab everything
  
  set_notifications_booleans();

  get_icon_theme();
  if (alsa_change)
    alsa_init();
  vol_meter_clrs = get_vol_meter_colors();
  set_vol_meter_color(vol_meter_clrs[0],vol_meter_clrs[1],vol_meter_clrs[2]);
  g_free(vol_meter_clrs);
  update_status_icons();
  update_vol_text();
}
Beispiel #2
0
/**
 * Reinitializes alsa and updates the various states.
 */
void
do_alsa_reinit(void)
{
	alsa_init();
	update_status_icons();
	update_vol_text();
	on_volume_has_changed();
}
Beispiel #3
0
/**
 * Reinitializes alsa and updates the tray icon.
 */
void do_alsa_reinit (void) {
  alsa_init();
  update_status_icons();
  update_vol_text();
  get_mute_state(TRUE);
}