libAlgAudio
v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
|
#include <SCLangSubprocess.hpp>
Public Member Functions | |
SCLangSubprocess (std::string command) | |
void | SendInstruction (std::string) |
void | SendInstruction (std::string instruction, std::function< void(std::string)> reply_action) |
void | Start () |
void | Stop () |
void | TriggerSignals () |
~SCLangSubprocess () | |
Public Attributes | |
Signal< std::string > | on_any_line_received |
Signal | on_started |
A wrapper for Subprocess, specialised in managing sclang{,.exe}. In particular, it can recognize comamnd prompt at SC output, pass events to main loop, and trigger some signals.
AlgAudio::SCLangSubprocess::SCLangSubprocess | ( | std::string | command | ) |
Prepares to launch sclang with the given command. The process will not be started in the constructor.
AlgAudio::SCLangSubprocess::~SCLangSubprocess | ( | ) |
void AlgAudio::SCLangSubprocess::SendInstruction | ( | std::string | ) |
Sends an instruction to sclang subprocess (using its stdio).
void AlgAudio::SCLangSubprocess::SendInstruction | ( | std::string | instruction, |
std::function< void(std::string)> | reply_action | ||
) |
Sends an instruction to sclang subprocess (using its stdio) and triggers the reply_action with the string that sclang outputted after sending that command and before the next prompt.
void AlgAudio::SCLangSubprocess::Start | ( | ) |
Starts the managed sclang process and the subprocess I/O thread.
void AlgAudio::SCLangSubprocess::Stop | ( | ) |
Stops sclang process.
void AlgAudio::SCLangSubprocess::TriggerSignals | ( | ) |
The I/O thread may not do any UI calls. They are all left for the main thread. The main thread should run the following method from time to time, it fires all signals that should. This way all subscribers are run by the main thread.
Signal<std::string> AlgAudio::SCLangSubprocess::on_any_line_received |
Signal AlgAudio::SCLangSubprocess::on_started |