|
HARDT - The Ham Radio DSP Toolkit
|
#include <hmux.h>


Public Member Functions | |
| HMux (std::vector< HReader< T > * > readers, size_t blocksize, bool duplex=false) | |
| HMux (HWriter< T > *writer, int writers, size_t blocksize, bool duplex=false) | |
| HMux (std::vector< HWriterConsumer< T > * > consumers, size_t blocksize, bool duplex=false) | |
| ~HMux () | |
| int | Read (T *dest, size_t blocksize) |
| int | Write (T *src, size_t blocksize) |
| bool | Command (HCommand *command) |
| void | SetWriter (HWriter< T > *writer) |
| bool | Start () |
| bool | Stop () |
Public Member Functions inherited from HReader< T > | |
| virtual | ~HReader ()=default |
| HReader< T > * | Reader () |
Public Member Functions inherited from HObject | |
| HObject () | |
Public Member Functions inherited from HWriter< T > | |
| virtual | ~HWriter ()=default |
| HWriter< T > * | Writer () |
Public Member Functions inherited from HWriterConsumer< T > | |
| HWriterConsumer< T > * | Consumer () |
Taking a list of readers, the read from each reader and interlace the samples - then return the resulting buffer. (or await writes from a number of writers, then multiplex the incomming data and write to the next writer)
Ex: Having processed the left and right part of a stereo signal, a HMux object is then created with the left and right HReader objects. The HMux object will then read the left and right samples, interlace them and return a set of samples ready to output from a 2-channel soundcard.
IQ samples having been processed in parallel branches may also require multiplexing again to end up with an IQ signal (for detection or other reasons).
Do note that the output from the multiplexer will be the total number of samples read or written by the upstream readers or writers. Having two readers that each returns 1024 samples will yield a read of 2048 samples.
A special use of the multiplexer is to have a single stream (reader og writer) and then multiplexing the input data into two identical channels. This is usefull when you want to output a mono stream as a dual-channel ("stereo") headset.
| HMux< T >::HMux | ( | std::vector< HReader< T > * > | readers, |
| size_t | blocksize, | ||
| bool | duplex = false |
||
| ) |
Construct a new HMux
| readers | A list o reader to read from |
| blocksize | Number of blocks to read |
| duplex | If set to true, the number of readers must be 1. Read a single block, then duplicate the block and output same block as two channels multiplexed (mono->stereo for mono input) |
| HMux< T >::HMux | ( | HWriter< T > * | writer, |
| int | writers, | ||
| size_t | blocksize, | ||
| bool | duplex = false |
||
| ) |
Construct a new HMux
| writer | The writer to write the final multiplexed signal to |
| writers | Number of writers, writing to this multiplexer |
| blocksize | Number of blocks to write |
| duplex | If set to true, the number of writers must be 1. When a single block is written, then duplicate the block and output same block as two channels multiplexed (mono->stereo for mono input) |
| HMux< T >::HMux | ( | std::vector< HWriterConsumer< T > * > | consumers, |
| size_t | blocksize, | ||
| bool | duplex = false |
||
| ) |
Construct a new HMux
| consumers | The upstream consumers |
| blocksize | Number of blocks to write |
| duplex | If set to true, the number of upstream writers must be 1. When a single block is written, then duplicate the block and output same block as two channels multiplexed (mono->stereo for mono input) |
Execute or carry through a command
Implements HReader< T >.
|
virtual |
Read a block of samples
Implements HReader< T >.
Implements HWriterConsumer::SetWriter()
Implements HWriterConsumer< T >.
|
inlinevirtual |
Start the multiplexer
Reimplemented from HReader< T >.
|
inlinevirtual |
Stop the multiplexer
Reimplemented from HReader< T >.
|
virtual |
Write a block of samples
Implements HWriter< T >.
1.8.17