[Prev][Next][Index][Thread]
Here's a midi question for you....
-
To: info-dylan@ai.mit.edu
-
Subject: Here's a midi question for you....
-
From: "selena" <smd7@cs.waikato.ac.nz>
-
Date: Wed, 17 May 2000 05:30:01 -0400 (EDT)
-
Cache-Post-Path: clint.waikato.ac.nz!unknown@chrp.cs.waikato.ac.nz
-
Organization: University of Waikato News Cache
-
Xref: traf.lcs.mit.edu comp.lang.dylan:12034
I have a created a midi event with all the details and want to place a
pointer to this event in the lpData-value field of the MIDIHDR structure.
The lpData-value field needs to be of type <LPSTR>, and in the C code this
field is accessed by using
midiHdr.lpData = (LPBYTE)&phrase[0]; // (when accessing an array as
opposed to a midi event)
How do I do this in Dylan????
// declarations of the two midi structures
let LPmidievent = make (<LPMIDIEVENT>); // This could be an array/vector of
midi instructions instead
let LPmidihdr = make(<LPMIDIHDR>);
// Any ideas
LPmidihdr.lpData-value := ???; // This needs to point to the midievent
Thanks in advance
Selena
(Dylan Defn's below)
NOTE:
define C-struct <MIDIHDR>
sealed inline-only slot lpData-value :: <LPSTR>;
sealed inline-only slot dwBufferLength-value :: <DWORD>;
sealed inline-only slot dwBytesRecorded-value :: <DWORD>;
sealed inline-only slot dwUser-value :: <DWORD>;
sealed inline-only slot dwFlags-value :: <DWORD>;
sealed inline-only slot lpNext-value :: <LPMIDIHDR>;
sealed inline-only slot reserved-value :: <DWORD>;
sealed inline-only slot dwOffset-value :: <DWORD>;
sealed inline-only array slot dwReserved-array :: <DWORD>,
length: 8, address-getter: dwReserved-value;
pack: 1;
pointer-type-name: <LPMIDIHDR>;
c-name: "struct midihdr_tag";
end C-struct <MIDIHDR>;
define C-struct <MIDIEVENT>
sealed inline-only slot dwDeltaTime-value :: <DWORD>;
sealed inline-only slot dwStreamID-value :: <DWORD>;
sealed inline-only slot dwEvent-value :: <DWORD>;
sealed inline-only array slot dwParms-array :: <DWORD>, length: 1,
address-getter: dwParms-value;
pack: 1;
pointer-type-name: <LPMIDIEVENT>;
c-name: "struct midievent_tag";
end C-struct <MIDIEVENT>;
Follow-Ups: