Safe Haskell | None |
---|---|
Language | Haskell98 |
Interface to PortMidi
Synopsis
- data PMError
- data PMSuccess
- newtype PMEventCount = PMEventCount CInt
- type PMStream = ForeignPtr PortMidiStream
- data DeviceInfo = DeviceInfo {}
- type DeviceID = Int
- data PMMsg = PMMsg {}
- data PMEvent = PMEvent {}
- filterActive :: CLong
- filterSysex :: CLong
- filterClock :: CLong
- filterPlay :: CLong
- filterTick :: CLong
- filterFD :: CLong
- filterUndefined :: CLong
- filterReset :: CLong
- filterRealtime :: CLong
- filterNote :: CLong
- filterChannelAftertouch :: CLong
- filterPolyAftertouch :: CLong
- filterAftertouch :: CLong
- filterProgram :: CLong
- filterControl :: CLong
- filterPitchBend :: CLong
- filterMTC :: CLong
- filterSongPosition :: CLong
- filterSongSelect :: CLong
- filterTune :: CLong
- filterSystemCommon :: CLong
- initialize :: IO (Either PMError PMSuccess)
- terminate :: IO (Either PMError PMSuccess)
- hasHostError :: PMStream -> IO Bool
- getErrorText :: PMError -> IO String
- getSuccessText :: PMSuccess -> IO String
- getText :: Either PMError PMSuccess -> IO String
- countDevices :: IO DeviceID
- getDefaultInputDeviceID :: IO (Maybe DeviceID)
- getDefaultOutputDeviceID :: IO (Maybe DeviceID)
- getDeviceInfo :: DeviceID -> IO DeviceInfo
- openInput :: DeviceID -> IO (Either PMError PMStream)
- openOutput :: DeviceID -> Int -> IO (Either PMError PMStream)
- setFilter :: PMStream -> CLong -> IO (Either PMError PMSuccess)
- channel :: Int -> CLong
- setChannelMask :: PMStream -> CLong -> IO (Either PMError PMSuccess)
- abort :: PMStream -> IO (Either PMError PMSuccess)
- close :: PMStream -> IO (Either PMError PMSuccess)
- poll :: PMStream -> IO (Either PMError PMSuccess)
- readEvents :: PMStream -> IO (Either PMError [PMEvent])
- readEventsToBuffer :: PMStream -> Ptr PMEvent -> CLong -> IO (Either PMError PMEventCount)
- writeEvents :: PMStream -> [PMEvent] -> IO (Either PMError PMSuccess)
- writeShort :: PMStream -> PMEvent -> IO (Either PMError PMSuccess)
- writeSysEx :: PMStream -> Timestamp -> String -> IO (Either PMError PMSuccess)
- time :: IO Timestamp
- encodeMsg :: PMMsg -> CLong
- decodeMsg :: CLong -> PMMsg
Data Types
Represents real errors of the C enum PmError
HostError | |
InvalidDeviceId | |
InsufficientMemory | |
BufferTooSmall | |
BufferOverflow | |
BadPtr | |
BadData | |
InternalError | |
BufferMaxSize |
Represents non-errors of the C enum PmError
NoError'NoData | Returned by |
GotData | Only returned by |
Instances
Enum PMSuccess Source # | |
Defined in Sound.PortMidi succ :: PMSuccess -> PMSuccess # pred :: PMSuccess -> PMSuccess # fromEnum :: PMSuccess -> Int # enumFrom :: PMSuccess -> [PMSuccess] # enumFromThen :: PMSuccess -> PMSuccess -> [PMSuccess] # enumFromTo :: PMSuccess -> PMSuccess -> [PMSuccess] # enumFromThenTo :: PMSuccess -> PMSuccess -> PMSuccess -> [PMSuccess] # | |
Eq PMSuccess Source # | |
Show PMSuccess Source # | |
newtype PMEventCount Source #
Represents a count of PMEvent
s
Instances
type PMStream = ForeignPtr PortMidiStream Source #
data DeviceInfo Source #
Instances
Eq DeviceInfo Source # | |
Defined in Sound.PortMidi.DeviceInfo (==) :: DeviceInfo -> DeviceInfo -> Bool # (/=) :: DeviceInfo -> DeviceInfo -> Bool # | |
Show DeviceInfo Source # | |
Defined in Sound.PortMidi.DeviceInfo showsPrec :: Int -> DeviceInfo -> ShowS # show :: DeviceInfo -> String # showList :: [DeviceInfo] -> ShowS # |
Instances
Eq PMEvent Source # | |
Show PMEvent Source # | |
Storable PMEvent Source # | |
Constants
filterActive :: CLong Source #
filterSysex :: CLong Source #
filterClock :: CLong Source #
filterPlay :: CLong Source #
filterTick :: CLong Source #
filterReset :: CLong Source #
filterNote :: CLong Source #
filterTune :: CLong Source #
PortMidi functions
getDeviceInfo :: DeviceID -> IO DeviceInfo Source #
poll :: PMStream -> IO (Either PMError PMSuccess) Source #
Returns wether or not a subsequent call to readEvents
would return
some PMEvent
s or not.
readEvents :: PMStream -> IO (Either PMError [PMEvent]) Source #
Reads at most 256 PMEvent
s, using a dynamically allocated buffer.
:: PMStream | |
-> Ptr PMEvent | The |
-> CLong | The size of the |
-> IO (Either PMError PMEventCount) | When |
Reads PMEvent
s and writes them to the buffer passed as argument.