Logo Search packages:      
Sourcecode: csound version File versions  Download package

PUBLIC int csoundGetControlChannelParams ( CSOUND *  csound,
const char *  name,
MYFLT *  dflt,
MYFLT *  min,
MYFLT *  max 
)

Returns special parameters (assuming there are any) of a control channel, previously set with csoundSetControlChannelParams(). If the channel exists, is a control channel, and has the special parameters assigned, then the default, minimum, and maximum value is stored in *dflt, *min, and *max, respectively, and a positive value that is one of CSOUND_CONTROL_CHANNEL_INT, CSOUND_CONTROL_CHANNEL_LIN, and CSOUND_CONTROL_CHANNEL_EXP is returned. In any other case, *dflt, *min, and *max are not changed, and the return value is zero if the channel exists, is a control channel, but has no special parameters set; otherwise, a negative error code is returned.

Definition at line 779 of file bus.c.

References CSOUND_CONTROL_CHANNEL, and csoundGetControlChannelParams().

Referenced by csoundGetControlChannelParams().

{
    channelEntry_t  *pp;

    if (UNLIKELY(name == NULL))
      return CSOUND_ERROR;
    pp = find_channel(csound, name);
    if (pp == NULL)
      return CSOUND_ERROR;
    if ((pp->type & CSOUND_CHANNEL_TYPE_MASK) != CSOUND_CONTROL_CHANNEL)
      return CSOUND_ERROR;
    if (pp->info == NULL)
      return 0;
    (*dflt) = pp->info->dflt;
    (*min) = pp->info->min;
    (*max) = pp->info->max;
    return pp->info->type;
}


Generated by  Doxygen 1.6.0   Back to index