[Cs-dev] Channels and types
Date | 2013-07-02 20:06 |
From | Andres Cabrera |
Subject | [Cs-dev] Channels and types |
Attachments | None None |
Hi, To be able to check types in the generic invalue/outvalue callbacks, I am includeing "csound_standard_types.h" and then checking type with:if (channelType == &CS_VAR_TYPE_S) { ud->csEngine->passOutString(channelName, (const char *) channelValuePtr); } else if (channelType == &CS_VAR_TYPE_K){ ud->csEngine->passOutValue(channelName, *((MYFLT *)channelValuePtr)); } Cheers, Andrés |
Date | 2013-07-04 22:12 |
From | Steven Yi |
Subject | Re: [Cs-dev] Channels and types |
Hi Andres, I think for now, comparing those internal types could work, but I would imagine the correct way in the future would be to: 1. Query the defined types from csound to find a type by given properties (maybe searching by it's var type name, using csoundGetTypeWithVarTypeName) 2. Store that as a reference and use that to compare types. That'd probably be the most generic way to do it. Does that seem good to you? Thanks! steven On Tue, Jul 2, 2013 at 3:06 PM, Andres Cabrera |
Date | 2013-07-04 23:06 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] Channels and types |
Attachments | None None |
Hi Steven, I think that sounds good. There could even be a function that describes or can cast the pointer to get data structures defined within Csound only, to avoid haveing to define the structure in C too. Cheers, Andrés On Thu, Jul 4, 2013 at 2:12 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Andres, |