[futurebasic] SndRecord Toolbox function

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: "support@..." <support@...>
Date: Tue, 29 Jun 1999 13:24:14 -0500
Hello FB People,

  In order to use the sndRecord function I have guessed that I need to
convert it into asm code, but haven't quite got the hang of translation.
This is what I have tried, but I keep crashing... Am I way off base?
Does anyone have any routines for using the sndRecord function?

' pascal syntax
' SndRecord(filterProc: ProcPtr; corner: Point; quality;
'                         OSType; VAR sndHandle: Handle): OSErr;
LOCAL MODE
LOCAL FN SndRecord
  DIM myPoint.4, OSErr%, myNIL, myHandle, myQuality,ptr1,ptr2,ptr3,ptr4
  myPoint.v = 20: myPoint.h = 100
  myNIL = _nil
  myHandle = _nil
  myQuality = _Sigoodquality
  ptr1 = @myNil
  ptr2 = @myPoint
  ptr3 = @myQuality
  ptr4 = @myHandle
  `    SUBQ.L  #2,sp                    ;clear space for OSErr
  `    MOVE.L  ^ptr1,-(sp)             ;push params on stack
  `    MOVE.L  ^ptr2,-(sp)          ;push params on stack
  `    MOVE.L  ^ptr3,-(sp)         ;push params on stack
  `    MOVE.L  ^ptr4,-(sp)             ;push params on stack
  `    DC.W    $08040014                ;trap number
  `    MOVE.W  (sp)+,D0                 ;D0 = OSErr
  `    EXT.L   D0
END FN


Cheers,
Robert Price
Programmer/Technical Support
support@...