Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Context = Ptr CInternal
- data ContextFlags
- data ContextState
- type ContextSuccessCB = Context -> CInt -> Ptr Userdata -> IO ()
- getContext :: PAMainloop a => a -> String -> IO Context
- connectContext :: Context -> Maybe String -> [ContextFlags] -> IO (Maybe Int)
- setStateCallback :: Context -> IO () -> IO ()
- getContextServer :: Context -> IO (Maybe String)
- getContextState :: Context -> IO ContextState
- getContextErr :: Context -> IO Int
- getContextErrStr :: Context -> IO String
- wrapSuccess :: (Bool -> IO ()) -> IO (FunPtr ContextSuccessCB)
Documentation
data ContextFlags Source #
data ContextState Source #
type ContextSuccessCB = Context -> CInt -> Ptr Userdata -> IO () Source #
Callback type for functions that only report success
:: PAMainloop a | |
=> a | The mainloop implementation |
-> String | The application name |
-> IO Context |
Create a pulseaudio context
:: Context | The context |
-> Maybe String | The server to connect to. If this is Nothing, connect to the default server. |
-> [ContextFlags] | Flags to control the startup behaviour of the server. -> SpawnApi! -- TODO |
-> IO (Maybe Int) |
Connect a Context to a pulseaudio server.
setStateCallback :: Context -> IO () -> IO () Source #
This callback is leaked! if it's reset IMO the handler should stay forever aswell (even if just for loggin), so don't worry about it. This should only be called once per application run though, so it will be a known issue for know.
getContextServer :: Context -> IO (Maybe String) Source #
Get the Servername from a (connected) Context
.
getContextState :: Context -> IO ContextState Source #
Get the current state from a Context
.
wrapSuccess :: (Bool -> IO ()) -> IO (FunPtr ContextSuccessCB) Source #
Wrapp a function callback for ContextSuccessCB