Re: Bernie - mixedlib question
- Posted by Bernie Ryan <xotron at bluefrog.com> Sep 12, 2006
- 496 views
Chris Burch wrote: > > Hi > > I'm trying to do this > > --typedef struct { > -- USHORT nFrame; /* envelope frame */ > > -- USHORT nValue; /* envelope value */ > > --} AUDIOPOINT, *PAUDIOPOINT; > > record("AUDIOPOINT", > "nFrame : ushort : 1 " & > "nValue : ushort : 1 ") > > --/* audio envelope structure */ > --typedef struct { > -- AUDIOPOINT aEnvelope[AUDIO_MAX_POINTS]; /* envelope points */ > > > --/* audio envelope structure */ > --typedef struct { > -- AUDIOPOINT aEnvelope[AUDIO_MAX_POINTS]; /* envelope points */ > > > record("AUDIOENVELOPE", > "aEnvelope : STRUCT : AUDIOPOINT" & -- AUDIO_MAX_POINTS = 12 > > (heavily snipped) > > However, I can't get my head round how to create a repeating structure > (aEnvelope) > AUDIO_MAX_POINTS long (12) for the AUDIOENVELOPE record. > Chris:
constant AUDIO_MAX_POINTS = 12 record("AUDIOPOINT", "nFrame : ushort : 1 " & "nValue : ushort : 1 ") -- This creates an Array of AUDIO_MAX_POINTS ( 12 ) structures. -- The structures will be initialize to all zeros. -- -- use putsArray and grabsArray to access the array. -- atom aEnvelope aEnvelope = sArray("AUDIOPOINT",AUDIO_MAX_POINTS)
You can do this same thing with any of my libraries. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan