kwave
18.07.70
|
#include <SampleFIFO.h>
Public Member Functions | |
SampleFIFO () | |
SampleFIFO (const SampleFIFO &other) | |
virtual | ~SampleFIFO () |
virtual void | flush () |
virtual void | put (const Kwave::SampleArray &source) |
virtual unsigned int | get (Kwave::SampleArray &buffer) |
virtual unsigned int | length () |
virtual void | setSize (unsigned int size) |
virtual void | crop () |
Private Member Functions | |
unsigned int | unlockedLength () |
Private Attributes | |
QQueue< Kwave::SampleArray > | m_buffer |
sample_index_t | m_size |
sample_index_t | m_read_offset |
QMutex | m_lock |
Definition at line 32 of file SampleFIFO.h.
Kwave::SampleFIFO::SampleFIFO | ( | ) |
Kwave::SampleFIFO::SampleFIFO | ( | const SampleFIFO & | other | ) |
|
virtual |
Destructor
Definition at line 38 of file SampleFIFO.cpp.
References flush(), and m_lock.
|
virtual |
discards all superfluous content until the size condition is met.
Definition at line 136 of file SampleFIFO.cpp.
References m_buffer, m_lock, m_read_offset, m_size, and unlockedLength().
Referenced by Kwave::RecordPlugin::flushPrerecordingQueue().
|
virtual |
Reset the FIFO. This destroys the content and sets all pointers to their initial value.
Definition at line 45 of file SampleFIFO.cpp.
References m_buffer, m_lock, and m_read_offset.
Referenced by Kwave::RecordPlugin::flushPrerecordingQueue(), Kwave::Delay::setDelay(), and ~SampleFIFO().
|
virtual |
gets and removes samples from the FIFO
buffer | reference to an array of samples to be filled |
Definition at line 70 of file SampleFIFO.cpp.
References Kwave::SampleArray::constData(), Kwave::SampleArray::data(), length(), m_buffer, m_lock, m_read_offset, MEMCPY, and Kwave::SampleArray::size().
Referenced by Kwave::RecordPlugin::flushPrerecordingQueue(), and Kwave::Delay::goOn().
|
virtual |
Returns the number of samples that can be read out.
Definition at line 122 of file SampleFIFO.cpp.
References m_lock, and unlockedLength().
Referenced by Kwave::RecordPlugin::flushPrerecordingQueue(), and get().
|
virtual |
puts samples into the FIFO
source | reference to an array of samples to feed in |
Definition at line 54 of file SampleFIFO.cpp.
References Kwave::SampleArray::isEmpty(), m_buffer, m_lock, m_size, and unlockedLength().
Referenced by Kwave::Delay::input(), and Kwave::Delay::setDelay().
|
virtual |
sets the maximum size of the content
Definition at line 129 of file SampleFIFO.cpp.
References m_lock, and m_size.
|
private |
internal version of length(), without locking
Definition at line 113 of file SampleFIFO.cpp.
References m_buffer, and Kwave::SampleArray::size().
Referenced by crop(), length(), and put().
|
private |
list of buffers with sample data
Definition at line 90 of file SampleFIFO.h.
Referenced by crop(), flush(), get(), put(), and unlockedLength().
|
private |
mutex for access to the FIFO (recursive)
Definition at line 102 of file SampleFIFO.h.
Referenced by crop(), flush(), get(), length(), put(), setSize(), and ~SampleFIFO().
|
private |
number of samples that have already been read out from the first buffer (head, first one to read out)
Definition at line 99 of file SampleFIFO.h.
|
private |
maximum number of samples of the content
Definition at line 93 of file SampleFIFO.h.