Fixed DspDac not working like the pd dac~

>
> I push NULL on the vector because I will then have a vector that have the
> same size as the DspDac inlet list, and I will be sure that the buffer at
> inlet i have to copied in the buffer at index i of the vector. If I don't
> push NULL,, it would be messed up. I could do it without pushing NULL but
> then I'll need a map to associate the inlet indices and the ouput buffers
> instead of a simple vector.


2014-11-06 14:48 GMT+01:00 Martin Roth <notifications@github.com>:

> In src/DspDac.cpp:
>
> >
> > -void DspDac::processSignal(DspObject *dspObject, int fromIndex, int toIndex) {
> > -  DspDac *d = reinterpret_cast<DspDac *>(dspObject);
> > -  switch (d->incomingDspConnections.size()) {
> > -    default: {
> > -      /* TODO(mhroth): fit this into the new buffer reference architecture
> > -      for (int i = 2; i < numDspInlets; i++) {
> > -        float *globalOutputBuffer = graph->getGlobalDspBufferAtOutlet(i);
> > -        ArrayArithmetic::add(globalOutputBuffer, localDspBufferAtInlet[i], globalOutputBuffer, 0, blockSizeInt);
> > +        if (index < graph->getContext()->getNumOutputChannels() && index >= 0) {
> > +          outputBuffers.push_back(graph->getGlobalDspBufferAtOutlet(index));
> > +        } else {
> > +          outputBuffers.push_back(NULL);
>
> If index is bad, why do you bother pushing a NULL on the stack? Seems
> like you could just skip that case, and then you wouldn't need an if in
> the processDspWithIndex function.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mhroth/ZenGarden/pull/53/files#r19944503>.
>



-- 
SAUVAGEOT Paul-Arthur.
Développeur C \ C++ \ C#.