]> Git — Sourcephile - tmp/julm/arpeggigon.git/blob - RMCA/Unknown/Shared.hs
Tiles are removable by dragging them outside.
[tmp/julm/arpeggigon.git] / RMCA / Unknown / Shared.hs
1 module Shared ( inRef
2 , outRef
3 , clientRef
4 ) where
5
6 import ClientState
7 import MIDI
8
9 import Control.Concurrent.MVar
10 import Data.Map ( Map
11 , empty
12 )
13 import FRP.Yampa
14 import Sound.JACK ( NFrames
15 )
16
17 -- | MVar containing all the events given by the input port.
18 inRef :: IO (MVar EventQueue)
19 inRef = newMVar empty
20
21 -- | MVar containing all the events to be given to the output port.
22 outRef :: IO (MVar EventQueue)
23 outRef = newMVar empty
24
25 -- | MVar containing the state of the machine (JACK client and ports).
26 clientRef :: Int -> NFrames -> NFrames -> IO (MVar ClientState)
27 clientRef rate outSize inSize = newMVar $ ClientState { rate = rate
28 , outSize = outSize
29 , inSize = inSize
30 }