Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] csoundGetChannelPtr() with strings...

Date2006-07-18 14:44
FromVictor Lazzarini
SubjectRe: [Cs-dev] csoundGetChannelPtr() with strings...
As far as I can remember you will need to cast the
MYFLT * to char * (and vice-versa) and use it to point to
your string, which you would have allocated up to
the maximum string length (also set by the API,
check csound.h)

Victor

>
> I am trying to retrieve a string from my host app and pass
> it to Csound.
>    In csound.h it says to in order to deal with strings
> one must use the  CSOUND_STRING_CHANNEL type, but the
> pvalue parameters is a float?. I  have this simple
> function I call to retrieve control values:
>
>
> void SetValueInChannel(CSOUND *cs, char *name, MYFLT val){
>            MYFLT *pvalue;
>            int result;
>            result =
>            csoundGetChannelPtr(cs, &pvalue, name,
>            CSOUND_INPUT_CHANNEL | CSOUND_CONTROL_CHANNEL);
>            if (!result) *pvalue = val;
>            }
>
> How can I modify it to deal with strings? I would like the
> string value  to be passed to the function in lieu of
> 'MYFLT val'. Any suggestions are  much appreciated. Cheers
> ,
>
> Rory.
>
>
> ----------------------------------------------------------
> --------------- Take Surveys. Earn Cash. Influence the
> Future of IT Join SourceForge.net's Techsay panel and
> you'll get the chance to share your opinions on IT &
> business topics through brief surveys -- and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
--------------------------------------
   This Email Was brought to you by
               WebMail
    A Netwin Web Based EMail Client
  http://netwinsite.com/webmail/tag.htm

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net