diff options
author | David Robillard <d@drobilla.net> | 2008-11-23 20:55:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-23 20:55:20 +0000 |
commit | 4a1f6eeb270840d17e70251443ef7945ebd934f7 (patch) | |
tree | a447ebc48224357a5d77cbab292154e18ef89a86 /src/engine/QueuedEventSource.hpp | |
parent | 9845c8616439e9c284b9d82b9ed17296dacaaa4e (diff) | |
download | ingen-4a1f6eeb270840d17e70251443ef7945ebd934f7.tar.gz ingen-4a1f6eeb270840d17e70251443ef7945ebd934f7.tar.bz2 ingen-4a1f6eeb270840d17e70251443ef7945ebd934f7.zip |
Remove unused 'stamped' event queue cruft.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1774 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/QueuedEventSource.hpp')
-rw-r--r-- | src/engine/QueuedEventSource.hpp | 59 |
1 files changed, 10 insertions, 49 deletions
diff --git a/src/engine/QueuedEventSource.hpp b/src/engine/QueuedEventSource.hpp index 1d846897..a06de39f 100644 --- a/src/engine/QueuedEventSource.hpp +++ b/src/engine/QueuedEventSource.hpp @@ -49,7 +49,7 @@ class PostProcessor; class QueuedEventSource : public EventSource, protected Raul::Slave { public: - QueuedEventSource(size_t queued_size, size_t stamped_size); + QueuedEventSource(size_t queue_size); ~QueuedEventSource(); void activate() { Slave::start(); } @@ -57,72 +57,33 @@ public: void process(PostProcessor& dest, ProcessContext& context); - void unblock(); + /** Signal that the blocking event is finished. + * When this is called preparing will resume. This MUST be called by + * blocking events in their post_process() method. */ + inline void unblock() { _blocking_semaphore.post(); } protected: - void push_queued(QueuedEvent* const ev); - inline void push_stamped(Event* const ev) { _stamped_queue.push(ev); } - Event* pop_earliest_queued_before(const SampleCount time); - inline Event* pop_earliest_stamped_before(const SampleCount time); + void push_queued(QueuedEvent* const ev); + Event* pop_earliest_queued_before(const SampleCount time); inline bool unprepared_events() { return (_prepared_back.get() != _back.get()); } virtual void _whipped(); ///< Prepare 1 event private: - // Note that it's crucially important which functions access which of these - // variables, to maintain threadsafeness. + // Note it's important which functions access which variables for thread safety - //(FIXME: make this a separate class?) // 2-part queue for events that require pre-processing: AtomicInt _front; ///< Front of queue - AtomicInt _back; ///< Back of entire queue (1 past index of back element) - AtomicInt _prepared_back; ///< Back of prepared section (1 past index of back prepared element) + AtomicInt _back; ///< Back of entire queue (index of back event + 1) + AtomicInt _prepared_back; ///< Back of prepared events (index of back prepared event + 1) const size_t _size; QueuedEvent** _events; Raul::Semaphore _blocking_semaphore; - Raul::Semaphore _full_semaphore; - - /** Queue for timestamped events (no pre-processing). */ - Raul::SRSWQueue<Event*> _stamped_queue; }; -/** Pops the realtime (timestamped, not preprocessed) event off the realtime queue. - * - * Engine will use the sample timestamps of returned events directly and execute the - * event with sample accuracy. Timestamps in the past will be bumped forward to - * the beginning of the cycle (offset 0), when eg. skipped cycles occur. - */ -inline Event* -QueuedEventSource::pop_earliest_stamped_before(const SampleCount time) -{ - Event* ret = NULL; - - if (!_stamped_queue.empty()) { - if (_stamped_queue.front()->time() < time) { - ret = _stamped_queue.front(); - _stamped_queue.pop(); - } - } - - return ret; -} - - -/** Signal that the blocking event is finished. - * - * When this is called preparing will resume. This MUST be called by - * blocking events in their post_process() method. - */ -inline void -QueuedEventSource::unblock() -{ - _blocking_semaphore.post(); -} - - } // namespace Ingen #endif // QUEUEDEVENTSOURCE_H |