diff --git a/src/proc/engine/calc-plan-continuation.hpp b/src/proc/engine/calc-plan-continuation.hpp index 39eee1093..f16392935 100644 --- a/src/proc/engine/calc-plan-continuation.hpp +++ b/src/proc/engine/calc-plan-continuation.hpp @@ -87,7 +87,7 @@ namespace engine { void invokeJobOperation (JobParameter parameter) { - UNIMPLEMENTED ("representation of the job functor, especially the invocation instance idea for this planning chunk"); + UNIMPLEMENTED ("representation of the job functor, especially the invocation instance ID for this planning chunk"); } @@ -127,12 +127,18 @@ namespace engine { void performJobPlanningChunk() { - UNIMPLEMENTED ("the actual meat: do the planning for a chunk of jobs"); - - JobPlanningSequence jobs = dispatcher_->onCalcStream(modelPort_, channel_) .establishNextJobs(refPoint_); - + + UNIMPLEMENTED ("the actual meat: access the scheduler and fed those jobs"); + } + + Job + buildFollowUpJobFromThis() + { + refPoint_.setNextAnchorPoint(); + + UNIMPLEMENTED ("create the follow-up job, wired with this closure"); } }; diff --git a/src/proc/engine/dispatcher.cpp b/src/proc/engine/dispatcher.cpp index 37ded0273..07ee667ce 100644 --- a/src/proc/engine/dispatcher.cpp +++ b/src/proc/engine/dispatcher.cpp @@ -50,24 +50,6 @@ namespace engine { } - /** */ - Dispatcher::JobBuilder& - Dispatcher::JobBuilder::establishNextJobs (TimeAnchor refPoint) - { - UNIMPLEMENTED ("job planning and generation"); - return *this; - } - - - /** */ - Dispatcher::JobBuilder& - Dispatcher::JobBuilder::prepareContinuation (function delayedAction) - { - UNIMPLEMENTED ("wrap already planned jobs, appending a continuation to pick up later"); - return *this; - } - - diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index 5912c6409..76e54f243 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -74,7 +74,6 @@ namespace engine { struct JobBuilder { Dispatcher& dispatcher_; - TimeAnchor refPoint_; ModelPort modelPort_; uint channel_; @@ -82,23 +81,18 @@ namespace engine { /////////TODO somehow need to represent the dimensions of a "planning chunk"... - FrameCoord relativeFrameLocation (TimeAnchor refPoint, uint frameCountOffset =0); + FrameCoord relativeFrameLocation (TimeAnchor& refPoint, uint frameCountOffset =0); - JobBuilder& establishNextJobs (TimeAnchor refPoint); - - operator JobPlanningSequence() + JobPlanningSequence + establishNextJobs (TimeAnchor& refPoint) { - TimeAnchor nextPlanningAnchor = refPoint_.buildNextAnchor(); - - TODO ("build the continuation job if necessary, wrap the sequence"); - return JobPlanningSequence( relativeFrameLocation(refPoint_), dispatcher_); } - }; + public: virtual ~Dispatcher(); ///< this is an interface diff --git a/src/proc/engine/time-anchor.hpp b/src/proc/engine/time-anchor.hpp index 82e61deca..9a5fb27cb 100644 --- a/src/proc/engine/time-anchor.hpp +++ b/src/proc/engine/time-anchor.hpp @@ -87,7 +87,7 @@ namespace engine { int64_t anchorPoint_; Time relatedRealTime_; - Time + static Time expectedTimeofArival (play::Timings const& timings, int64_t startFrame, Offset startDelay) { Duration totalLatency = startDelay @@ -133,19 +133,20 @@ namespace engine { } - /** create a follow-up TimeAnchor. + /** set a follow-up TimeAnchor point. * After planning a chunk of jobs, the dispatcher uses * this function to set up a new breaking point (TimeAnchor) * and places a continuation job to resume the planning activity. - * @return new TimeAchor which precisely satisfies the planning - * chunk duration: it will be anchored at the following - * grid point, resulting in seamless coverage of the timeline + * @note precisely satisfies the planning chunk duration: + * afterwards the start point will be anchored at the grid point + * following the end of the previous planning chunk, resulting + * in a seamless coverage of the timeline */ - TimeAnchor - buildNextAnchor() const + void + setNextAnchorPoint() { - int64_t nextStart = timings_.establishNextPlanningChunkStart (this->anchorPoint_); - return TimeAnchor(this->timings_, nextStart); + this->anchorPoint_ = timings_.establishNextPlanningChunkStart (this->anchorPoint_); + this->relatedRealTime_ = expectedTimeofArival(this->timings_,this->anchorPoint_, Offset::ZERO); }