summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2014-04-04 18:48:15 -0400
committerAndrew Cady <d@jerkface.net>2014-04-04 18:49:41 -0400
commitcc69ac075ed563189143453942a3add015c4a8de (patch)
tree56a7639415e04de84cecc312a3bbbe4a73c74418
parent3328bb11eaa9d3e1b74b607f919ec345c8b9db2b (diff)
make midi inputs and outputs optional
-rw-r--r--AlsaSeq.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/AlsaSeq.hs b/AlsaSeq.hs
index 8fb5bd2..22208bd 100644
--- a/AlsaSeq.hs
+++ b/AlsaSeq.hs
@@ -111,6 +111,17 @@ cmdlineAlsaConnect h public = do
111 args <- getArgs 111 args <- getArgs
112 case args of 112 case args of
113 113
114 ["0"] -> do
115 return ()
116
117 ["0", output] -> do
118 (Connect.createTo h public =<< Addr.parse h output)
119 return ()
120
121 [input] -> do
122 (Connect.createFrom h public =<< Addr.parse h input)
123 return ()
124
114 [input, output] -> do 125 [input, output] -> do
115 (Connect.createFrom h public =<< Addr.parse h input) 126 (Connect.createFrom h public =<< Addr.parse h input)
116 (Connect.createTo h public =<< Addr.parse h output) 127 (Connect.createTo h public =<< Addr.parse h output)
@@ -118,7 +129,8 @@ cmdlineAlsaConnect h public = do
118 129
119 _ -> do 130 _ -> do
120 showAlsaPorts h 131 showAlsaPorts h
121 IO.hPutStrLn IO.stderr "need arguments: input-port output-port" 132 IO.hPutStrLn IO.stderr "need arguments: <input-port> [output-port]"
133 IO.hPutStrLn IO.stderr " (use port 0 for no input)"
122 Exit.exitFailure 134 Exit.exitFailure
123 135
124inputPendingLoop h b = do 136inputPendingLoop h b = do