From 7bd8b73c107590bc2e578395fe940b95752654c0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 15 May 2018 22:38:48 +0200 Subject: Newlines --- trivmix/Trivmix.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs index db3246a..ea8bad3 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs @@ -185,7 +185,7 @@ trivmix Options{..} = do Audio.withProcessMono client' input' (mix level') output' $ Jack.withActivation client' . Trans.lift $ do forM_ run $ \script -> - (callProcess script [client ++ ":" ++ input, client ++ ":" ++ output]) `catch` (\code -> errorConcurrent $ script ++ " failed: " ++ show (code :: ExitCode)) + (callProcess script [client ++ ":" ++ input, client ++ ":" ++ output]) `catch` (\code -> errorConcurrent $ script ++ " failed: " ++ show (code :: ExitCode) ++ "\n") forkIO . forever $ do -- Smooth out discontinuity let frames = interval * fps @@ -199,7 +199,7 @@ trivmix Options{..} = do EQ -> threadDelay . round $ interval * 1e6 _ -> do mapM_ (\x -> (swapMVar level' $! toRealFloat . unrefine . toLin $ linInt' x currentLevel newLevel) >> threadDelay delay) (takeWhile (<= 1) $ iterate (+ recip frames) 0) - errorConcurrent $ "Finished smooth transition from ‘" ++ show currentLevel ++ "’ to ‘" ++ show newLevel ++ "’." + errorConcurrent $ "Finished smooth transition from ‘" ++ show currentLevel ++ "’ to ‘" ++ show newLevel ++ "’.\n" notifyReady forever $ threadDelay (round $ watchdogInterval * 1e6) >> notifyWatchdog @@ -230,19 +230,19 @@ onStateFile file initial action = do let acquireFile = case exists of True -> return () False -> do - errorConcurrent $ "Creating ‘" ++ file ++ "’ (file)" + errorConcurrent $ "Creating ‘" ++ file ++ "’ (file)\n" createFile file defFileMode >>= closeFd >> writeFile file initial releaseFile = case exists of True -> return () False -> do - errorConcurrent $ "Removing ‘" ++ file ++ "’ (file)" + errorConcurrent $ "Removing ‘" ++ file ++ "’ (file)\n" removeFile file acquireDir = (flip mapM) (reverse createDirs) $ \directory -> do - errorConcurrent $ "Creating ‘" ++ directory ++ "’ (dir)" + errorConcurrent $ "Creating ‘" ++ directory ++ "’ (dir)\n" createDirectory directory setFileMode directory defDirectoryMode releaseDir = (flip mapM) createDirs $ \directory -> do - errorConcurrent $ "Removing ‘" ++ directory ++ "’ (dir)" + errorConcurrent $ "Removing ‘" ++ directory ++ "’ (dir)\n" removeDirectory directory acquire = acquireDir >> acquireFile release = releaseFile >> releaseDir @@ -267,10 +267,10 @@ readLevel levelChan current file = catch action handler oldLevel <- readMVar current when (oldLevel /= level) $ do writeChan levelChan level - errorConcurrent $ "Detected new level: " ++ show level + errorConcurrent $ "Detected new level ‘" ++ show level ++ "’.\n" handler e = if isUserError e then do - errorConcurrent $ "Could not parse new level from ‘" ++ file ++ "’ - overwriting." + errorConcurrent $ "Could not parse new level from ‘" ++ file ++ "’ - overwriting.\n" readMVar current >>= writeLevel file else throw e stripSpace = reverse . stripSpace' . reverse . stripSpace' @@ -281,5 +281,5 @@ readLevel levelChan current file = catch action handler writeLevel :: Show l => FilePath -> l -> IO () writeLevel file level = withFileLock file Exclusive $ const $ do - errorConcurrent $ "Writing out level ‘" ++ (show level) ++ "’ to ‘" ++ file ++ "’" + errorConcurrent $ "Writing out level ‘" ++ (show level) ++ "’ to ‘" ++ file ++ "’.\n" writeFile file (show level ++ "\n") -- cgit v1.2.3