| Class TMidiOutput (unit MidiOut) |
TComponent
-------------------------------------------------------------------
| Constructors |
constructor Create(AOwner:TComponent);| Functions |
function Close: Boolean;
destructor Destroy;
function Open: Boolean;-------------------------------------------------------------------
procedure PutLong(TheSysex: Pointer; msgLength: Word);
procedure PutMidiEvent( theEvent: TMyMidiEvent);
procedure PutShort(MidiMessage: Byte; Data1: Byte; Data2: Byte);
procedure SetVolume( Left: Word; Right:Word );
function midioutErrorString( WError: Word ): String;
procedure MidiOutput(var Message: TMessage);-------------------------------------------------------------------
procedure SetDeviceID(DeviceID: Integer);
procedure SetProductName( NewProductName: String );
procedure SetTechnology( NewTechnology : OutPortTech );| Properties |
property DeviceID : Integer
property ProductName : String
property ChannelMask : Word
property DriverVersion : Version
property Error : Word
property MIDIHandle : Hmidiout
property Notes : Word
property Numdevs : Word
property Support : DWORD
property Technology : OutPortTech
property Voices : Word| Events |
event Onmidioutput : TNotifyEvent| Variables |
FChannelMask : Word;
FDeviceID : Integer;
FDriverVersion : Version;
FError : Word;
FMIDIHandle : Hmidiout;
FNotes : Word;
FNumdevs : Word;
FOnMIDIOutput : TNotifyEvent;
FProductName : string;
FState : midioutputState;
FSupport : DWORD;
FTechnology : OutPortTech;
FVoices : Word;
Handle : THandle;
PBuffer : PCircularBuffer;
PCtlInfo : PMidiCtlInfo;| Constructors |
constructor Create(AOwner:TComponent);Not used in Delphi 3 { This is the callback procedure in the external DLL. It's used when midioutOpen is called by the Open method. There are special requirements and restrictions for this callback procedure (see midioutOpen in MMSYSTEM.HLP) so it's impractical to make it an object method } {$IFDEF WIN32} function midiHandler( hMidiIn: HMidiIn; wMsg: UINT; dwInstance: DWORD; dwParam1: DWORD; dwParam2: DWORD): Boolean; stdcall; external 'DELMID32.DLL'; {$ELSE} function midiHandler( hMidiIn: HMidiIn; wMsg: Word; dwInstance: DWORD; dwParam1: DWORD; dwParam2: DWORD): Boolean; far; external 'DELPHMID.DLL'; {$ENDIF} *) {-------------------------------------------------------------------
| Functions |
function Close: Boolean;-------------------------------------------------------------------
destructor Destroy;-------------------------------------------------------------------
function Open: Boolean;Methods
-------------------------------------------------------------------
procedure PutLong(TheSysex: Pointer; msgLength: Word);-------------------------------------------------------------------
procedure PutMidiEvent( theEvent: TMyMidiEvent);-------------------------------------------------------------------
procedure PutShort(MidiMessage: Byte; Data1: Byte; Data2: Byte);-------------------------------------------------------------------
procedure SetVolume( Left: Word; Right:Word );-------------------------------------------------------------------
function midioutErrorString( WError: Word ): String;-------------------------------------------------------------------} { Convert the numeric return code from an MMSYSTEM function to a string using midioutGetErrorText. TODO: These errors aren't very helpful (e.g. "an invalid parameter was passed to a system function") so some proper error strings would be nice.
procedure MidiOutput(var Message: TMessage);Sysex output finished
-------------------------------------------------------------------
procedure SetDeviceID(DeviceID: Integer);-------------------------------------------------------------------} { Set the output device ID and change the other properties to match
procedure SetProductName( NewProductName: String );-------------------------------------------------------------------} { Set the product name property and put the matching output device number in FDeviceID. This is handy if you want to save a configured output/output device by device name instead of device number, because device numbers may change if users install or remove MIDI devices. Exception if output device with matching name not found, or if output device is open
procedure SetTechnology( NewTechnology : OutPortTech );-------------------------------------------------------------------} { Set the output technology property and put the matching output device number in FDeviceID. This is handy, for example, if you want to be able to switch between a sound card and a MIDI port
| Properties |
property DeviceID : Integer
property ProductName : StringTODO: Property editor with dropdown list of product names
property ChannelMask : WordNumber of notes (internal synth)
property DriverVersion : Version
property Error : Wordpatch caching etc.
property MIDIHandle : HmidioutProperties
property Notes : WordNumber of voices (internal synth)
property Numdevs : Word
property Support : DWORDdevice responds to (internal synth)
property Technology : OutPortTechDriver version from midioutGetDevCaps
property Voices : WordType of MIDI output device
| Events |
event Onmidioutput : TNotifyEventTODO: midiOutGetVolume? Or two properties for Left and Right volume? Is it worth it?? midiOutMessage?? Does anyone use this? } { Events
| Variables |
FChannelMask : Word;Number of notes (internal synth)
FDeviceID : Integer;Window handle used for callback notification
FDriverVersion : Version;Last MMSYSTEM error } { Stuff from midioutCAPS
FError : Word;Output queue for PutTimedEvent, set by Open
FMIDIHandle : Hmidiout;MIDI device ID
FNotes : Word;Number of voices (internal synth)
FNumdevs : Word;Technology supported (volume control, patch caching etc.
FOnMIDIOutput : TNotifyEvent;Number of MIDI output devices on system
FProductName : string;Driver version from midioutGetDevCaps
FState : midioutputState;Handle to output device
FSupport : DWORD;Bit set for each MIDI channels that the device responds to (internal synth)
FTechnology : OutPortTech;product name
FVoices : Word;Type of MIDI output device
Handle : THandle;
PBuffer : PCircularBuffer;Pointer to control info for DLL
PCtlInfo : PMidiCtlInfo;Current device state