diff options
author | Joris Guyonvarch | 2015-03-19 23:20:29 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-19 23:21:00 +0100 |
commit | 17dbdaeea4f13c3fde35edbc745984ec31a2584c (patch) | |
tree | 5a40dc00ff83eac29d5b1758438957d103afe1ce /src | |
parent | 99b203c956f99875c7263c445668a425a463e416 (diff) |
Playing an ugly sound when a timer is ringing
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.elm | 16 | ||||
-rw-r--r-- | src/Update/UpdateTimerEdition.elm | 1 |
2 files changed, 16 insertions, 1 deletions
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 diff --git a/src/Update/UpdateTimerEdition.elm b/src/Update/UpdateTimerEdition.elm index da12ed0..cff39f7 100644 --- a/src/Update/UpdateTimerEdition.elm +++ b/src/Update/UpdateTimerEdition.elm @@ -3,7 +3,6 @@ module Update.UpdateTimerEdition ) where import Char (..) -import Debug import Model.TimerEdition (..) |