Csound Csound-dev Csound-tekno Search About

[Cs-dev] internal callback

Date2006-10-26 22:53
FromVictor Lazzarini
Subject[Cs-dev] internal callback
One solution is to have this internal FLTK callback
be called in csound.c:

...
int csoundYield(CSOUND *csound)
  {
    if (exitNow_)
      csound->LongJmp(csound, CSOUND_SIGNAL);
    csound->InternalCallback(csound);
    return csound->csoundYieldCallback_(csound);
  }
...

and in winFLTK.c we do:

...
 csound->SetInternalYieldCallback(csound, CsoundYield_FLTK);
...

which in turn can be defined as (in csound.c):

...
static int  setInternalYieldCallback(CSOUND *);
...

setInternalYieldCallback,
/* NULL, */
        { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL},

...

void setInternalYieldCallback(CSOUND *csound,
                        int (*yieldCallback)(CSOUND *))
  {
    csound->InternalYieldCallback_ = yieldCallback;
  }
...

and declared in csoundCore.h as:

...
void (*SetInternalYieldCallback)(CSOUND *, int
(*yieldCallback)(CSOUND *));
/* SUBR dummyfn_1; */
    SUBR dummyfn_[99];
...

Victor


>
> Hi Victor,
>
> For adding a dedicated internal callback slot, my question
> would be do we expect the need for more than one at any
> time in the future?  If adding a single slot is enough,
> then that would certainly make it easier to implement and
> wouldn't interfere with the existing yieldCallback system.
> Also, if that's the solution, should it be called
> csoundInternalYieldCallback?
>
> I can do the change and add this all in but I wouldn't
> really have a way to test it that I can think of (though,
> I think Winsound has a yield callback going on in it that
> might be the issue with it freezing with a FLTK opcode CSD
> , which might make it testable).
>
> If this looks like the right thing to do, who should do
> the change?
>
> steven
>
>
> On 10/26/06, Victor Lazzarini 
> > wrote: I don't think this is the cause of the problem
> > with menus; I don't use the yield callback on
> > the Csound5 app and had problems with menus disappearing
> > , but managed to regain control of them.
> >
> > However, this might be the reason why MacCsound does not
> > work with FLTK.
> >
> > I would suggest that instead of appending callbacks,
> > which might cause problems perhaps, if there is indeed
> > an issue, we could set a
> > dedicated graphics callback that gets set in FLrun.
> >
> > Victor
> >
> > >
> > > Hi All,
> > >
> > > I noticed today that there might be an issue with FLTK
> > > and the csoundYieldCallback and if so if that might
> > > not be a source of issues for hosts (i.e. MacCsound).
> > > In InOut/widgets.cpp, if compiled without fltk
> > > threading, the fl_run opcode has:
> > >
> > > csound->SetYieldCallback(csound, CsoundYield_FLTK);
> > >
> > > This also happens in csoundModuleInit in
> > > InOut/winFLTK.c. As there's only one yield callback, I
> > > imagine if a host sets one, then csound goes to run,
> > > the FLTK yield callback is going to take the place of
> > the host one. >
> > > Could this be the source of the problem where
> > > MacCsound loses it's menus?
> > >
> > > I also seem to have problems running FLTK GUI's with
> > > other hosts (csound5gui, winsound) but each with
> > > different problems (the first doesn't show the gui,
> > > the second has the GUI showing but winsound becomes
> > inactive). >
> > > If this is it, what would be a solution?  Allowing an
> > > array of callbacks and adding or changing the method
> > > to appendYieldCallback?
> > >
> > > steven
> > >
> > >
> > >
> ----------------------------------------------------------
> > > --------------- Using Tomcat but need to do more? Need
> > > to support web services, security? Get stuff done
> quickly with pre-integrated technology to make your job
> > > easier Download IBM WebSphere Application Server
> > > v.1.0.1 based on Apache Geronimo
> > >
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > > _______________________________________________
> > > Csound-devel mailing list
> > > Csound-devel@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> > >
> ----------------------------------------------------------
> > --------------- Using Tomcat but need to do more? Need
> > to support web services, security? Get stuff done
> quickly with pre-integrated technology to make your job
> > easier Download IBM WebSphere Application Server v.1.0.1
> > based on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
>
> ----------------------------------------------------------
> --------------- Using Tomcat but need to do more? Need to
> support web services, security? Get stuff done quickly
> with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on
> Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-10-26 22:59
From"Steven Yi"
SubjectRe: [Cs-dev] internal callback
AttachmentsNone