From 55cee1104651ec938b8f4412993780b766a30f33 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 15 May 2018 18:49:14 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trivmix.cabal | 2 +- trivmix.nix | 2 +- trivmix/Trivmix.hs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/trivmix.cabal b/trivmix.cabal index 494e165..f5cf777 100644 --- a/trivmix.cabal +++ b/trivmix.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: trivmix -version: 3.3.0 +version: 3.3.1 -- synopsis: -- description: license: PublicDomain diff --git a/trivmix.nix b/trivmix.nix index 233cfb3..f5bb6c0 100644 --- a/trivmix.nix +++ b/trivmix.nix @@ -5,7 +5,7 @@ }: mkDerivation { pname = "trivmix"; - version = "3.3.0"; + version = "3.3.1"; src = ./.; isLibrary = true; isExecutable = true; diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs index 69a3b50..41370cc 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs @@ -184,11 +184,12 @@ trivmix Options{..} = do frames = interval * fps delay = round $ recip fps * 1e6 linInt x a b = a * (1 - x) + b * x - linInt' x a b = either error id $ asFloat (linInt x) a b + linInt' x a b = either (const 0) id $ asFloat (linInt x) a b mulBalance (bToFloat -> b) x = either error id $ asFloat (*) (Lin . either error id $ refine b) x newLevel <- mulBalance <$> readMVar balance <*> readMVar level currentLevel <- readMVar level' mapM_ (\x -> swapMVar level' (linInt' x currentLevel newLevel) >> threadDelay delay) [0,recip frames..1] + notifyWatchdog mix :: MVar Level -> CFloat -> IO CFloat mix level input = do -- cgit v1.2.3