A monadic interface to the JACK api. The client handle is hidden in a Reader so you don't have to touch it.
For now please refer to the documentation of the C library found at
http://jackaudio.org/files/docs/html/jack_8h.html
for a complete description
Unlifted versions can be found in Sound.Jack.Bindings
- runWithNewClient :: String -> [Options] -> String -> ([Status] -> JackAction a) -> ([Status] -> IO a) -> IO a
- runWithNewClientDefaultServer :: [Options] -> String -> ([Status] -> JackAction a) -> ([Status] -> IO a) -> IO a
- data JackAction a
- getClientName :: JackAction String
- activate :: JackAction Int
- deactivate :: JackAction Int
- clientThreadId :: JackAction PThread
- isRealtime :: JackAction Bool
- cycleWait :: JackAction Word32
- cycleSignal :: Int -> JackAction ()
- setProcessThread :: ThreadCallback -> Ptr () -> JackAction Int
- setThreadInitCallback :: ThreadInitCallback -> Ptr () -> JackAction Int
- setProcessCallback :: ProcessCallback -> Ptr () -> JackAction Int
- setFreewheelCallback :: FreewheelCallback -> Ptr () -> JackAction Int
- setBufferSizeCallback :: BufferSizeCallback -> Ptr () -> JackAction Int
- setSampleRateCallback :: SampleRateCallback -> Ptr () -> JackAction Int
- setClientRegistrationCallback :: ClientRegistrationCallback -> Ptr () -> JackAction Int
- setPortRegistrationCallback :: PortRegistrationCallback -> Ptr () -> JackAction Int
- setPortConnectCallback :: PortConnectCallback -> Ptr () -> JackAction Int
- setGraphOrderCallback :: GraphOrderCallback -> Ptr () -> JackAction Int
- setXrunCallback :: XRunCallback -> Ptr () -> JackAction Int
- setFreewheel :: Bool -> JackAction Int
- setBufferSize :: Word32 -> JackAction Int
- getSampleRate :: JackAction CUInt
- getBufferSize :: JackAction Word32
- engineTakeoverTimebase :: JackAction Int
- cpuLoad :: JackAction Float
- portRegister :: String -> String -> [PortFlags] -> Int -> JackAction Port
- portUnregister :: Port -> JackAction Int
- portIsMine :: Port -> JackAction Bool
- portGetAllConnections :: Port -> JackAction [String]
- jackPortGetTotalLatency :: Port -> JackAction Word32
- recomputeTotalLatencies :: JackAction Int
- portRequestMonitorByName :: String -> Bool -> JackAction Int
- connect :: String -> String -> JackAction Int
- disconnect :: String -> String -> JackAction Int
- portDisconnect :: Port -> JackAction Int
- getPorts :: String -> String -> [PortFlags] -> JackAction [String]
- portByName :: String -> JackAction Port
- portById :: PortID -> JackAction Port
- framesSinceCycleStart :: JackAction Word32
- frameTime :: JackAction Word32
- framesToTime :: Word32 -> JackAction Time
- timeToFrames :: Time -> JackAction Word32
- unsafeAskClient :: JackAction Client
- unsafeClientClose :: JackAction ()
- clientNameSize :: JackAction Int
- internalClientNew :: String -> String -> String -> JackAction Int
- internalClientClose :: String -> JackAction ()
- portGetBuffer :: Port -> Word32 -> JackAction (Ptr AudioSample)
- portName :: Port -> JackAction String
- portShortName :: Port -> JackAction String
- portFlags :: Port -> JackAction [PortFlags]
- portType :: Port -> JackAction String
- portConnected :: Port -> JackAction Int
- portGetConnections :: Port -> JackAction [String]
- jackPortGetLatency :: Port -> JackAction Word32
- portSetLatency :: Port -> Word32 -> JackAction ()
- portSetName :: Port -> String -> JackAction Int
- portSetAlias :: Port -> String -> JackAction Int
- portUnsetAlias :: Port -> String -> JackAction Int
- portRequestMonitor :: Port -> Bool -> JackAction Int
- portEnsureMonitor :: Port -> Bool -> JackAction Int
- portMonitoringInput :: Port -> JackAction Int
- portNameSize :: JackAction Int
- portTypeSize :: JackAction Int
- getTime :: JackAction Time
- data Port
- data PortFlags
- type AudioSample = CFloat
- type BufferSizeCallback = CUInt -> Ptr () -> IO CInt
- type ClientRegistrationCallback = Ptr CChar -> CInt -> Ptr () -> IO ()
- type FreewheelCallback = CInt -> Ptr () -> IO ()
- type GraphOrderCallback = Ptr () -> IO CInt
- type PortConnectCallback = CUInt -> CUInt -> CInt -> Ptr () -> IO ()
- type PortRegistrationCallback = CUInt -> CInt -> Ptr () -> IO ()
- type ProcessCallback = CUInt -> Ptr () -> IO CInt
- type SampleRateCallback = CUInt -> Ptr () -> IO CInt
- type ThreadCallback = Ptr () -> IO (Ptr ())
- type ThreadInitCallback = Ptr () -> IO ()
- type XRunCallback = Ptr () -> IO CInt
- data Options
- = NullOption
- | NoStartServer
- | UseExactName
- | ServerName
- | LoadName
- | LoadInit
- data Client
- data Status
- = Failure
- | InvalidOption
- | NameNotUnique
- | ServerStarted
- | ServerFailed
- | ServerError
- | NoSuchClient
- | LoadFailure
- | InitFailure
- | ShmFailure
- | VersionError
- | BackendError
- | ClientZombie
- data PortID
- defaultAudioType :: String
- defaultMidiType :: String
- fromPThread :: PThread -> CULong
- type NFrames = CUInt
- data PThread
- type Time = CULLong
Documentation
runWithNewClient :: String -> [Options] -> String -> ([Status] -> JackAction a) -> ([Status] -> IO a) -> IO aSource
create a new Client, install Exception handlers and run the supplied action
Takes the server name, creation options, the name of the client , the action to run and the action to run the client could not be created
runWithNewClientDefaultServer :: [Options] -> String -> ([Status] -> JackAction a) -> ([Status] -> IO a) -> IO aSource
create a new Client, install Exception handlers and run the supplied action
Takes creation options, the name of the client, the action to run and the action to run the client could not be created
data JackAction a Source
JackAction is a ReaderT Client over IO
Run it with runWithNewClient[DefaultServer]
cycleSignal :: Int -> JackAction ()Source
setProcessThread :: ThreadCallback -> Ptr () -> JackAction IntSource
setXrunCallback :: XRunCallback -> Ptr () -> JackAction IntSource
setFreewheel :: Bool -> JackAction IntSource
portRegister :: String -> String -> [PortFlags] -> Int -> JackAction PortSource
portIsMine :: Port -> JackAction BoolSource
disconnect :: String -> String -> JackAction IntSource
portByName :: String -> JackAction PortSource
portById :: PortID -> JackAction PortSource
unsafeAskClient :: JackAction ClientSource
Read the client handle from the reader. You shouldn't need that.
unsafeClientClose :: JackAction ()Source
close the Client. RunWithNewClient should normally do that for you.
internalClientNew :: String -> String -> String -> JackAction IntSource
portGetBuffer :: Port -> Word32 -> JackAction (Ptr AudioSample)Source
portName :: Port -> JackAction StringSource
portFlags :: Port -> JackAction [PortFlags]Source
portType :: Port -> JackAction StringSource
portConnected :: Port -> JackAction IntSource
portGetConnections :: Port -> JackAction [String]Source
portSetLatency :: Port -> Word32 -> JackAction ()Source
portSetName :: Port -> String -> JackAction IntSource
portSetAlias :: Port -> String -> JackAction IntSource
portUnsetAlias :: Port -> String -> JackAction IntSource
portRequestMonitor :: Port -> Bool -> JackAction IntSource
portEnsureMonitor :: Port -> Bool -> JackAction IntSource
type AudioSample = CFloatSource
fromPThread :: PThread -> CULongSource