I am trying to get FMOD.DLL to call my callback
more than once.
The definition from the C header, fmod.h:
typedef signed char (F_CALLBACKAPI *FSOUND_STREAMCALLBACK) (FSOUND_STREAM
*stream, void *buff, int len, void *userdata);
The Factor definition:
: stream-callback ( -- object ) "char" {
On 2-Apr-07, at 8:48 AM, Anton Rolls wrote:
> : stream-callback ( -- object ) "char" { "void*" "void*" "int"
> "void*" }
> "stdcall" [
> "callbacked" .
> ! drop "len: " write . 2drop
> 1 ! return TRUE to continue the stream
> ] alien-callback ;
This doesn't print anything; try
I assure it does successfully print "callbacked" once.
I think you missed the . word from prettyprint.
(I should have known that comment on the next
line would cause trouble.)
Anton.
> On 2-Apr-07, at 8:48 AM, Anton Rolls wrote:
>
> > : stream-callback ( -- object ) "char" { "void*" "void*" "i
Anton,
. does not flush; perhaps that's what Slava was getting at.
However, you are also doing things way wrong...your function expects
four arguments yet you leave them on the stack!
: stream-callback ( -- object )
"char" { "void*" "void*" "int" "void*" } "stdcall" [
"callbak'd!
CC,
The stack effect of npick is shown as ( quot n -- a ). Shouldn't it just be:
( n -- a )
Ed
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to
On 2-Apr-07, at 11:28 AM, Anton Rolls wrote:
> I assure it does successfully print "callbacked" once.
>
> I think you missed the . word from prettyprint.
>
> (I should have known that comment on the next
> line would cause trouble.)
>
> Anton.
Sorry I missed the '.'. But still, try adding a 'flu
On 4/3/07, Eduardo Cavazos <[EMAIL PROTECTED]> wrote:
> The stack effect of npick is shown as ( quot n -- a ). Shouldn't it just be:
>
> ( n -- a )
Good find! I've fixed it and pushed a patch.
Chris.
--
http://www.bluishcoder.co.nz
---
Slava, Doug,
Thanks for the tips.
I've now ensured that the arguments are consumed.
Using print flush instead of . flush makes no difference
in this case, unfortunately. I get the same result; "callbacked"
is printed only once.
I'll keep working on it.
I have a little test DLL to test callbac
On 2-Apr-07, at 9:53 PM, Anton Rolls wrote:
> I take it that there is no problem returning the integer 1
> and that it will be converted to a char for me by the
> definition below.
Correct.
Good luck.
Slava
-
Take Survey