On Wednesday 10 May 2006 15:11, Victor Lazzarini wrote: > That did it. Looks like directors are not an option for > OSX (at least at the current implementation). Is it > possible to do #ifdefs pre-processor directives in > interface files? Somehow we need to disable the > directors feature. I think SWIG does support #ifdef in the interface files. You can easily try that by replacing the first few lines of the file with the following: #ifndef MACOSX %module(directors="1") csnd #else %module csnd #endif #ifndef MACOSX %feature("director") CsoundCallbackWrapper; %feature("nodirector") Csound; #endif By the way, the Java interface also uses directors, but in a way that does not change the code generated for non-director classes (unlike Python). Does the callback wrapper class work on OS X ? Here is a simple example: // CallbackExample.java import csnd.*; public class CallbackExample { // JavaCallbacks is a subclass of CsoundCallbackWrapper that // can override the methods MessageCallback(), InputValueCallback(), // OutputValueCallback(), and YieldCallback() for defining callbacks static class JavaCallbacks extends CsoundCallbackWrapper { JavaCallbacks(Csound cs) { super(cs); } public int YieldCallback() { java.lang.System.err.println("Yield called for " + GetCsound() + " !"); return 1; } public void MessageCallback(int attr, String msg) { if (msg.endsWith("\n")) java.lang.System.err.print("ATTR: " + attr + " MSG: " + msg); else java.lang.System.err.println("ATTR: " + attr + " MSG: " + msg); } } public static void main(String argv[]) { Csound cs = new Csound(); // create a callback wrapper object for this instance of Csound // note that this will use the host data pointer of 'cs', so the // host data cannot be used for other purposes JavaCallbacks cb = new JavaCallbacks(cs); // enable the callbacks for which there are definitions above cb.SetYieldCallback(); cb.SetMessageCallback(); // build an argument list from the command line options CsoundArgVList args = new CsoundArgVList(); args.Append("csound"); for (int i = 0; i < argv.length; i++) args.Append(argv[i]); // call Compile() to see if the callbacks work cs.Compile(args.argc(), args.argv()); // Reset() must be called before 'cs' or 'cb' is possibly // garbage collected, otherwise a crash may occur cs.Reset(); // free memory used by the argument list; this is optional, and // would be done automatically when 'args' is garbage collected args.Clear(); } }; // end of CallbackExample.java ------------------------------------------------------- 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