Sample MO FIFO: method to resize data vectors

This commit is contained in:
f4exb 2019-10-31 08:44:21 +01:00
parent c04369f4f1
commit 08eaca8c0c
2 changed files with 17 additions and 0 deletions

View File

@ -38,6 +38,22 @@ void SampleMOFifo::init(unsigned int nbStreams, unsigned int size)
}
}
void SampleMOFifo::resize(unsigned int size)
{
m_size = size;
m_readCount = 0;
m_readHead = 0;
m_writeHead = size/8;
for (unsigned int stream = 0; stream < m_nbStreams; stream++)
{
m_data[stream].resize(size);
m_vReadCount.push_back(0);
m_vReadHead.push_back(0);
m_vWriteHead.push_back(size/8);
}
}
SampleMOFifo::SampleMOFifo(QObject *parent) :
QObject(parent),
m_nbStreams(0),

View File

@ -31,6 +31,7 @@ public:
SampleMOFifo(unsigned int nbStreams, unsigned int size, QObject *parent = nullptr);
~SampleMOFifo();
void init(unsigned int nbStreams, unsigned int size);
void resize(unsigned int size);
void reset();
void readSync(