Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Python api and argv

Date2008-08-23 23:23
Fromvictor
SubjectRe: [Cs-dev] Python api and argv
AttachmentsNone  None  
I suppose that can be experimented with, too. However, the helper class has
to stay, because people like myself have written code that depends on it.
 
Victor
----- Original Message -----
Sent: Saturday, August 23, 2008 10:12 PM
Subject: Re: [Cs-dev] Python api and argv

I see, thanks Victor! JOOC, why don't you use a (int,char**) typemap for (argc,argv) instead of the helper class?, seems to me like it will result in a simpler api.

Regards
-Carlos

On Sat, Aug 23, 2008 at 5:58 PM, victor <Victor.Lazzarini@nuim.ie> wrote:
You have to use the helper class CsoundArgVList e.g:

def compile(csound, args=[]):
     arglist = csnd..CsoundArgVList()
     arglist.Append("csound")
     for i in args:
        arglist.Append(i)
     res = csound.Compile(arglist.argc(), arglist.argv())
     return res


Then you can do

csound = csnd.Csound()
compile(csound, ['-odac', '-B1024','-dm0','my.csd'])


Victor




----- Original Message -----
From: "Carlos Pita" <carlosjosepita@gmail.com>
To: <csound-devel@lists.sourceforge.net>
Sent: Saturday, August 23, 2008 9:44 PM
Subject: [Cs-dev] Python api and argv


> Hi all,
>
> I've been messing a bit with the python api and find out that the
> csoundCompile(cs,argc,argv) or Csound.Compile(argc,argv) are unusable
> because:
>
> 1) the swig typemap for char **  is commented out in python_interface.i
>
> 2) no array_functions / array_class support from carrays.i is
> generated for char*.
>
> So I see no way to create a char** from python side.
>
> I still can resort to Csound.Compile overloads for (char*),
> (char*,char*), .... up to 5 strings, but this is rather limited.
>
> How is this expected to be done? Why is the typemap for char**
> commented in the swig interface?
>
> Thank you in advance
> Regards
> -Carlos
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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 Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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 Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel