| In my opinion, plugins should access Csound only via the API. The
engineering reason for this is that shared library function binding works
differently on different platforms. On Windows, for example, shared library
functions are not accessible unless they are exported. The API is put into
a function table that is part of the Csound globals structure which is
available to every opcode. In other words, you can call API functions like
this: csound->csoundApiFunction(csound, arg1, arg2,...). The globals
structure and thus the API is passed from the host (Csound) to the client
(the plugin). This means that all plugin opcodes automatically have access
to all members of the globals structure, including all the functions in the
Csound API.
If the plugins call functions in cs.h, then on Windows they can't call them
unless they are exported. If they are exported, then we have two Csound
APIs, one defined in csound.h and one defined in cs.h.
Possibly the intention is to have two Csound APIs, one for "external" use
and one for "internal" use, but I think this distinction is artificial and
could prove confusing - as it already seems to be.
I would prefer that there be only one Csound API for both internal and
external use. I don't care where it is or what it's called, but it needs to
be able to support both CsoundVST and other csound-based applications, and
plugin opcodes.
Original Message:
-----------------
From: stevenyi stevenyi@csounds.com
Date: Sun, 19 Oct 2003 23:54:06 -0400
To: csound-dev@eartha.mills.edu
Subject: [CSOUND-DEV:3181] Re: --opcode-lib stuff, specdisp, update
Hi John,
Thanks for the reply! I see now how you worked the other changes in
cs.h. I've been a bit wary as I didn't want to add functions that
weren't "supposed" to be in there, as I thought all calls were to be
going through the API and cs.h is the public header for csound as a
library (at least, I thought it was). Oh wait... I see where I'm
getting confused, and perhaps this is a point needing clarification for
myself. Should opcode libs only #include csound.h and only use the
API? If so, then perhaps the opcodes in the Opcodes dir should be
recoded to use API functions (and add API functions for cases where they
don't exist).
Anyways, I'll go ahead and move forward as you suggested and will be
committing changes as I make them. I guess we can take functions back
out and add to the API later if need be (or recode opcodes to use
existing API functions where available).
Thanks,
steven
On Mon, 2003-10-20 at 02:25, John ffitch wrote:
> So the answer is to add ftfind to the list of function in teh internal
> interface; and then add the next one, and teh next one,... until it works.
> ==John
>
>
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ . |