1 {-# LANGUAGE Arrows #-}
3 -- Contains all the information and functions necessary to run a Jack
4 -- port and exchange information through reactive values and Yampa.
5 module Reactogon.Translator.Jack where
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
11 import Reactogon.Translator.Message
12 import qualified Sound.JACK as Jack
13 import qualified Sound.JACK.MIDI as JMIDI
15 reactogonName :: String
16 reactogonName = "Reactogon"
22 outPortName = "output"
25 jackSetup = Jack.handleExceptions $
26 Jack.withClientDefault reactogonName $ \client ->
27 Jack.withPort client outPortName $ \output ->
28 Jack.withPort client inPortName $ \input ->
29 jackRun client input output (jackCallBack client input output)
31 jackRun client input output callback =
32 Jack.withProcess client callback $ do
33 Trans.lift $ putStrLn $ "Started " ++ reactogonName
34 Trans.lift $ Jack.waitForBreak
36 jackCallBack client input output = undefined