|
| uint32_t | process (T *input, uint32_t nsamples, T *output) |
| | Simplified "work" function, called automatically by work(). This takes away all boilerplate work usually needed, making simpler block implementations more trivial to work with.
|
| void | init () |
| | Applies current parameters to the block. This is called automatically once in start(), but may also be called manually by the block as needed.
|
| nlohmann::ordered_json | get_cfg_list () |
| | Get parameters LIST of the block's parameters. This does not contain actual values, only a description of what is available. This will contains a name, optionally description, its type and range if applicable, string options and so on. This must be re-pulled in several cases :
|
| nlohmann::json | get_cfg (std::string key) |
| | Get parameters of the block as JSON.
|
| Block::cfg_res_t | set_cfg (std::string key, nlohmann::json v) |
| | Set parameters of the block from JSON, including potentially IO configurations for blocks that may have variable output sizes. However, you likely should implemenet that in a separate function as well (eg, addVFO or such) for it to be easy to be done in C++ directly, and using said function here. Optionally, this can also be made to be functional while the block is running!
|
|
| BlockSimple (std::string id, std::vector< BlockIO > in={}, std::vector< BlockIO > out={}) |
| virtual std::vector< BlockIO > | get_inputs () |
| | Get the block's input configurations and streams. You should not modify them.
|
| virtual std::vector< BlockIO > | get_outputs () |
| | Get the block's output configurations and streams. You should not modify them.
|
| virtual void | set_input (BlockIO f, int i) |
| | Link an input to an output stream of some sort. This also checks the type of the BlockIO to ensure (some level of) compatibility.
|
| virtual BlockIO | get_output (int i, int nbuf) |
| | Get one of the block's outputs, creating the fifo it if nbuf != 0.
|
| void | link (Block *ptr, int output_index, int input_index, int nbuf) |
| | Link a block's output to another input, more or less just a warper around set_input and set_output.
|
| | Block (std::string id, std::vector< BlockIO > in={}, std::vector< BlockIO > out={}) |
| | Generic constructor, to be overloaded.
|
| virtual bool | is_async () |
| | Returns true if a block is async. An async block is a block that has outputs without inputs or inputs that won't directly affect/stop the outputs' behavior. This includes sources (eg, a SDR Device), TXing and RXing at the same time, and anything with similar requirements.
|
| nlohmann::json | get_cfg () |
| | Get parameters of the block as JSON. Unlike get_cfg(key), this returns every single available parameter as declared by get_cfg_list().
|
| cfg_res_t | set_cfg (nlohmann::json v) |
| | Set parameters of the block from JSON. Essentially the same as set_cfg(key, v), except this will set any number of them at once.
|
| virtual void | start () |
| | Starts this block's internal thread and loop.
|
| virtual void | stop (bool stop_now=false, bool force=false) |
| | Stops the block, or rather tells the internal loop it should exit & joins the thread to wait. TODOREWORK, potentially allow sending the terminator as well to force-quit.
|