Skip to content

Commit 9f63e75

Browse files
committed
Add method to resize buffers on DataThread
1 parent 1486c1c commit 9f63e75

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

Source/Processors/DataThreads/DataThread.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,7 @@ GenericEditor* DataThread::createEditor (SourceNode*)
138138
}
139139

140140
void DataThread::createExtraEvents(Array<EventChannel*>&)
141+
{}
142+
143+
void DataThread::resizeBuffers()
141144
{}

Source/Processors/DataThreads/DataThread.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ class PLUGIN_API DataThread : public Thread
6868
/** Returns the address of the DataBuffer that the input source will fill.*/
6969
DataBuffer* getBufferAddress(int subProcessor) const;
7070

71+
/** Called when the chain updates, to add, remove or resize the sourceBuffers' DataBuffers as needed*/
72+
virtual void resizeBuffers();
73+
7174
/** Fills the DataBuffer with incoming data. This is the most important
7275
method for each DataThread.*/
7376
virtual bool updateBuffer() = 0;

Source/Processors/SourceNode/SourceNode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void SourceNode::resizeBuffers()
7878
eventStates.clear();
7979
if (dataThread != nullptr)
8080
{
81+
dataThread->resizeBuffers();
8182
int numSubProcs = dataThread->getNumSubProcessors();
8283
for (int i = 0; i < numSubProcs; i++)
8384
{

0 commit comments

Comments
 (0)