Exemplo n.º 1
0
Arquivo: prefs.c Projeto: Cw1X/pnmixer
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();
}
Exemplo n.º 2
0
/**
 * Handles the 'size-changed' signal on the tray_icon by
 * calling update_status_icons().
 *
 * @param status_icon the object which received the signal
 * @param size the new size
 * @param user_data set when the signal handler was connected
 * @return FALSE, so Gtk+ scales the icon as necessary
 */
static gboolean
tray_icon_resized(G_GNUC_UNUSED GtkStatusIcon *status_icon,
		G_GNUC_UNUSED gint size, G_GNUC_UNUSED gpointer user_data)
{
	update_status_icons();
	return FALSE;
}
Exemplo n.º 3
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();
}
Exemplo n.º 4
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);
}
Exemplo n.º 5
0
/**
 * Handles the 'size-changed' signal on the tray_icon by
 * calling update_status_icons().
 *
 * @param status_icon the object which received the signal
 * @param size the new size
 * @param user_data set when the signal handler was connected
 * @return FALSE, so Gtk+ scales the icon as necessary
 */
static gboolean tray_icon_resized(GtkStatusIcon *status_icon,
				  gint           size,
				  gpointer       user_data) {
  update_status_icons();
  return FALSE;
}