Csound Csound-dev Csound-tekno Search About

[Cs-dev] Multiple instance changes

Date2005-05-28 21:26
FromMichael Gogins
Subject[Cs-dev] Multiple instance changes
Those responsible for opcodes -- plugin opcodes, or builtin opcodes -- may need to make changes in their code now that people will be using Csound 5 in multiple instantiations, e.g. as several csoundvst_api objects in PD or multiple CsoundVST plugins in Cubase.

If you have objects or other variables that are global to your plugin module, you will need to change these from single objects to a table of objects indexed by the Csound instance. The easiest way to do this is to declare

std::map myobject;

instead of 

MyGlobalObject myobject

in your code.

Then you would access it

myopcodefunc(void *csound, MyOpcodeStruct *struct)
{
   myobject[csound].doSomething();
}

instead of

myopcodefunc(void *csound, MyOpcodeStruct *struct)
{
   myobject.doSomething();
}

Of course there are "C"-only ways of doing this.

I am fixing up the mixer and STK opcodes to work this way.

Regards,
Mike






-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-29 10:47
FromIstvan Varga
SubjectRe: [Cs-dev] Multiple instance changes
Michael Gogins wrote:

> Those responsible for opcodes -- plugin opcodes, or builtin opcodes
 > -- may need to make changes in their code now that people will be using
 > Csound 5 in multiple instantiations, e.g. as several csoundvst_api objects
 > in PD or multiple CsoundVST plugins in Cubase.

I already changed my opcodes earlier. It would be useful to create a list of
opcodes that still have problems (one example is sfont.c).


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-07-08 18:04
FromAndres Cabrera
SubjectRe: [Cs-dev] Multiple instance changes
Hi,

I'm working on LADSPA and DSSI host plugins for csound, and I need to
remove some static variable. What's the correct way to do this in C not
C++?

Thanks,
Andrés

On Sat, 2005-05-28 at 15:26, Michael Gogins wrote:
> Those responsible for opcodes -- plugin opcodes, or builtin opcodes -- may need to make changes in their code now that people will be using Csound 5 in multiple instantiations, e.g. as several csoundvst_api objects in PD or multiple CsoundVST plugins in Cubase.
> 
> If you have objects or other variables that are global to your plugin module, you will need to change these from single objects to a table of objects indexed by the Csound instance. The easiest way to do this is to declare
> 
> std::map myobject;
> 
> instead of 
> 
> MyGlobalObject myobject
> 
> in your code.
> 
> Then you would access it
> 
> myopcodefunc(void *csound, MyOpcodeStruct *struct)
> {
>    myobject[csound].doSomething();
> }
> 
> instead of
> 
> myopcodefunc(void *csound, MyOpcodeStruct *struct)
> {
>    myobject.doSomething();
> }
> 
> Of course there are "C"-only ways of doing this.
> 
> I am fixing up the mixer and STK opcodes to work this way.
> 
> Regards,
> Mike
> 
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> 



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net