diff --git a/src/proc/play/play-process.cpp b/src/proc/play/play-process.cpp index de1a66795..709b508c4 100644 --- a/src/proc/play/play-process.cpp +++ b/src/proc/play/play-process.cpp @@ -58,7 +58,7 @@ namespace play { * The caller gets to own and manage the returned process entry. */ PlayProcess* - PlayProcess::initiate (ModelPorts dataGenerators, RenderConfigurator& activeOutputFeedBuilder) + PlayProcess::initiate (ModelPorts dataGenerators, function activeOutputFeedBuilder) { return new PlayProcess (transform (dataGenerators, activeOutputFeedBuilder)); diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp index 532c3c70c..fdcb68b10 100644 --- a/src/proc/play/play-process.hpp +++ b/src/proc/play/play-process.hpp @@ -63,6 +63,7 @@ // #include //#include +#include //#include #include @@ -76,14 +77,13 @@ namespace play { // using lumiera::DummyPlayer; using util::isnil; using proc::mobject::ModelPort; + using std::tr1::function; typedef lib::IterSource::iterator ModelPorts; namespace error = lumiera::error; - /** Strategy for configuring the render process */ - class RenderConfigurator; /** @@ -132,7 +132,7 @@ namespace play { public: static PlayProcess* - initiate (ModelPorts dataGenerators, RenderConfigurator&); + initiate (ModelPorts dataGenerators, function); }; diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp index b6ae24042..5ddb4fe3f 100644 --- a/src/proc/play/play-service.cpp +++ b/src/proc/play/play-service.cpp @@ -26,12 +26,13 @@ #include "proc/play/play-service.hpp" #include "proc/play/play-process.hpp" #include "proc/play/render-configurator.hpp" +#include "proc/play/output-manager.hpp" #include "lib/util-foreach.hpp" #include //#include -//#include +////#include #include //#include @@ -176,22 +177,18 @@ namespace play { * calculated media data to the outputs. */ Play::Controller - PlayService::connect (ModelPorts dataGenerators, Output outputDestinations) + PlayService::connect (ModelPorts dataGenerators, POutputManager outputPossibilities) { + Timings playbackTimings; /////////////////////////////////////////////////////////////TODO + return pTable_->establishProcess( PlayProcess::initiate(dataGenerators, - buildRenderConfiguration(outputDestinations))); + buildRenderConfiguration(outputPossibilities, playbackTimings))); } /** */ - RenderConfigurator& - PlayService::buildRenderConfiguration (Output outputDestinations) - { - UNIMPLEMENTED ("how to build a suitable render configuration"); - } - diff --git a/src/proc/play/play-service.hpp b/src/proc/play/play-service.hpp index 6cc4f9386..daa494122 100644 --- a/src/proc/play/play-service.hpp +++ b/src/proc/play/play-service.hpp @@ -107,9 +107,7 @@ namespace play { /** Implementation: build a PlayProcess */ - virtual Controller connect(ModelPorts, Output); - - RenderConfigurator& buildRenderConfiguration(Output); + virtual Controller connect(ModelPorts, POutputManager); public: diff --git a/src/proc/play/render-configurator.cpp b/src/proc/play/render-configurator.cpp index b134de40b..42fc31a37 100644 --- a/src/proc/play/render-configurator.cpp +++ b/src/proc/play/render-configurator.cpp @@ -29,6 +29,7 @@ //#include //#include +#include #include //#include @@ -42,6 +43,7 @@ namespace play { // using lumiera::Subsys; // using std::auto_ptr; // using boost::scoped_ptr; + using std::tr1::shared_ptr; using std::tr1::bind; using std::tr1::placeholders::_1; using engine::EngineService; @@ -49,6 +51,10 @@ namespace play { typedef EngineService::QoS_Definition RenderQuality; + + RenderConfigurator::~RenderConfigurator() { } // emit VTable here... + + /** Template Method: how to build an active render feed, * pulling from the given exit point of the model and @@ -62,9 +68,6 @@ namespace play { } - RenderConfigurator::RenderConfigurator() - : function (bind (&RenderConfigurator::buildActiveFeed, this, _1)) - { } @@ -124,7 +127,27 @@ namespace play { - /** */ + /** @internal this builder function is used by the PlayService + * when it comes to creating a new PlayProcess. The generated RenderConfigurator + * embodies the specific knowledge how to configure and setup the rendering or + * playback at the EngineFacade, based on the general playback speed and + * quality desirable for this playback process to be initiated. + * @remarks building a special subclass here and managing this instance + * by smart-ptr. Then wrapping all of this up into a functor, + * which can thus be passed on by value. This functor will + * later on be used to transform each desired model port + * into a suitable output connection, where the actual + * output will be resolved through the given + * OutputManager + */ + RenderConfigurator::ConnectFunction + buildRenderConfiguration (POutputManager outputPossibilities, Timings playbackTimings) + { + shared_ptr specialConfig (new DefaultRenderProcessBuilder (outputPossibilities, playbackTimings)); + + return bind (&RenderConfigurator::buildActiveFeed, specialConfig, _1 ); + } + }} // namespace proc::play diff --git a/src/proc/play/render-configurator.hpp b/src/proc/play/render-configurator.hpp index 7b9ef6336..44b44f171 100644 --- a/src/proc/play/render-configurator.hpp +++ b/src/proc/play/render-configurator.hpp @@ -43,11 +43,11 @@ #include "proc/play/play-process.hpp" #include "proc/engine/calc-stream.hpp" #include "proc/play/output-slot.hpp" -//#include "proc/play/output-manager.hpp" +#include "proc/play/output-manager.hpp" //#include "lib/iter-source.hpp" //#include "lib/util.hpp" // -//#include +#include //#include //#include #include @@ -73,18 +73,17 @@ namespace play { /** Strategy for configuring the render process */ class RenderConfigurator - : public function + : boost::noncopyable { public: virtual ~RenderConfigurator(); ///< this is an interface - private: Feed buildActiveFeed (ModelPort); - protected: - RenderConfigurator(); + typedef function ConnectFunction; + protected: /** retrieve a suitable output sink for the data * to be produced at the given model exit point. * While the port already defines the necessary StreamType, @@ -107,6 +106,16 @@ namespace play { virtual engine::CalcStreams buildCalculationStreams (ModelPort, OutputSlot&) =0; }; + + + /** Factory function to build a RenderConfigurator + * specifically tailored for a given PlayProcess. + * @return the public access point to an RenderConfigurator, + * wrapped as generic function object + */ + RenderConfigurator::ConnectFunction + buildRenderConfiguration (POutputManager outputPossibilities, Timings playbackTimings); +