kwave
18.07.70
|
#include <ChannelMixer.h>
Public Slots | |
void | input (Kwave::SampleArray data) |
Signals | |
void | output (Kwave::SampleArray data) |
![]() | |
void | attributeChanged (const QVariant value) |
Public Member Functions | |
ChannelMixer (unsigned int inputs, unsigned int outputs) | |
virtual | ~ChannelMixer () Q_DECL_OVERRIDE |
virtual bool | init () |
virtual unsigned int | tracksOfPort (const char *port) const Q_DECL_OVERRIDE |
virtual Kwave::StreamObject * | port (const char *port, unsigned int track) Q_DECL_OVERRIDE |
virtual void | goOn () Q_DECL_OVERRIDE |
![]() | |
SampleSource (QObject *parent=Q_NULLPTR) | |
virtual | ~SampleSource () |
virtual bool | done () const |
![]() | |
StreamObject (QObject *parent=Q_NULLPTR) | |
virtual | ~StreamObject () |
virtual unsigned int | tracks () const |
virtual Kwave::StreamObject * | operator[] (unsigned int track) |
virtual unsigned int | blockSize () const |
void | setAttribute (const char *attribute, const QVariant &value) |
Private Slots | |
void | idxInput (unsigned int index, Kwave::SampleArray data) |
Private Member Functions | |
virtual void | mix () |
Private Attributes | |
Kwave::MixerMatrix * | m_matrix |
unsigned int | m_inputs |
unsigned int | m_outputs |
QVector< QPointer< Kwave::StreamObject > > | m_indexer |
QVector< QQueue< Kwave::SampleArray > > | m_input_queue |
QVector< QPointer< Kwave::SampleBuffer > > | m_output_buffer |
QMutex | m_lock |
Additional Inherited Members | |
![]() | |
static void | setInteractive (bool interactive) |
Definition at line 41 of file ChannelMixer.h.
Kwave::ChannelMixer::ChannelMixer | ( | unsigned int | inputs, |
unsigned int | outputs | ||
) |
Constructor
inputs | number of input channels |
outputs | number of output channels |
Definition at line 35 of file ChannelMixer.cpp.
|
virtual |
Destructor
Definition at line 92 of file ChannelMixer.cpp.
References m_indexer, m_input_queue, m_lock, and m_output_buffer.
|
inlinevirtual |
does nothing, work is done automatically in mix()
Implements Kwave::SampleSource.
Definition at line 83 of file ChannelMixer.h.
|
privateslot |
receives a block with index + input data
Definition at line 167 of file ChannelMixer.cpp.
References m_input_queue, m_inputs, m_lock, m_matrix, mix(), and Kwave::toInt().
Referenced by init(), port(), and tracksOfPort().
|
virtual |
Init function, you must call it once after creating and before using this object. If the return value is false, you should delete this object.
Definition at line 48 of file ChannelMixer.cpp.
References Kwave::connect(), idxInput(), m_indexer, m_input_queue, m_inputs, m_matrix, m_output_buffer, m_outputs, output(), and Kwave::toInt().
Referenced by Kwave::MimeData::decode(), and Kwave::OpusEncoder::setupDownMix().
|
inlineslot |
dummy implementation, the real "input" is a multi-track slot and available through the port(...) interface only
Definition at line 98 of file ChannelMixer.h.
Referenced by mix(), port(), and tracksOfPort().
|
privatevirtual |
does the calculation
Definition at line 191 of file ChannelMixer.cpp.
References Kwave::SampleArray::constData(), Kwave::SampleBuffer::constData(), Kwave::SampleBuffer::data(), Kwave::SampleArray::data(), Kwave::SampleBuffer::finished(), input(), m_input_queue, m_inputs, m_matrix, m_output_buffer, m_outputs, output(), Kwave::SampleArray::resize(), and Kwave::SampleArray::size().
Referenced by idxInput().
|
signal |
emits a block with output data
Referenced by init(), mix(), port(), and tracksOfPort().
|
virtual |
Returns an indexed port, identified by name
port | name of the port (name of signal or slot) |
track | index of the track |
Reimplemented from Kwave::StreamObject.
Definition at line 140 of file ChannelMixer.cpp.
References _sig(), idxInput(), input(), m_indexer, m_lock, m_output_buffer, output(), and Kwave::toInt().
|
virtual |
Returns the number of tracks of a input or output port. Can be overwritten for objects that have a different count of inputs and outputs.
port | name of the port (name of signal or slot) |
Reimplemented from Kwave::StreamObject.
Definition at line 118 of file ChannelMixer.cpp.
References _sig(), idxInput(), input(), m_inputs, m_lock, m_outputs, and output().
|
private |
Definition at line 121 of file ChannelMixer.h.
Referenced by init(), port(), and ~ChannelMixer().
|
private |
queues for input data
Definition at line 124 of file ChannelMixer.h.
Referenced by idxInput(), init(), mix(), and ~ChannelMixer().
|
private |
number of inputs
Definition at line 116 of file ChannelMixer.h.
Referenced by idxInput(), init(), mix(), and tracksOfPort().
|
private |
mutex for locking access to the queues
Definition at line 130 of file ChannelMixer.h.
Referenced by idxInput(), port(), tracksOfPort(), and ~ChannelMixer().
|
private |
mixer matrix
Definition at line 113 of file ChannelMixer.h.
Referenced by idxInput(), init(), and mix().
|
private |
buffers with output data
Definition at line 127 of file ChannelMixer.h.
Referenced by init(), mix(), port(), and ~ChannelMixer().
|
private |
number of outputs
Definition at line 119 of file ChannelMixer.h.
Referenced by init(), mix(), and tracksOfPort().