diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index 3f06bb94b..6f9d0af8d 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -26,6 +26,7 @@ #include "proc/common.hpp" //#include "proc/state.hpp" +#include "proc/mobject/model-port.hpp" #include "proc/engine/time-anchor.hpp" #include "proc/engine/frame-coord.hpp" #include "proc/engine/job-ticket.hpp" @@ -38,6 +39,7 @@ namespace proc { namespace engine { + using mobject::ModelPort; using lib::time::TimeSpan; using lib::time::FSecs; using lib::time::Time; @@ -50,12 +52,21 @@ namespace engine { class Dispatcher : boost::noncopyable { + struct CoordBuilder + { + Dispatcher& dispatcher_; + ModelPort modelPort_; + uint channel_; + + FrameCoord relativeFrameLocation (TimeAnchor refPoint, uint frameCountOffset); + }; public: virtual ~Dispatcher(); ///< this is an interface + CoordBuilder onCalcStream (ModelPort modelPort, uint channel); - virtual FrameCoord locateFrameNext (uint frameCountOffset) =0; + virtual FrameCoord locateFrameNext (uint frameCountOffset, TimeAnchor refPoint) =0; JobTicket& accessJobTicket (FrameCoord const&); diff --git a/src/proc/engine/time-anchor.hpp b/src/proc/engine/time-anchor.hpp index f65f7fa30..40b7105e5 100644 --- a/src/proc/engine/time-anchor.hpp +++ b/src/proc/engine/time-anchor.hpp @@ -26,7 +26,6 @@ #include "proc/common.hpp" //#include "proc/state.hpp" -#include "proc/mobject/model-port.hpp" #include "lib/time/timevalue.hpp" #include "proc/play/timings.hpp" @@ -35,10 +34,9 @@ namespace proc { namespace engine { - using mobject::ModelPort; // using lib::time::TimeSpan; // using lib::time::FSecs; -// using lib::time::Time; + using lib::time::Time; // // class ExitNode; @@ -59,6 +57,9 @@ namespace engine { */ class TimeAnchor { + ///////////////////////////TODO need some kind of scale or grid here + uint64_t anchorPoint_; + Time relatedRealTime_; TimeAnchor() { @@ -69,7 +70,7 @@ namespace engine { // using default copy operations static TimeAnchor - build (play::Timings timings, uint64_t startFrame, ModelPort modelPort, uint channel) + build (play::Timings timings, uint64_t startFrame) { UNIMPLEMENTED ("representation of the Time Anchor closure"); } diff --git a/tests/components/proc/engine/dispatcher-interface-test.cpp b/tests/components/proc/engine/dispatcher-interface-test.cpp index be2c4bf91..005ebbb06 100644 --- a/tests/components/proc/engine/dispatcher-interface-test.cpp +++ b/tests/components/proc/engine/dispatcher-interface-test.cpp @@ -71,7 +71,7 @@ namespace test { /* == mock Dispatcher implementation == */ FrameCoord - locateFrameNext (uint frameCountOffset) + locateFrameNext (uint frameCountOffset, TimeAnchor refPoint) { UNIMPLEMENTED ("dummy implementation of the core dispatch operation"); } @@ -132,10 +132,11 @@ namespace test { uint startFrame(10); uint channel(0); - TimeAnchor refPoint = TimeAnchor::build (timings, startFrame, modelPort, channel); + TimeAnchor refPoint = TimeAnchor::build (timings, startFrame); CHECK (refPoint == Time::ZERO + Duration(10, FrameRate::PAL)); - FrameCoord coordinates = dispatcher.locateFrameNext (15); + FrameCoord coordinates = dispatcher.onCalcStream (modelPort,channel) + .relativeFrameLocation (refPoint, 15); CHECK (coordinates.absoluteNominalTime == Time(0,1)); CHECK (coordinates.absoluteFrameNumber == 25); CHECK (coordinates.remainingRealTime() >= Time(FSecs(24,25)));