Re: Bernie - mixedlib question

new topic     » goto parent     » topic index » view thread      » older message » newer message

Bernie Ryan wrote:
> 
> 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:
> 
> 
> }}}
<eucode>
> 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)
> 
> </eucode>
{{{

> 
> 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:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

That was quick!

but, the entire structure is

record("AUDIOENVELOPE",
        "aEnvelope : STRUCT : AUDIOPOINT " &         -- AUDIO_MAX_POINTS = 12
        "nPoints : uchar : 1 " &
        "nSustain : uchar : 1 " &
        "nLoopStart : uchar : 1 " &
        "nLoopEnd : uchar : 1 " &
        "wFlags : ushort : 1 " &
        "nSpeed : ushort : 1 " )

so how can I define aEnvelope to be an array of 12 AUDIOPOINTS ?

Chris




http://euallegro.wikispaces.com
http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/
http://members.aol.com/chriscrylex/EUSQLite/eusql.html

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu