summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/Event.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-08 03:58:00 +0000
committerDavid Robillard <d@drobilla.net>2006-09-08 03:58:00 +0000
commit48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa (patch)
tree9da4b4b075791ac1ec78b499dbcbec6101f54690 /src/libs/engine/Event.h
parentacbe9a26ec3ab689e430225d15e95e73a7378aa9 (diff)
downloadingen-48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa.tar.gz
ingen-48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa.tar.bz2
ingen-48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa.zip
De-singleton-ified Engine
Slight rework of Responder/ClientKey/ClientInterface for Requests git-svn-id: http://svn.drobilla.net/lad/ingen@119 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/Event.h')
-rw-r--r--src/libs/engine/Event.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/libs/engine/Event.h b/src/libs/engine/Event.h
index 6532655c..3ea72555 100644
--- a/src/libs/engine/Event.h
+++ b/src/libs/engine/Event.h
@@ -25,6 +25,7 @@
namespace Ingen {
+class Engine;
/** Base class for all events (both realtime and QueuedEvent).
@@ -44,27 +45,34 @@ public:
virtual ~Event() {}
/** Execute this event in the audio thread (MUST be realtime safe). */
- virtual void execute(SampleCount offset) { assert(!_executed); _executed = true; }
+ virtual void execute(SampleCount nframes, FrameTime start, FrameTime end)
+ {
+ assert(!_executed);
+ assert(_time >= start && _time <= end);
+ _executed = true;
+ }
/** Perform any actions after execution (ie send replies to commands)
* (no realtime requirements). */
virtual void post_process() {}
- inline SampleCount time_stamp() { return _time_stamp; }
+ inline SampleCount time() { return _time; }
protected:
// Prevent copies
Event(const Event&);
Event& operator=(const Event&);
- Event(CountedPtr<Responder> responder, SampleCount timestamp)
- : _responder(responder)
- , _time_stamp(timestamp)
+ Event(Engine& engine, CountedPtr<Responder> responder, FrameTime time)
+ : _engine(engine)
+ , _responder(responder)
+ , _time(time)
, _executed(false)
{}
+ Engine& _engine;
CountedPtr<Responder> _responder;
- SampleCount _time_stamp;
+ FrameTime _time;
bool _executed;
};