PortMidi-0.2.0.0: A binding for PortMedia/PortMidi

Safe HaskellNone
LanguageHaskell98

Sound.PortMidi

Contents

Description

Interface to PortMidi

Synopsis

Data Types

data PMError Source #

Represents real errors of the C enum PmError

Instances
Enum PMError Source # 
Instance details

Defined in Sound.PortMidi

Eq PMError Source # 
Instance details

Defined in Sound.PortMidi

Methods

(==) :: PMError -> PMError -> Bool #

(/=) :: PMError -> PMError -> Bool #

Show PMError Source # 
Instance details

Defined in Sound.PortMidi

data PMSuccess Source #

Represents non-errors of the C enum PmError

Constructors

NoError'NoData

Returned by poll when there is no data, and returned by other functions when there is no error.

GotData

Only returned by poll when data is available.

newtype PMEventCount Source #

Represents a count of PMEvents

Constructors

PMEventCount CInt 
Instances
Enum PMEventCount Source # 
Instance details

Defined in Sound.PortMidi

Eq PMEventCount Source # 
Instance details

Defined in Sound.PortMidi

Integral PMEventCount Source # 
Instance details

Defined in Sound.PortMidi

Num PMEventCount Source # 
Instance details

Defined in Sound.PortMidi

Ord PMEventCount Source # 
Instance details

Defined in Sound.PortMidi

Real PMEventCount Source # 
Instance details

Defined in Sound.PortMidi

Show PMEventCount Source # 
Instance details

Defined in Sound.PortMidi

type PMStream = ForeignPtr PortMidiStream Source #

data DeviceInfo Source #

Constructors

DeviceInfo 

Fields

Instances
Eq DeviceInfo Source # 
Instance details

Defined in Sound.PortMidi.DeviceInfo

Show DeviceInfo Source # 
Instance details

Defined in Sound.PortMidi.DeviceInfo

data PMMsg Source #

Constructors

PMMsg 

Fields

Instances
Eq PMMsg Source # 
Instance details

Defined in Sound.PortMidi

Methods

(==) :: PMMsg -> PMMsg -> Bool #

(/=) :: PMMsg -> PMMsg -> Bool #

Show PMMsg Source # 
Instance details

Defined in Sound.PortMidi

Methods

showsPrec :: Int -> PMMsg -> ShowS #

show :: PMMsg -> String #

showList :: [PMMsg] -> ShowS #

data PMEvent Source #

Constructors

PMEvent 

Fields

Instances
Eq PMEvent Source # 
Instance details

Defined in Sound.PortMidi

Methods

(==) :: PMEvent -> PMEvent -> Bool #

(/=) :: PMEvent -> PMEvent -> Bool #

Show PMEvent Source # 
Instance details

Defined in Sound.PortMidi

Storable PMEvent Source # 
Instance details

Defined in Sound.PortMidi

Constants

PortMidi functions

poll :: PMStream -> IO (Either PMError PMSuccess) Source #

Returns wether or not a subsequent call to readEvents would return some PMEvents or not.

readEvents :: PMStream -> IO (Either PMError [PMEvent]) Source #

Reads at most 256 PMEvents, using a dynamically allocated buffer.

readEventsToBuffer Source #

Arguments

:: PMStream 
-> Ptr PMEvent

The PMEvents buffer which will contain the results.

-> CLong

The size of the PMEvent buffer, in number of elements. No more that this number of PMEvents can be read at once.

-> IO (Either PMError PMEventCount)

When Right, returns the number of elements written to the PMEvent buffer.

Reads PMEvents and writes them to the buffer passed as argument.

Time function

time :: IO Timestamp Source #