| Safe Haskell | None | 
|---|---|
| Language | Haskell98 | 
Sound.PortMidi
Description
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
Constructors
| HostError | |
| InvalidDeviceId | |
| InsufficientMemory | |
| BufferTooSmall | |
| BufferOverflow | |
| BadPtr | |
| BadData | |
| InternalError | |
| BufferMaxSize | 
Represents non-errors of the C enum PmError
Constructors
| NoError'NoData | Returned by  | 
| GotData | Only returned by  | 
Instances
| Enum PMSuccess Source # | |
| Defined in Sound.PortMidi Methods 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 PMEvents
Constructors
| PMEventCount CInt | 
Instances
type PMStream = ForeignPtr PortMidiStream Source #
data DeviceInfo Source #
Constructors
| DeviceInfo | |
Instances
| Eq DeviceInfo Source # | |
| Defined in Sound.PortMidi.DeviceInfo | |
| Show DeviceInfo Source # | |
| Defined in Sound.PortMidi.DeviceInfo Methods 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 PMEvents or not.
readEvents :: PMStream -> IO (Either PMError [PMEvent]) Source #
Reads at most 256 PMEvents, using a dynamically allocated buffer.
Arguments
| :: PMStream | |
| -> Ptr PMEvent | The  | 
| -> CLong | The size of the  | 
| -> IO (Either PMError PMEventCount) | When  | 
Reads PMEvents and writes them to the buffer passed as argument.