Blitz (130/176)

From:amorel
Date:29 Jul 2001 at 22:22:46
Subject:Drawing a sample

I am using this subroutine to draw a sample into a window(with 620
innerwidth). *w0 is a pointer to window 0. I calculate stapint so I can show
the whole sample into the window, thus it will only show every stapint byte. I
have tried everything I can think of, but I can`t get this routine to draw the
"whole"(it`s not really whole as it steps throught the data, but you get the
point) sample. As in from beginning to end. It somehow stops 3/4 from the end.
I just can`t understand why this hapens.

Anyone give me a clue? Thanks =)

.visualsample
wintitle20$="Sample"
NResetTagList #WA_Flags, #WA_Flags2
NAddTag #WA_Title, &wintitle20$
NAddTag #WA_IDCMP, #IDCMP2
NAddTag #WA_CustomScreen, NScreenID
NAddTag #WA_NewLookMenus, 1
*mysound.sound=Addr Sound(soundnr)
Dim soundarr.b(*mysound\_length)
CopyMem_ *mysound\_data,&soundarr(0),*mysound\_length
*w20.Window=NWindow(20,0,150,*w0\BorderLeft+620+*w0\BorderRight,*w0
BorderTop+256+*w0\BorderBottom,taglist)
NUseWindow(20)
NDrawingOutput(NWindowRastPort)
NFrontColour 1
xsam.w=*w20\BorderLeft+1:ysam.w=(256/2)+*w20\BorderTop
stapint.w=(*mysound\_length)/620
teller.l=0
Repeat
If teller<=*mysound\_length
NLine xsam,ysam,xsam,ysam+(soundarr(teller))
xsam=xsam+1
EndIf
teller=teller+stapint
Until (xsam>*w20\BorderLeft+620) OR (teller>*mysound\_length)
Repeat
NVWait
idcmp=NWindowEvent
Until idcmp=#IDCMP_CLOSEWINDOW
NCloseWindow(20)
NUseWindow(0)
Return



-*AMOREL*- musician/programmer \ \ Amiga 1200T/PPC/040/32/6g more shit
http://www.xs4all.nl/~amorel \ \ Good old C=64 and an attitude!
Running QNX rtp, linux, AmigaOS \ \ / /Half a decent studio
Music: www.mp3.com/vopak \ \/ /Contact me for bookings,
www.xs4all.nl/~amorel/amusic.html \/\/productions,demos,programs...

-*R u an AOL l33t? ----------> Amoralplayer1.5, a no fuss audioplayer*-

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie