diff options
author | David Robillard <d@drobilla.net> | 2014-08-31 01:24:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-08-31 01:24:57 +0000 |
commit | a2792bd09212eed55bba1aa30dc09043a6955486 (patch) | |
tree | d4262f760d4522bc6f1c99778987aada332b9e7e /src/server/Context.hpp | |
parent | e3ecb2b439bd03d27b5e11efe430c24f0ebe6283 (diff) | |
download | ingen-a2792bd09212eed55bba1aa30dc09043a6955486.tar.gz ingen-a2792bd09212eed55bba1aa30dc09043a6955486.tar.bz2 ingen-a2792bd09212eed55bba1aa30dc09043a6955486.zip |
Use float sequences for sample-accurate control ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5462 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Context.hpp')
-rw-r--r-- | src/server/Context.hpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/server/Context.hpp b/src/server/Context.hpp index bea43943..a11a5e8c 100644 --- a/src/server/Context.hpp +++ b/src/server/Context.hpp @@ -50,8 +50,9 @@ public: }; Context(Engine& engine, ID id); + Context(const Context& copy); - virtual ~Context() {} + virtual ~Context(); /** Return true iff the given port should broadcast its value. * @@ -75,7 +76,7 @@ public: void emit_notifications(FrameTime end); /** Return true iff any notifications are pending. */ - bool pending_notifications() const { return _event_sink.read_space(); } + bool pending_notifications() const { return _event_sink->read_space(); } inline ID id() const { return _id; } @@ -91,22 +92,33 @@ public: _nframes = other._nframes; } + inline void slice(SampleCount offset, SampleCount nframes) { + _offset = offset; + _nframes = nframes; + } + inline Engine& engine() const { return _engine; } inline FrameTime start() const { return _start; } + inline FrameTime time() const { return _start + _offset; } inline FrameTime end() const { return _end; } + inline SampleCount offset() const { return _offset; } inline SampleCount nframes() const { return _nframes; } inline bool realtime() const { return _realtime; } protected: + const Context& operator=(const Context& copy) = delete; + Engine& _engine; ///< Engine we're running in ID _id; ///< Fast ID for this context - Raul::RingBuffer _event_sink; ///< Port updates from process context + Raul::RingBuffer* _event_sink; ///< Port updates from process context FrameTime _start; ///< Start frame of this cycle, timeline relative FrameTime _end; ///< End frame of this cycle, timeline relative - SampleCount _nframes; ///< Length of this cycle in frames + SampleCount _offset; ///< Offset into data buffers + SampleCount _nframes; ///< Number of frames past offset to process bool _realtime; ///< True iff context is hard realtime + bool _copy; ///< True iff this is a copy (shared event_sink) }; } // namespace Server |