pulseaudio-0.0.2.1: A low-level (incomplete) wrapper around the pulseaudio client asynchronous api

Safe HaskellNone
LanguageHaskell2010

Sound.Pulse.Context

Description

Maintianer : ongy Stability : experimental

The Context is the main object for the pulseaudio api. Most functions that communicate with the server, are defined on the Context.

Synopsis

Documentation

type Context = Ptr CInternal Source #

Type we will be using for pa_context

type ContextSuccessCB = Context -> CInt -> Ptr Userdata -> IO () Source #

Callback type for functions that only report success

getContext Source #

Arguments

:: PAMainloop a 
=> a

The mainloop implementation

-> String

The application name

-> IO Context 

Create a pulseaudio context

connectContext Source #

Arguments

:: 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.

getContextErr :: Context -> IO Int Source #

Get the last error from a Context.

getContextErrStr :: Context -> IO String Source #

Get the last error from a Context in a human readable String.

wrapSuccess :: (Bool -> IO ()) -> IO (FunPtr ContextSuccessCB) Source #

Wrapp a function callback for ContextSuccessCB