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

PUBLIC int csoundPvsinSet ( CSOUND *  csound,
const PVSDATEXT *  fin,
int  n 
)

Sends a PVSDATEX fin to the pvsin opcode (f-rate) at index 'n'. The bus is automatically extended if 'n' exceeds any previously used index value, clearing new locations to zero. Returns zero on success, CSOUND_ERROR if the index is invalid or fsig framesizes are incompatible CSOUND_MEMORY if there is not enough memory to extend the bus.

Sends a PVSDATEX fin to the pvsin opcode (f-rate) at index 'n'. The bus is automatically extended if 'n' exceeds any previously used index value, clearing new locations to zero. Returns zero on success, CSOUND_ERROR if the index is invalid or fsig framesizes are incompatible, and CSOUND_MEMORY if there is not enough memory to extend the bus.

Definition at line 244 of file bus.c.

References csoundPvsinSet().

Referenced by csoundPvsinSet().

{
    PVSDATEXT *fout = (PVSDATEXT *)csound->chanif;
    int size;
    if (UNLIKELY(n < 0))
      return CSOUND_ERROR;
    if ((unsigned int)n >= (unsigned int)csound->nchanif) {
      int   err = chan_realloc_f(csound, (void *)&(csound->chanif),
                                 &(csound->nchanif), n + 1,
                                 (void *)fin);
      if (UNLIKELY(err))
        return err;
      fout = (PVSDATEXT *)csound->chanif;
      memcpy(fout[n].frame, fin->frame, sizeof(float)*(fin->N+2));
      return CSOUND_SUCCESS;
    }
    size = fout[n].N < fin->N ? fout[n].N : fin->N;
    memcpy(&fout[n], fin, sizeof(PVSDATEXT)-sizeof(float *));
    if (size > 0)
       memcpy(fout[n].frame, fin->frame, sizeof(float)*(size+2));
    return CSOUND_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index