Ingen  0.5.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Ingen::Server::Event Class Referenceabstract

An event (command) to perform some action on Ingen. More...

#include <Event.hpp>

+ Inheritance diagram for Ingen::Server::Event:
+ Collaboration diagram for Ingen::Server::Event:

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...
 
Eventnext () 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...
 
Engineengine ()
 

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
 

Detailed Description

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)

Member Enumeration Documentation

§ Mode

Event mode to distinguish normal events from undo events.

§ Execution

Execution mode for events that block and unblock preprocessing.

Member Function Documentation

§ pre_process()

virtual bool Ingen::Server::Event::pre_process ( PreProcessContext ctx)
pure virtual

§ execute()

virtual void Ingen::Server::Event::execute ( RunContext context)
pure virtual

§ post_process()

virtual void Ingen::Server::Event::post_process ( )
pure virtual

§ undo()

virtual void Ingen::Server::Event::undo ( Interface target)
inlinevirtual

§ is_prepared()

bool Ingen::Server::Event::is_prepared ( ) const
inline

Return true iff this event has been pre-processed.

Referenced by Ingen::Server::PreProcessor::event(), and Ingen::Server::PreProcessor::process().

§ time()

SampleCount Ingen::Server::Event::time ( ) const
inline

§ set_time()

void Ingen::Server::Event::set_time ( SampleCount  time)
inline

Set the time stamp of this event.

References time().

Referenced by Ingen::Server::PreProcessor::process().

§ next() [1/2]

Event* Ingen::Server::Event::next ( ) const
inline

§ next() [2/2]

void Ingen::Server::Event::next ( Event ev)
inline

Set the next event to be processed after this one.

§ status()

Status Ingen::Server::Event::status ( ) const
inline

Return the status (success or error code) of this event.

§ get_mode()

Mode Ingen::Server::Event::get_mode ( ) const
inline

Return undo mode of this event.

Referenced by Ingen::Server::PreProcessor::process().

§ set_mode()

void Ingen::Server::Event::set_mode ( Mode  mode)
inline

Set the undo mode of this event.

References time().

Referenced by Ingen::Server::PreProcessor::event().

§ respond()

Status Ingen::Server::Event::respond ( )
inlineprotected

The documentation for this class was generated from the following file: