Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Csound API -- modules

Date2005-02-05 18:53
From"gogins@pipeline.com"
SubjectRe: [Cs-dev] Csound API -- modules
I suggest you call it csoundReset, and make it do what you want. In other
words, we don't want too many API calls out there, we want to factor out
the functionality into a small, orthogonal set of calls. 

If one would always need to call csoundReset and csoundInitialize before
csoundCompile, and that doesn't mess up anything else, then
csoundInitialize should be folded into csoundReset.

If one can't always do csoundReset and what you propose for
csoundInitialize at the same time, then they need to be different calls,
but I would prefer a more descriptive name, like csoundInitializeModules or
something.

It's fine with if you do the work, as long as you test your fixes with
CsoundVST. It does build on Linux. Or you'd prefer that I do it, that's
fine too, just tell me what you want to happen in the code.

Original Message:
-----------------
From: Istvan Varga istvan@csounds.com
Date: Sat, 05 Feb 2005 19:02:44 +0100
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] Csound API -- modules


gogins@pipeline.com wrote:

> Consequently, clients of the API must now do this:
> 
> csoundReset
> csoundCompile
> csoundPerform

If clients need to be changed, we might just as well do:

   csoundInitialize
   csoundCompile
   csoundPerform

Where csoundInitialize would contain (among others) code that you
have removed from csoundCreate, and, of course csoundReset.

> Istvan, please let me know if this creates any problems for you.

With your changes, the current CVS sources do not compile. However,
as long as you agree with the csoundInitialize idea (suggestions on
a better name ?), I can fix things myself.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-02-05 19:46
FromIstvan Varga
SubjectRe: [Cs-dev] Csound API -- modules
gogins@pipeline.com wrote:

> If one can't always do csoundReset and what you propose for
> csoundInitialize at the same time, then they need to be different calls,

csoundReset is supposed to free all allocated memory and other resources,
unload modules, and in general do everything that is done by csoundDestroy,
with the exception of destroying the instance.
On the other hand, the init function, while implies csoundReset (and does
that at first), would allocate memory and load modules. Now, deleting the
csound instance after a csoundReset would be safe, but doing the same after
an init call would be leaking resources.

> but I would prefer a more descriptive name, like csoundInitializeModules or
> something.

The function is not strictly limited to loading modules. It is a general
initialization call that prepares an instance to be used by csoundCompile,
thus naming it csoundInitializeModules would be confusing. At this time,
I'd prefer the name 'csoundInit', but if you can suggest a name that is longer
and more descriptive, I will use that.
By the way, there is no technical reason why csoundInit could not be made
optional, making all the following uses valid:

1.
   csoundCreate
   csoundInit
   [do something with the configuration settings]
   csoundCompile
   csoundPerform
   csoundDestroy

2.
   csoundCreate
   csoundCompile  <-- will detect that csoundInit was not called
                      and call it automatically
   csoundPerform
   csoundDestroy

3.
   csoundCreate
   [csoundInit]   <-- optional
   csoundCompile
   csoundPerform
   [csoundInit]   <-- optional
   csoundCompile
   csoundPerform
   [csoundInit]   <-- optional
   csoundCompile
   csoundPerform
   [repeat Init, Compile, Perform any number of times]
   csoundDestroy


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net