Ingen
0.5.1
|
An event (command) to perform some action on Ingen. More...
#include <Event.hpp>
Public Types | |
enum | Mode { NORMAL, UNDO, REDO } |
Event mode to distinguish normal events from undo events. More... | |
enum | Execution { NORMAL, BLOCK, UNBLOCK } |
Execution mode for events that block and unblock preprocessing. More... | |
Public Member Functions | |
virtual bool | pre_process (PreProcessContext &ctx)=0 |
Pre-process event before execution (non-realtime). More... | |
virtual void | execute (RunContext &context)=0 |
Execute this event in the audio thread (realtime). More... | |
virtual void | post_process ()=0 |
Post-process event after execution (non-realtime). More... | |
virtual void | undo (Interface &target) |
Write the inverse of this event to sink . More... | |
bool | is_prepared () const |
Return true iff this event has been pre-processed. More... | |
SampleCount | time () const |
Return the time stamp of this event. More... | |
void | set_time (SampleCount time) |
Set the time stamp of this event. More... | |
Event * | next () const |
Get the next event to be processed after this one. More... | |
void | next (Event *ev) |
Set the next event to be processed after this one. More... | |
Status | status () const |
Return the status (success or error code) of this event. More... | |
virtual Execution | get_execution () const |
Return the blocking behaviour of this event (after pre_process()) | |
Mode | get_mode () const |
Return undo mode of this event. More... | |
void | set_mode (Mode mode) |
Set the undo mode of this event. More... | |
Engine & | engine () |
Protected Member Functions | |
Event (Engine &engine, SPtr< Interface > client, int32_t id, FrameTime time) | |
Event (Engine &engine) | |
Constructor for internal events only. | |
bool | pre_process_done (Status st) |
bool | pre_process_done (Status st, const Raul::URI &subject) |
bool | pre_process_done (Status st, const Raul::Path &subject) |
Status | respond () |
Respond to the originating client. More... | |
Protected Attributes | |
Engine & | _engine |
std::atomic< Event * > | _next |
SPtr< Interface > | _request_client |
int32_t | _request_id |
FrameTime | _time |
Status | _status |
std::string | _err_subject |
Mode | _mode |
An event (command) to perform some action on Ingen.
Virtually all operations on Ingen are implemented as events. An event has three distinct execution phases:
1) Pre-process: In a non-realtime thread, prepare event for execution 2) Execute: In the audio thread, execute (apply) event 3) Post-process: In a non-realtime thread, finalize event (e.g. clean up and send replies)
|
strong |
Event mode to distinguish normal events from undo events.
|
strong |
Execution mode for events that block and unblock preprocessing.
|
pure virtual |
Pre-process event before execution (non-realtime).
Implemented in Ingen::Server::Events::Delta, Ingen::Server::Events::DisconnectAll, Ingen::Server::Events::Delete, Ingen::Server::Events::Disconnect, Ingen::Server::Events::Connect, Ingen::Server::Events::CreatePort, Ingen::Server::Events::CreateBlock, Ingen::Server::Events::Get, Ingen::Server::Events::SetPortValue, Ingen::Server::Events::Copy, Ingen::Server::Events::Mark, Ingen::Server::Events::Move, Ingen::Server::Events::CreateGraph, and Ingen::Server::Events::Undo.
Referenced by Ingen::Server::PreProcessor::process().
|
pure virtual |
Execute this event in the audio thread (realtime).
Implemented in Ingen::Server::Events::Delta, Ingen::Server::Events::DisconnectAll, Ingen::Server::Events::Delete, Ingen::Server::Events::Disconnect, Ingen::Server::Events::Connect, Ingen::Server::Events::CreatePort, Ingen::Server::Events::CreateBlock, Ingen::Server::Events::Get, Ingen::Server::Events::SetPortValue, Ingen::Server::Events::Copy, Ingen::Server::Events::Mark, Ingen::Server::Events::Move, Ingen::Server::Events::CreateGraph, and Ingen::Server::Events::Undo.
Referenced by Ingen::Server::PreProcessor::process().
|
pure virtual |
Post-process event after execution (non-realtime).
Implemented in Ingen::Server::Events::Delta, Ingen::Server::Events::DisconnectAll, Ingen::Server::Events::Delete, Ingen::Server::Events::Disconnect, Ingen::Server::Events::Connect, Ingen::Server::Events::CreatePort, Ingen::Server::Events::CreateBlock, Ingen::Server::Events::Get, Ingen::Server::Events::SetPortValue, Ingen::Server::Events::Copy, Ingen::Server::Events::Mark, Ingen::Server::Events::Move, Ingen::Server::Events::CreateGraph, and Ingen::Server::Events::Undo.
Referenced by Ingen::Server::PostProcessor::process().
|
inlinevirtual |
Write the inverse of this event to sink
.
Reimplemented in Ingen::Server::Events::Delta, Ingen::Server::Events::DisconnectAll, Ingen::Server::Events::Delete, Ingen::Server::Events::Disconnect, Ingen::Server::Events::Connect, Ingen::Server::Events::CreatePort, Ingen::Server::Events::CreateBlock, Ingen::Server::Events::Copy, Ingen::Server::Events::Move, and Ingen::Server::Events::CreateGraph.
Referenced by Ingen::Server::PreProcessor::process().
|
inline |
Return true iff this event has been pre-processed.
Referenced by Ingen::Server::PreProcessor::event(), and Ingen::Server::PreProcessor::process().
|
inline |
Return the time stamp of this event.
Referenced by Ingen::Server::PreProcessor::process(), Ingen::Server::PostProcessor::process(), set_mode(), and set_time().
|
inline |
Set the time stamp of this event.
References time().
Referenced by Ingen::Server::PreProcessor::process().
|
inline |
Get the next event to be processed after this one.
Referenced by Ingen::Server::PostProcessor::append(), Ingen::Server::PreProcessor::event(), Ingen::Server::PreProcessor::process(), and Ingen::Server::PostProcessor::process().
|
inline |
Set the next event to be processed after this one.
|
inline |
Return the status (success or error code) of this event.
|
inline |
Return undo mode of this event.
Referenced by Ingen::Server::PreProcessor::process().
|
inline |
Set the undo mode of this event.
References time().
Referenced by Ingen::Server::PreProcessor::event().
|
inlineprotected |
Respond to the originating client.
Referenced by Ingen::Server::Events::CreateGraph::post_process(), Ingen::Server::Events::SetPortValue::post_process(), Ingen::Server::Events::CreateBlock::post_process(), Ingen::Server::Events::CreatePort::post_process(), and Ingen::Server::Events::DisconnectAll::post_process().