diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-09 17:04:50 +0100 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-09 17:04:50 +0100 |
| commit | 70e600346fb5875defe14d578883c9838695d533 (patch) | |
| tree | 280720bc936c3244d858339ac4c7b0784b768343 | |
| parent | 6dd4d2560b7a50b3d9415983560e2a1aa9046381 (diff) | |
| download | trivmix-70e600346fb5875defe14d578883c9838695d533.tar trivmix-70e600346fb5875defe14d578883c9838695d533.tar.gz trivmix-70e600346fb5875defe14d578883c9838695d533.tar.bz2 trivmix-70e600346fb5875defe14d578883c9838695d533.tar.xz trivmix-70e600346fb5875defe14d578883c9838695d533.zip | |
Make failing startup scripts nonfatal
| -rw-r--r-- | trivmix.cabal | 2 | ||||
| -rw-r--r-- | trivmix.nix | 2 | ||||
| -rw-r--r-- | trivmix/Trivmix.hs | 12 |
3 files changed, 9 insertions, 7 deletions
diff --git a/trivmix.cabal b/trivmix.cabal index 130680d..6ce861a 100644 --- a/trivmix.cabal +++ b/trivmix.cabal | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | -- documentation, see http://haskell.org/cabal/users-guide/ | 2 | -- documentation, see http://haskell.org/cabal/users-guide/ |
| 3 | 3 | ||
| 4 | name: trivmix | 4 | name: trivmix |
| 5 | version: 2.7.1 | 5 | version: 2.7.3 |
| 6 | -- synopsis: | 6 | -- synopsis: |
| 7 | -- description: | 7 | -- description: |
| 8 | license: PublicDomain | 8 | license: PublicDomain |
diff --git a/trivmix.nix b/trivmix.nix index 88df3fe..734fb36 100644 --- a/trivmix.nix +++ b/trivmix.nix | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | }: | 4 | }: |
| 5 | mkDerivation { | 5 | mkDerivation { |
| 6 | pname = "trivmix"; | 6 | pname = "trivmix"; |
| 7 | version = "2.7.1"; | 7 | version = "2.7.3"; |
| 8 | src = ./.; | 8 | src = ./.; |
| 9 | isLibrary = true; | 9 | isLibrary = true; |
| 10 | isExecutable = true; | 10 | isExecutable = true; |
diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs index cf9587f..fdd94b4 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs | |||
| @@ -26,6 +26,7 @@ import qualified Control.Monad.Exception.Synchronous as Sync | |||
| 26 | import Control.Exception | 26 | import Control.Exception |
| 27 | import System.IO.Error | 27 | import System.IO.Error |
| 28 | import System.IO | 28 | import System.IO |
| 29 | import System.Exit | ||
| 29 | 30 | ||
| 30 | import System.FileLock | 31 | import System.FileLock |
| 31 | import System.INotify | 32 | import System.INotify |
| @@ -136,11 +137,12 @@ trivmix Options{..} = do | |||
| 136 | Jack.handleExceptions $ | 137 | Jack.handleExceptions $ |
| 137 | Jack.withClientDefault client $ \client' -> | 138 | Jack.withClientDefault client $ \client' -> |
| 138 | Jack.withPort client' input $ \input' -> | 139 | Jack.withPort client' input $ \input' -> |
| 139 | Jack.withPort client' output $ \output' -> do | 140 | Jack.withPort client' output $ \output' -> |
| 140 | Trans.lift $ do | 141 | Audio.withProcessMono client' input' (mix level') output' $ |
| 141 | mapM_ (flip callProcess [client ++ ":" ++ input, client ++ ":" ++ output]) run | 142 | Jack.withActivation client' . Trans.lift $ do |
| 142 | Audio.withProcessMono client' input' (mix level') output' $ | 143 | forM_ run $ \script -> |
| 143 | Jack.withActivation client' . forever . Trans.lift $ threadDelay 1000000 | 144 | (callProcess script [client ++ ":" ++ input, client ++ ":" ++ output]) `catch` (\code -> hPutStrLn stderr $ script ++ " failed: " ++ show (code :: ExitCode)) |
| 145 | forever $ threadDelay 1000000 | ||
| 144 | 146 | ||
| 145 | mix :: MVar Level -> CFloat -> IO CFloat | 147 | mix :: MVar Level -> CFloat -> IO CFloat |
| 146 | mix level input = do | 148 | mix level input = do |
