[futurebasic] Re: [FB] RE: xref of a pointer...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2010 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Tue, 10 Aug 2010 09:50:25 +1200

Waverly wrote:

> Ah, something just hit me.
>  
> begin record StereoRec
> dim as SInt16 left
> dim as SInt16 right
> end record
>  
> numOfSamples = fn getptrsize(bufferPtr)
>  
> xref channelSamples( _maxInt ) as StereoRec
>  
> channelSamples = bufferPtr
> for indx = 0 to numberOrSamples
> leftChannel = channelSamples.left( indx)
> rightChannel = channelSamples.right( indx)
> // do something with left and right channels
> next

_leftChan  = 0
_rightChan = 1
xref channelSamples(_maxLong, 1) as SInt16
channelSamples = bufferPtr
for indx = 0 to num_stereo_samples - 1
  leftChanVal  = channelSamples(indx, _leftChan)
  rightChanVal = channelSamples(indx, _rightChan)
next

Robert P.