Index   Commented   Search   About

Using a Window or Thread to Manage Buffered Playback

The following messages can be sent to a window or thread for managing playback of MIDI system-exclusive messages or stream buffers:

MM_MOM_CLOSE
Sent when the device is closed by using the midiOutClose function.
MM_MOM_DONE
Sent when the device driver is finished with a data block sent by using the midiOutLongMsg or midiStreamOut function.
MM_MOM_OPEN
Sent when the device is opened by using the midiOutOpen function.

A wParam parameter and an lParam parameter are associated with each of these messages. The wParam parameter always specifies the handle of an open MIDI device. For MM_MOM_DONE, lParam specifies an address of a MIDIHDR structure identifying the completed data block. The lParam parameter is unused for MM_MOM_CLOSE and MM_MOM_OPEN.

The most useful message is probably MM_MOM_DONE. Unless you need to allocate memory or initialize variables, you probably do not need to process MM_MOM_OPEN and MM_MOM_CLOSE. When playback of a data block is complete, you can clean up and free the data block.

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference (win32.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun