Alarm notification now pushes ringtones
authorEnrico Zini <enrico@enricozini.org>
Sun, 28 Mar 2010 15:07:24 +0000 (16:07 +0100)
committerEnrico Zini <enrico@enricozini.org>
Sun, 28 Mar 2010 15:07:24 +0000 (16:07 +0100)
src/app_alarm.vala
src/app_notify.vala

index 8b7cfd2e763aa3e668e05966650968661d2cff0b..e09879f035921f6b1063f2d58c63ac740ec10231 100644 (file)
@@ -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;
     }
index 13b5ae64e37b91bb4d39f710b4eeaa5427c75d36..2a4b14c52fa852d95aa0661f90db6d9742b1de55 100644 (file)
@@ -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);