summaryrefslogtreecommitdiffstats
path: root/src/engine/Context.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/Context.hpp')
-rw-r--r--src/engine/Context.hpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/engine/Context.hpp b/src/engine/Context.hpp
index db19d5f9..8d3085b8 100644
--- a/src/engine/Context.hpp
+++ b/src/engine/Context.hpp
@@ -18,6 +18,8 @@
#ifndef CONTEXT_H
#define CONTEXT_H
+#include "EventSink.hpp"
+
namespace Ingen {
class Engine;
@@ -33,15 +35,32 @@ public:
Context(Engine& engine, ID id)
: _id(id)
, _engine(engine)
+ , _event_sink(engine, 1024) // FIXME: size?
+ , _start(0)
+ , _realtime(true)
{}
virtual ~Context() {}
- inline Engine& engine() const { return _engine; }
+ ID id() const { return _id; }
+
+ void locate(FrameTime s) { _start = s; }
+
+ inline Engine& engine() const { return _engine; }
+ inline FrameTime start() const { return _start; }
+ inline bool realtime() const { return _realtime; }
+
+ inline const EventSink& event_sink() const { return _event_sink; }
+ inline EventSink& event_sink() { return _event_sink; }
protected:
- ID _id; ///< Fast ID for this context
- Engine& _engine; ///< Engine we're running in
+ ID _id; ///< Fast ID for this context
+ Engine& _engine; ///< Engine we're running in
+
+private:
+ EventSink _event_sink; ///< Sink for events generated in a realtime context
+ FrameTime _start; ///< Start frame of this cycle, timeline relative
+ bool _realtime; ///< True iff context is hard realtime
};