Skip to content

Commit 1023b9d

Browse files
committed
safer audio process logic?
1 parent c1ea63a commit 1023b9d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ofxVisualProgramming.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,9 @@ void ofxVisualProgramming::audioProcess(float *input, int bufferSize, int nChann
625625
// compute audio input
626626
if(!inputBuffer.getBuffer().empty()){
627627
for(map<int,shared_ptr<PatchObject>>::iterator it = patchObjects.begin(); it != patchObjects.end(); it++ ){
628-
it->second->audioIn(inputBuffer);
628+
if(!it->second->getWillErase()){
629+
it->second->audioIn(inputBuffer);
630+
}
629631
}
630632

631633
lastInputBuffer = inputBuffer;
@@ -635,7 +637,9 @@ void ofxVisualProgramming::audioProcess(float *input, int bufferSize, int nChann
635637
if(audioGUIOUTChannels > 0){
636638
// compute audio output
637639
for(map<int,shared_ptr<PatchObject>>::iterator it = patchObjects.begin(); it != patchObjects.end(); it++ ){
638-
it->second->audioOut(emptyBuffer);
640+
if(!it->second->getWillErase()){
641+
it->second->audioOut(emptyBuffer);
642+
}
639643
}
640644
}
641645

0 commit comments

Comments
 (0)