Пример #1
0
void 
xvd_notify_volume_notification(XvdInstance *Inst)
{
	gint vol = xvd_get_readable_volume (&Inst->volume);
	if (vol == 0)
		xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-off", vol);
	else if (vol < 34)
		xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-low", vol);
	else if (vol < 67)
		xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-medium", vol);
	else
		xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-high", vol);
}
Пример #2
0
void
xvd_notify_undershoot_notification(XvdInstance *Inst)
{
	xvd_notify_notification (Inst, 
	    (Inst->mute) ? "audio-volume-muted" : "audio-volume-low",
	    (Inst->gauge_notifications) ? -1 : 0);
}
Пример #3
0
void
xvd_notify_overshoot_notification(XvdInstance *Inst)
{
	xvd_notify_notification (Inst, 
	    (Inst->mute) ? "audio-volume-muted" : "audio-volume-high",
	    (Inst->gauge_notifications) ? 101 : 100);
}
Пример #4
0
static
void xvd_mute_handler (const char *keystring, void *Inst)
{
  XvdInstance *xvd_inst = (XvdInstance *) Inst;
  
  g_debug ("The LowerVolume key was pressed.");
  
  if (xvd_mixer_toggle_mute (xvd_inst)) {
		#ifdef HAVE_LIBNOTIFY
			if (xvd_inst->muted)
				xvd_notify_notification (xvd_inst, "audio-volume-muted", xvd_inst->current_vol);
			else {
				xvd_mixer_init_volume (xvd_inst);
				xvd_notify_volume_notification (xvd_inst);
			}
		#endif
	}
}