Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Callback functions...

Date2006-01-19 19:44
FromVictor Lazzarini
SubjectRe: [Cs-dev] Callback functions...
1. is csoundthread::csound created properly?
2. is it a public member of the class? If it's
protected or private, then accessing it might
be a problem (although this check should happen at
compile time).
3. Does the violation happen at the call to
...setCallback()? Or is it when the callback is
first invoked by csound?


>
> Ok, here's what I'm doing now, I wrap my function in
> extern "C"
>
>
>
> extern "C" {
> extern void csoundMessageCallback(CSOUND *csound,int attr,
> const char  *format, va_list valist);
> }
>
> I then call this callback function from RuncCsoudClick(),
> a public  method in my main class.
>
> void __fastcall TForm1::RunCsound1Click(TObject *Sender)
> {
>      if(!CSOUND_ON)
>        {
>        perfCsound = true;
>        runCsound = new csoundthread(false);
>        RichEdit1->Clear();
>        RichEdit1->Update();
>        csoundSetMessageCallback(runCsound->csound,
> csoundMessageCallback);
>        CSOUND_ON = true;
>        RunCsound1->Caption = "Stop Audio";
>        }
>      else
>        {
>        CSOUND_ON = false;
>        perfCsound = false;
>        RunCsound1->Caption = "Start Audio";
>        }
> }
>
>
> It builds and compiles fine but I still get the same
> access violation  errors.
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files for problems?  Stop!  Download the new
> AJAX search engine that makes searching your log files as
> easy as surfing the  web.  DOWNLOAD SPLUNK!
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-01-19 20:02
FromRory Walsh
SubjectRe: [Cs-dev] Callback functions...
> 1. is csoundthread::csound created properly?
Yes, at least everything else runs fine when I comment out my 
..setCsoundCallback()

> 2. is it a public member of the class? 
Yes.

> 3. Does the violation happen at the call to ...setCallback()? Or 
>is it when the callback is  first invoked by csound? 

Mmm, I just tried to find this out and I noticed that if I put a 
Sleep(100) just before I call CsoundSetMessageCallback() it runs fine, 
messages and everything. Any ideas? I don't mind a slight pause before 
execution.

Rory.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net