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

PUBLIC int csoundPvsoutGet ( CSOUND csound,
PVSDATEXT *  fout,
int  n 
)

Receives a PVSDAT fout from the pvsout opcode (f-rate) at index 'n'. The bus is extended if 'n' exceeds any previous value. Returns zero on success, CSOUND_ERROR if the index is invalid or if fsig framesizes are incompatible CSOUND_MEMORY if there is not enough memory to extend the bus

Receives a PVSDATEX fout from the chano opcode (f-rate) at index 'n'. The bus is extended if n exceeds existing spaces, initialising it using the PVSDATEX fout struct parameters. Returns zero on success, CSOUND_ERROR if the index is invalid or if fsigs framesizes are incompatible

Definition at line 216 of file bus.c.

References csoundPvsoutGet().

Referenced by csoundPvsoutGet().

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


Generated by  Doxygen 1.6.0   Back to index