Winapi: midioutlongmsg-sends a system-specific MIDI message to the output device.

Source: Internet
Author: User
Tip:
Before the buffer is sent to midioutlongmsg, call midioutprepareheader preparation and globalalloc to allocate memory to tmidihdr and the buffer to which lpdata points (gmem_moveable and gmem_share are used) and use globallock to lock the buffer.

// Declaration: midioutlongmsg (hmidiout: hmidiout; {Device handle} lpmidiouthdr: pmidihdr; {tmidihdr structure pointer} usize: uint {tmidihdr structure size}): mmresult; {0 is returned successfully; for possible error values, see:} mmsyserr_invalhandle = 5; {the device handle is invalid} midierr_unprepared = 64; {the buffer tmidihdr is not ready} midierr_notready = 67; {Device Busy with other data} // tmidihdr is the redefinition of the midihdr_tag structure: midihdr_tag = record lpdata: pchar; {dedicated buffer pointer} dwbufferlength: DWORD; {specified buffer length} dwbytesrecorded: DWORD; {specify the data volume in the buffer during input} dwuser: DWORD; {specify user data} dwflags: DWORD; {specify the buffer information flag} lpnext: pmidihdr; {reserved (to device)} Reserved: DWORD; {reserved (to device)} dwoffset: DWORD; {buffer offset at callback start} dwreserved: array [0 .. 7] of DWORD; {reserved (to the system)} end; // optional value of dwflags: mhdr_done = $00000001; {the device has returned the buffer. Program } Mhdr_prepared = $00000002; {a buffer has been prepared for midiinprepareheader or midioutprepareheader} mhdr_inqueue = $00000004; {reserved (to the device)} mhdr_isstrm = $00000008; {stream buffer}
  
   
 // Example:
  
   
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.