From: Enrico Zini Date: Sun, 28 Mar 2010 15:07:24 +0000 (+0100) Subject: Alarm notification now pushes ringtones X-Git-Url: https://git.toastfreeware.priv.at/gregoa/zavai.git/commitdiff_plain/fc78e7dc311a6027925ce2cdbfb1d6928501a981?ds=sidebyside Alarm notification now pushes ringtones --- diff --git a/src/app_alarm.vala b/src/app_alarm.vala index 8b7cfd2..e09879f 100644 --- a/src/app_alarm.vala +++ b/src/app_alarm.vala @@ -60,25 +60,25 @@ protected class AlarmNotifierDialog : ui.notify.Notifier message_button.show(); } - protected virtual bool push_aux_state() + protected override bool push_aux_state() { - var state = new zavai.led.LedState(name); + var state = new zavai.led.LedState(notifier_name); state.set_blink(255); zavai.led.aux.push_state(state); return true; } - protected virtual bool push_vibrator_state() + protected override bool push_vibrator_state() { - var state = new zavai.led.LedState(name); + var state = new zavai.led.LedState(notifier_name); state.set_blink(255); zavai.led.aux.push_state(state); return true; } - protected virtual bool push_ringtone_state() + protected override bool push_ringtone_state() { - var state = new zavai.audio.PlayerState(name, config.ringtone_alarm, true); + var state = new zavai.audio.PlayerState(notifier_name, config.ringtone_alarm, true); zavai.audio.soundplayer.push_state(state); return true; } diff --git a/src/app_notify.vala b/src/app_notify.vala index 13b5ae6..2a4b14c 100644 --- a/src/app_notify.vala +++ b/src/app_notify.vala @@ -56,12 +56,12 @@ public abstract class Notifier : Gtk.Dialog // Setup our attention seeking strategy bool has_aux = zavai.led.aux != null && push_aux_state(); bool has_vibrator = zavai.led.vibrator != null && push_vibrator_state(); - // TODO bool has_ringtone = zavai.audio.soundplayer != null && push_ringtone_state(); + bool has_ringtone = zavai.audio.soundplayer != null && push_ringtone_state(); // Run dialog int res = base.run(); - // TODO: Restore ringtone state + if (has_ringtone) zavai.audio.soundplayer.pop_state(notifier_name); if (has_vibrator) zavai.led.vibrator.pop_state(notifier_name); if (has_aux) zavai.led.aux.pop_state(notifier_name); ui.power.backlight.release(notifier_name);