| It is definitely possible to do what you want. It is a matter of creating a typemap. A typemap is SWIG code in the .i file that defines how to translate a declared type from the native language to the wrapper language.
It should easily be possible to make a typemap that translates Java String[] or List (of String) to int argc, const char ** argv. There may well be examples in the SWIG docs.
Regards,
Mike
-----Original Message-----
From: Victor Lazzarini
Sent: Nov 15, 2005 5:49 PM
To: csound-devel@lists.sourceforge.net
Subject: [Cs-dev] Java API: Csound::Compile()
I was playing with the Java wrapper and I was wondering
whether it would be possible to provide a Csound::Compile
method that takes an argument count and an array of
String objects. The problem with the available methods
is that they seem to be limiting. For instance, a simple
code to take any number of command line arguments is
not possible. An ugly hack can be used to select one of the
Compile
methods with different number of String arguments, but
that's
horrible.
Is it not possible to provide a more direct connection
between String[] and char ** ?
I don't really know much of Java, but I don't think the
SWIG-generated type for char** is usable at all, if it is
can someone show me how to use it?
This simple code creates a command-line version of
csound with Java, but it only takes .csds;
import csnd.Csound;
public class cstest {
public static void main(String[] args) {
Csound cs = new Csound();
cs.Compile(args[0]);
cs.Perform();
cs.Reset();
}
};
I wanted to try to make it accept any number of args just
like
a csound command.
Victor
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
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 JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |