|
kwave
18.07.70
|
#include <SampleBuffer.h>


Public Slots | |
| virtual void | input (Kwave::SampleArray data) |
Signals | |
| void | output (Kwave::SampleArray data) |
Signals inherited from Kwave::StreamObject | |
| void | attributeChanged (const QVariant value) |
Public Member Functions | |
| SampleBuffer (QObject *parent=Q_NULLPTR) | |
| virtual | ~SampleBuffer () |
| virtual bool | isEmpty () const |
| virtual Kwave::SampleArray & | data () |
| virtual const Kwave::SampleArray & | constData () const |
| virtual unsigned int | available () const |
| virtual const sample_t * | get (unsigned int len) |
| void | put (sample_t sample) |
| virtual void | finished () |
Public Member Functions inherited from Kwave::SampleSink | |
| SampleSink (QObject *parent=Q_NULLPTR) | |
| virtual | ~SampleSink () |
| virtual bool | done () const |
Public Member Functions inherited from Kwave::StreamObject | |
| StreamObject (QObject *parent=Q_NULLPTR) | |
| virtual | ~StreamObject () |
| virtual unsigned int | tracks () const |
| virtual Kwave::StreamObject * | operator[] (unsigned int track) |
| virtual unsigned int | tracksOfPort (const char *port) const |
| virtual Kwave::StreamObject * | port (const char *port, unsigned int track) |
| virtual unsigned int | blockSize () const |
| void | setAttribute (const char *attribute, const QVariant &value) |
Protected Member Functions | |
| void | emitData (Kwave::SampleArray data) |
Private Member Functions | |
| void | enqueue (Kwave::SampleArray data) |
Private Attributes | |
| Kwave::SampleArray | m_data |
| unsigned int | m_offset |
| unsigned int | m_buffered |
| QSemaphore | m_sema |
Friends | |
| class | BufferJob |
Additional Inherited Members | |
Static Public Member Functions inherited from Kwave::StreamObject | |
| static void | setInteractive (bool interactive) |
Definition at line 33 of file SampleBuffer.h.
| Kwave::SampleBuffer::SampleBuffer | ( | QObject * | parent = Q_NULLPTR | ) |
Constructor
| parent | a parent object, passed to QObject (optional) |
Definition at line 28 of file SampleBuffer.cpp.
|
virtual |
|
virtual |
returns the number of samples that can be fetched with get()
Definition at line 59 of file SampleBuffer.cpp.
References m_data, m_offset, and Kwave::SampleArray::size().
Referenced by Kwave::OpusEncoder::fillInBuffer().


|
virtual |
returns a const reference to the sample data
Definition at line 53 of file SampleBuffer.cpp.
References m_data.
Referenced by Kwave::ChannelMixer::mix().

|
virtual |
returns a reference to the sample data
Definition at line 47 of file SampleBuffer.cpp.
References m_data.
Referenced by input(), and Kwave::ChannelMixer::mix().

|
protected |
Emit data from this object, used from a buffer thread
| data | a sample array to emit |
Definition at line 140 of file SampleBuffer.cpp.
References m_sema, and output().
Referenced by enqueue().

|
private |
enqueue some data
Definition at line 133 of file SampleBuffer.cpp.
References emitData(), and m_sema.
Referenced by finished(), and input().


|
virtual |
emit the sample data stored in m_data
Definition at line 101 of file SampleBuffer.cpp.
References Kwave::StreamObject::blockSize(), enqueue(), m_buffered, m_data, Kwave::SampleArray::resize(), and Kwave::SampleArray::size().
Referenced by Kwave::OpusDecoder::close(), Kwave::ChannelMixer::mix(), and put().


|
virtual |
returns a pointer to the raw data and advances the internal offset afterwards
| len | maximum number of samples to get |
Definition at line 66 of file SampleBuffer.cpp.
References Kwave::SampleArray::constData(), m_data, m_offset, and Kwave::SampleArray::size().
Referenced by Kwave::OpusEncoder::fillInBuffer().


|
virtualslot |
slot for taking input data, stores it into m_data
Definition at line 115 of file SampleBuffer.cpp.
References data(), enqueue(), m_buffered, m_data, m_offset, Kwave::SampleArray::resize(), and Kwave::SampleArray::size().

|
virtual |
returns true if no sample data is present
Definition at line 41 of file SampleBuffer.cpp.
References Kwave::SampleArray::isEmpty(), and m_data.

|
signal |
emits the data received via input()
Referenced by emitData().

| void Kwave::SampleBuffer::put | ( | sample_t | sample | ) |
Appends one samples to the buffer. If the buffer is full afterwards, the buffer will be emitted.
| sample | a single sample |
Definition at line 84 of file SampleBuffer.cpp.
References Kwave::StreamObject::blockSize(), finished(), m_buffered, m_data, and Kwave::SampleArray::resize().
Referenced by Kwave::OpusDecoder::decode().


|
friend |
Definition at line 85 of file SampleBuffer.h.
|
private |
number of samples buffered, e.g. through put()
Definition at line 112 of file SampleBuffer.h.
Referenced by finished(), input(), and put().
|
private |
array with sample data
Definition at line 106 of file SampleBuffer.h.
Referenced by available(), constData(), data(), finished(), get(), input(), isEmpty(), and put().
|
private |
offset within the data, for reading
Definition at line 109 of file SampleBuffer.h.
Referenced by available(), get(), and input().
|
private |
semaphore for limiting queue depth to 1
Definition at line 115 of file SampleBuffer.h.
Referenced by emitData(), enqueue(), and ~SampleBuffer().