From 17dbdaeea4f13c3fde35edbc745984ec31a2584c Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Thu, 19 Mar 2015 23:20:29 +0100 Subject: Playing an ugly sound when a timer is ringing --- src/Main.elm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Main.elm') diff --git a/src/Main.elm b/src/Main.elm index 42bcbc4..48c7320 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -9,9 +9,13 @@ import Mouse import Json.Encode (Value) import Keyboard import Char +import Dict +import List import Model.Model (..) import Model.Position (..) +import Model.TimerState (..) +import Model.Id (..) import Update.Update (..) import View.View (view) @@ -36,6 +40,18 @@ port clickPosition = Mouse.clicks (Signal.map positionEncoder Mouse.position) +port ringingTimers : Signal Bool +port ringingTimers = + Signal.map + (\model -> + model.timers + |> Dict.toList + |> List.map snd + |> List.any (\timer -> timer.state == Ringing) + ) + model + |> Signal.dropRepeats + port clickAway : Signal () port initialTime : Time -- cgit v1.2.3