BRELS_MIDI_HEADER

typedef struct
{
	DWORD dwMagic;
	DWORD dwSize;
	WORD  wFormat;
	WORD  wTracks;
	WORD  wBeatSize;
} BRELS_MIDI_HEADER, *LPBRELS_MIDI_HEADER;

This is the MIDI header as found in a MIDI file. The header is the first 14 bytes of any MIDI file.

Members

Remarks

Due to the difference between the storage method of the file and its memory representation, the byte order of values in each member of the structure is reversed. Use btlw and btldw to correct them:

Example

void CorrectMidiHeader(LPBRELS_MIDI_HEADER lpbmh)
{
	lpbmh->dwMagic = btldw(lpbmh->dwMagic);
	lpbmh->dwSize = btldw(lpbmh->dwSize);
	lpbmh->wFormat = btlw(lpbmh->wFormat);
	lpbmh->wTracks = btlw(lpbmh->wTracks);
	lpbmh->wBeatSize = btlw(lpbmh->wBeatSize);
};

Further information

Released in November 19th, 2003
Updated in April 29th, 2004
Property of Breno de Lima Sarmento
Home page: http://www27.brinkster.com/brels
E-mail: [email protected]
ICQ: 78977999 ()