]> Git — Sourcephile - tmp/julm/arpeggigon.git/blob - RCMA/Translator/Jack.hs
Changed all module names.
[tmp/julm/arpeggigon.git] / RCMA / Translator / Jack.hs
1 {-# LANGUAGE Arrows #-}
2
3 -- Contains all the information and functions necessary to run a Jack
4 -- port and exchange information through reactive values and Yampa.
5 module RCMA.Translator.Jack where
6
7 import qualified Control.Monad.Exception.Synchronous as Sync
8 import qualified Control.Monad.Trans.Class as Trans
9 import qualified Foreign.C.Error as E
10 import Hails.Yampa
11 import RCMA.Translator.Message
12 import qualified Sound.JACK as Jack
13 import qualified Sound.JACK.MIDI as JMIDI
14
15 rcmaName :: String
16 rcmaName = "RCMA"
17
18 inPortName :: String
19 inPortName = "input"
20
21 outPortName :: String
22 outPortName = "output"
23
24 jackSetup :: IO ()
25 jackSetup = Jack.handleExceptions $
26 Jack.withClientDefault rcmaName $ \client ->
27 Jack.withPort client outPortName $ \output ->
28 Jack.withPort client inPortName $ \input ->
29 jackRun client input output (jackCallBack client input output)
30
31 jackRun client input output callback =
32 Jack.withProcess client callback $ do
33 Trans.lift $ putStrLn $ "Started " ++ rcmaName
34 Trans.lift $ Jack.waitForBreak
35
36 jackCallBack client input output = undefined