diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-09 13:51:49 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-09 13:51:49 +0100 |
commit | 2f5f880136f3411e7e8d919631e71ef05d0ae9ad (patch) | |
tree | daed8f635d51e9e0d5669e23786b59cc9b0c44a6 | |
parent | 6454da50559e0eee810f81d33365a621857d8068 (diff) | |
download | trivmix-2f5f880136f3411e7e8d919631e71ef05d0ae9ad.tar trivmix-2f5f880136f3411e7e8d919631e71ef05d0ae9ad.tar.gz trivmix-2f5f880136f3411e7e8d919631e71ef05d0ae9ad.tar.bz2 trivmix-2f5f880136f3411e7e8d919631e71ef05d0ae9ad.tar.xz trivmix-2f5f880136f3411e7e8d919631e71ef05d0ae9ad.zip |
Allow multiple run scripts
-rw-r--r-- | trivmix.cabal | 6 | ||||
-rw-r--r-- | trivmix.nix | 2 | ||||
-rw-r--r-- | trivmix/Trivmix.hs | 18 |
3 files changed, 9 insertions, 17 deletions
diff --git a/trivmix.cabal b/trivmix.cabal index c7676dd..0386561 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.6.5 | 5 | version: 2.7.0 |
6 | -- synopsis: | 6 | -- synopsis: |
7 | -- description: | 7 | -- description: |
8 | license: PublicDomain | 8 | license: PublicDomain |
@@ -52,7 +52,3 @@ executable adjmix | |||
52 | , trivmix | 52 | , trivmix |
53 | hs-source-dirs: adjmix | 53 | hs-source-dirs: adjmix |
54 | default-language: Haskell2010 | 54 | default-language: Haskell2010 |
55 | |||
56 | -- Local Variables: | ||
57 | -- firestarter: "nix-shell -p haskellPackages.cabal2nix --command 'cabal2nix ./.' | tee trivmix.nix" | ||
58 | -- End: | ||
diff --git a/trivmix.nix b/trivmix.nix index 4faa518..4230663 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.6.5"; | 7 | version = "2.7.0"; |
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 a13460f..cf9587f 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs | |||
@@ -43,7 +43,7 @@ data Options = Options | |||
43 | , output :: String | 43 | , output :: String |
44 | , client :: String | 44 | , client :: String |
45 | , initialLevel :: Level | 45 | , initialLevel :: Level |
46 | , run :: Maybe String | 46 | , run :: [FilePath] |
47 | , levelFiles :: [FilePath] | 47 | , levelFiles :: [FilePath] |
48 | } | 48 | } |
49 | 49 | ||
@@ -71,11 +71,11 @@ optionParser = Options | |||
71 | <> value def | 71 | <> value def |
72 | <> showDefault | 72 | <> showDefault |
73 | ) | 73 | ) |
74 | <*> optional ( strOption ( long "run" | 74 | <*> many ( strOption ( long "run" |
75 | <> metavar "FILE" | 75 | <> metavar "FILE" |
76 | <> help "Execute a file once setup of jacks is done (use this to autoconnect)\nThe executable gets passed the input port (including client name) as its first argument and the output as its second." | 76 | <> help "Execute a file once setup of jacks is done (use this to autoconnect)\nThe executable gets passed the input port (including client name) as its first argument and the output as its second." |
77 | ) | 77 | ) |
78 | ) | 78 | ) |
79 | <*> some (strArgument ( metavar "FILE..." | 79 | <*> some (strArgument ( metavar "FILE..." |
80 | <> help "Files that contain levels to assume and synchronize\nFor deterministic behaviour use flock(2).\nThe format used in these files is either a signed float, using ‘.’ as a decimal point or a signed float postfixed with ‘dB’.\nCaveat: ‘-InfinitydB’ exists and works as expected (i.e.: it is equal to ‘0.0’)" | 80 | <> help "Files that contain levels to assume and synchronize\nFor deterministic behaviour use flock(2).\nThe format used in these files is either a signed float, using ‘.’ as a decimal point or a signed float postfixed with ‘dB’.\nCaveat: ‘-InfinitydB’ exists and works as expected (i.e.: it is equal to ‘0.0’)" |
81 | ) | 81 | ) |
@@ -138,11 +138,7 @@ trivmix Options{..} = do | |||
138 | Jack.withPort client' input $ \input' -> | 138 | Jack.withPort client' input $ \input' -> |
139 | Jack.withPort client' output $ \output' -> do | 139 | Jack.withPort client' output $ \output' -> do |
140 | Trans.lift $ do | 140 | Trans.lift $ do |
141 | case run of | 141 | mapM_ (flip callProcess [client ++ ":" ++ input, client ++ ":" ++ output]) run |
142 | Nothing -> return () | ||
143 | Just run' -> do | ||
144 | (_, _, _, ph) <- createProcess $ (proc run' [client ++ ":" ++ input, client ++ ":" ++ output]) { delegate_ctlc = True } | ||
145 | return () | ||
146 | Audio.withProcessMono client' input' (mix level') output' $ | 142 | Audio.withProcessMono client' input' (mix level') output' $ |
147 | Jack.withActivation client' . forever . Trans.lift $ threadDelay 1000000 | 143 | Jack.withActivation client' . forever . Trans.lift $ threadDelay 1000000 |
148 | 144 | ||