Skip to content

Commit

Permalink
Syntax of DspClip is compacted. Easier to read.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhroth committed Sep 9, 2011
1 parent 3e851a7 commit 489a7b9
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions src/DspClip.cpp
Expand Up @@ -64,38 +64,17 @@ void DspClip::onInletConnectionUpdate() {

void DspClip::processMessage(int inletIndex, PdMessage *message) {
switch (inletIndex) {
case 1: {
if (message->isFloat(0)) {
lowerBound = message->getFloat(0); // set the lower bound
}
break;
}
case 2: {
if (message->isFloat(0)) {
upperBound = message->getFloat(0); // set the upper bound
}
break;
}
default: {
break;
}
case 1: if (message->isFloat(0)) lowerBound = message->getFloat(0); break; // set the lower bound
case 2: if (message->isFloat(0)) upperBound = message->getFloat(0); break; // set the upper bound
default: break;
}
}

void DspClip::processDsp() {
switch (codePath) {
case DSP_CLIP_DSPX_MESSAGE0: {
resolveInputBuffers(0, dspBufferAtInlet0);
// allow fallthrough
}
case DSP_CLIP_DSP1_MESSAGE0: {
processDspWithIndex(0, blockSizeInt);
break;
}
default: {
DspObject::processDsp();
break;
}
case DSP_CLIP_DSPX_MESSAGE0: resolveInputBuffers(0, dspBufferAtInlet0); // allow fallthrough
case DSP_CLIP_DSP1_MESSAGE0: processDspWithIndex(0, blockSizeInt); break;
default: DspObject::processDsp(); break;
}
}

Expand Down

0 comments on commit 489a7b9

Please sign in to comment.