From ae36b2d941656faf63487e962f6b1ecc33ed7dca Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 28 May 2011 01:46:06 +0200 Subject: [PATCH] stubs and adjustments to get it through the compiler --- src/include/interfaceproxy.hpp | 72 +++-- src/include/play-facade.h | 18 +- src/lib/meta/generator-combinations.hpp | 10 +- src/lib/meta/util.hpp | 4 +- src/lib/time/control.hpp | 7 +- src/proc/engine/dispatcher.hpp | 6 +- src/proc/engine/engine-service.hpp | 28 +- .../engine/worker/dummy-image-generator.cpp | 282 +++++++++--------- .../engine/worker/dummy-image-generator.hpp | 86 +++--- src/proc/engine/worker/tick-service.hpp | 148 +++++---- src/proc/play/dummy-play-connection.hpp | 38 ++- src/proc/play/dummy-player-service.cpp | 5 +- src/proc/play/dummy-player-service.hpp | 9 +- src/proc/play/output-manager.cpp | 5 +- src/proc/play/play-process.hpp | 54 ++-- src/proc/play/play-service.cpp | 95 ++---- src/proc/play/play-service.hpp | 58 ++-- tests/lib/meta/config-flags-test.cpp | 1 + .../lib/meta/generator-combinations-test.cpp | 8 +- tests/lib/meta/typelist-manip-test.cpp | 12 +- tests/lib/meta/typeseq-manip-test.cpp | 1 + tests/lib/time/time-control-test.cpp | 37 ++- 22 files changed, 474 insertions(+), 510 deletions(-) diff --git a/src/include/interfaceproxy.hpp b/src/include/interfaceproxy.hpp index a488ce65f..54084f8fd 100644 --- a/src/include/interfaceproxy.hpp +++ b/src/include/interfaceproxy.hpp @@ -82,45 +82,43 @@ namespace lumiera { - namespace facade { - - /** error-ID for accessing a (currently) closed facade */ - LUMIERA_ERROR_DECLARE(FACADE_LIFECYCLE); +namespace facade { + /** error-ID for accessing a (currently) closed facade */ + LUMIERA_ERROR_DECLARE(FACADE_LIFECYCLE); + + + /********************************************************************* + * + */ + template + class Accessor + { + protected: + static FA* implProxy_; + + + public: + FA& + operator() () + { + if (implProxy_) + return *implProxy_; + else + throw error::State("Facade interface currently closed."); + } + }; - /********************************************************************* - * - */ - template - class Accessor - { - protected: - static FA* implProxy_; - - - public: - FA& - operator() () - { - if (implProxy_) - return *implProxy_; - else - throw error::State("Facade interface currently closed."); - } - }; - - template - void openProxy (IHA const&); - - template - void closeProxy (); - - template - class Proxy; - - - } // namespace facade + template + void openProxy (IHA const&); -} // namespace lumiera + template + void closeProxy (); + + template + class Proxy; + + +}} // namespace lumiera::facade #endif diff --git a/src/include/play-facade.h b/src/include/play-facade.h index 01db5f5f5..33429323b 100644 --- a/src/include/play-facade.h +++ b/src/include/play-facade.h @@ -32,14 +32,16 @@ //#include "include/interfaceproxy.hpp" #include "lib/handle.hpp" #include "lib/iter-source.hpp" +#include "lib/time/control.hpp" #include "lib/time/timevalue.hpp" +#include "include/interfaceproxy.hpp" #include "proc/mobject/model-port.hpp" #include "proc/mobject/output-designation.hpp" #include "proc/mobject/session/clip.hpp" #include "proc/mobject/session/track.hpp" #include "proc/play/output-manager.hpp" -#include "asset/timeline.hpp" -#include "asset/viewer.hpp" +#include "proc/asset/timeline.hpp" +#include "proc/asset/viewer.hpp" @@ -51,6 +53,8 @@ namespace proc { namespace lumiera { + + namespace time = lib::time; /****************************************************************** @@ -71,7 +75,7 @@ namespace lumiera { public: /** get an implementation instance of this service */ - static lumiera::facade::Accessor facade; + static lumiera::facade::Accessor facade; /** @@ -96,9 +100,9 @@ namespace lumiera { void adjustSpeed(double); ///< playback speed control void go(lib::time::Time); ///< skip to the given point in time - void controlPlayhead (lib::time::TimeControl & ctrl); - void controlDuration (lib::time::TimeControl & ctrl); - void controlLooping (lib::time::TimeControl & ctrl); + void controlPlayhead (time::Control & ctrl); + void controlDuration (time::Control & ctrl); + void controlLooping (time::Control & ctrl); void useProxyMedia (bool); void setQuality (uint); @@ -131,7 +135,7 @@ namespace lumiera { Controller perform(Clip); protected: - virtual ~Player(); + virtual ~Play(); }; diff --git a/src/lib/meta/generator-combinations.hpp b/src/lib/meta/generator-combinations.hpp index dae553182..28790ec01 100644 --- a/src/lib/meta/generator-combinations.hpp +++ b/src/lib/meta/generator-combinations.hpp @@ -47,7 +47,7 @@ namespace typelist{ template - class CartesianProduct + struct CartesianProduct : Distribute< typename TYPES_1::List , typename TYPES_2::List > @@ -60,8 +60,8 @@ namespace typelist{ { template struct SingleCaseInstantiation - : _X_< Pick::Type - , Pick::Type + : _X_< typename Pick::Type + , typename Pick::Type , BASE > { }; @@ -88,8 +88,8 @@ namespace typelist{ , template class _X_ ///< template with two arg types and a base type , class BASE = NullType > - class InstantiateChainedCombinations - : InstantiateChained< CartesianProduct::List + struct InstantiateChainedCombinations + : InstantiateChained< typename CartesianProduct::List , PickParametersFromSublist<_X_>::template SingleCaseInstantiation , BASE > diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp index 97e60f1e1..14c7cd6a8 100644 --- a/src/lib/meta/util.hpp +++ b/src/lib/meta/util.hpp @@ -44,13 +44,13 @@ namespace lumiera { * @warning identical, not sub-type! */ template - class is_sameType + struct is_sameType { static const bool value = false; }; template - class is_sameType + struct is_sameType { static const bool value = true; }; diff --git a/src/lib/time/control.hpp b/src/lib/time/control.hpp index 29a16023a..e5f44629c 100644 --- a/src/lib/time/control.hpp +++ b/src/lib/time/control.hpp @@ -79,7 +79,6 @@ namespace time { //LUMIERA_ERROR_DECLARE (INVALID_MUTATION); ///< Changing a time value in this way was not designated - typedef function timeSignal; /** * Interface: controller-element for retrieving and @@ -91,10 +90,12 @@ namespace time { */ template class Control - : Mutation - , timeSignal + : public Mutation + , public function { public: + typedef function timeSignal; + /** install a callback functor to be invoked * to notify for any changes to the observed * time entity */ diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index 5b4509953..7565c70eb 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -32,9 +32,9 @@ namespace engine { -// using lib::time::TimeSpan; -// using lib::time::FSecs; -// using lib::time::Time; + using lib::time::TimeSpan; + using lib::time::FSecs; + using lib::time::Time; // // class ExitNode; diff --git a/src/proc/engine/engine-service.hpp b/src/proc/engine/engine-service.hpp index 599f4fe40..7798307b0 100644 --- a/src/proc/engine/engine-service.hpp +++ b/src/proc/engine/engine-service.hpp @@ -37,7 +37,7 @@ //#include "common/instancehandle.hpp" //#include "lib/singleton-ref.hpp" // -//#include +#include //#include //#include @@ -66,31 +66,23 @@ namespace play { : boost::noncopyable { - string error_; - Subsys::SigTerm notifyTermination_; +// string error_; +// Subsys::SigTerm notifyTermination_; /* === Interface Lifecycle === */ - typedef lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_DummyPlayer, 0) - , DummyPlayer - > ServiceInstanceHandle; +// typedef lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_DummyPlayer, 0) +// , DummyPlayer +// > ServiceInstanceHandle; - lib::SingletonRef implInstance_; - ServiceInstanceHandle serviceInstance_; +// lib::SingletonRef implInstance_; +// ServiceInstanceHandle serviceInstance_; public: - DummyPlayerService(Subsys::SigTerm terminationHandle); + EngineService(); /////TODO (Subsys::SigTerm terminationHandle); - ~DummyPlayerService() { notifyTermination_(&error_); } - - - - /** conceptually, this serves as implementation - * of the DummyPlayer#start() function. But because - * this function sits \em behind the interface, it - * just returns an impl pointer. */ - ProcessImpl* start (LumieraDisplaySlot viewerHandle); + ~EngineService() { } /////TODO notifyTermination_(&error_); } }; diff --git a/src/proc/engine/worker/dummy-image-generator.cpp b/src/proc/engine/worker/dummy-image-generator.cpp index 44cf97cd1..577da2f94 100644 --- a/src/proc/engine/worker/dummy-image-generator.cpp +++ b/src/proc/engine/worker/dummy-image-generator.cpp @@ -22,149 +22,147 @@ * *****************************************************/ -#include "proc/play/dummy-image-generator.hpp" +#include "proc/engine/worker/dummy-image-generator.hpp" namespace proc { - namespace play { - - - - namespace { // implementation details - - - typedef unsigned char byte; - - inline int - clamp (const int &val, const int &maxval, const int &minval) - { - if(val > maxval) return maxval; - if(val < minval) return minval; - return val; - } - - inline void - rgb_to_yuv (int r, int g, int b, byte &y, byte &u, byte &v) - { - // This code isn't great, but it does the job - y = (byte)clamp((299 * r + 587 * g + 114 * b) / 1000, 235, 16); - v = (byte)clamp((500 * r - 419 * g - 81 * b) / 1000 + 127, 255, 0); - u = (byte)clamp((-169 * r - 331 * g + 500 * b) / 1000 + 127, 255, 0); - } - - - void - rgb_buffer_to_yuy2 (unsigned char *in, unsigned char *out) - { - for (uint i = 0; i < 320*240*2; i+=4) - { - byte y0, u0, v0; - const byte r0 = *(in++); - const byte g0 = *(in++); - const byte b0 = *(in++); - rgb_to_yuv(r0, g0, b0, y0, u0, v0); - - byte y1, u1, v1; - const byte r1 = *(in++); - const byte g1 = *(in++); - const byte b1 = *(in++); - rgb_to_yuv(r1, g1, b1, y1, u1, v1); - - out[i] = y0; - out[i + 1] = u0; - out[i + 2] = y1; - out[i + 3] = v0; - } } - - - } // (End) implementation details - - - - - DummyImageGenerator::DummyImageGenerator(uint fps) - : current_(0) - , frame_(0) - , fps_(fps) - { } - - - LumieraDisplayFrame - DummyImageGenerator::next() - { - - ++frame_; - if(frame_ > 2 * fps_) - frame_ = 0; - - if(frame_ < 1 * fps_) - { - // create random snow... - for(int i = 0; i < 320*240*3; i+=3) - { - byte value ( rand() ); - buf_[i] = value; - buf_[i+1] = value; - buf_[i+2] = value; - } - } - else - { // create a colour strip pattern - typedef unsigned char Row[320 * 3]; - - unsigned char * row = buf_; - - // create a colour strip pattern in the first row... - for(int x = 0; x < 320; ++x) - { - byte &r = row[x*3]; - byte &g = row[x*3+1]; - byte &b = row[x*3+2]; - - if (x < 1*320/7) r = 0xC0, g = 0xC0, b = 0xC0; - else if(x < 2*320/7) r = 0xC0, g = 0xC0, b = 0x00; - else if(x < 3*320/7) r = 0x00, g = 0xC0, b = 0xC0; - else if(x < 4*320/7) r = 0x00, g = 0xC0, b = 0x00; - else if(x < 5*320/7) r = 0xC0, g = 0x00, b = 0xC0; - else if(x < 6*320/7) r = 0xC0, g = 0x00, b = 0x00; - else r = 0x00, g = 0x00, b = 0xC0; - } - - // fill remaining rows of the frame with the same pattern - for(int y = 1; y < 240; ++y) - memcpy(buf_ + y*sizeof(Row), row, sizeof(Row)); - - } - - // select output buffer to return - LumieraDisplayFrame outBuff; - - if (!current_) - { - outBuff = outFrame_A_; - current_= 1; - } - else - { - outBuff = outFrame_B_; - current_= 0; - } - - rgb_buffer_to_yuy2(buf_, outBuff); - return outBuff; - - } - - - LumieraDisplayFrame - DummyImageGenerator::current() - { - if (!current_) return outFrame_A_; - else return outFrame_B_; - } - - - - } // namespace play +namespace node { -} // namespace proc + + + namespace { // implementation details + + + typedef unsigned char byte; + + inline int + clamp (const int &val, const int &maxval, const int &minval) + { + if(val > maxval) return maxval; + if(val < minval) return minval; + return val; + } + + inline void + rgb_to_yuv (int r, int g, int b, byte &y, byte &u, byte &v) + { + // This code isn't great, but it does the job + y = (byte)clamp((299 * r + 587 * g + 114 * b) / 1000, 235, 16); + v = (byte)clamp((500 * r - 419 * g - 81 * b) / 1000 + 127, 255, 0); + u = (byte)clamp((-169 * r - 331 * g + 500 * b) / 1000 + 127, 255, 0); + } + + + void + rgb_buffer_to_yuy2 (unsigned char *in, unsigned char *out) + { + for (uint i = 0; i < 320*240*2; i+=4) + { + byte y0, u0, v0; + const byte r0 = *(in++); + const byte g0 = *(in++); + const byte b0 = *(in++); + rgb_to_yuv(r0, g0, b0, y0, u0, v0); + + byte y1, u1, v1; + const byte r1 = *(in++); + const byte g1 = *(in++); + const byte b1 = *(in++); + rgb_to_yuv(r1, g1, b1, y1, u1, v1); + + out[i] = y0; + out[i + 1] = u0; + out[i + 2] = y1; + out[i + 3] = v0; + } } + + + } // (End) implementation details + + + + + DummyImageGenerator::DummyImageGenerator(uint fps) + : current_(0) + , frame_(0) + , fps_(fps) + { } + + + LumieraDisplayFrame + DummyImageGenerator::next() + { + + ++frame_; + if(frame_ > 2 * fps_) + frame_ = 0; + + if(frame_ < 1 * fps_) + { + // create random snow... + for(int i = 0; i < 320*240*3; i+=3) + { + byte value ( rand() ); + buf_[i] = value; + buf_[i+1] = value; + buf_[i+2] = value; + } + } + else + { // create a colour strip pattern + typedef unsigned char Row[320 * 3]; + + unsigned char * row = buf_; + + // create a colour strip pattern in the first row... + for(int x = 0; x < 320; ++x) + { + byte &r = row[x*3]; + byte &g = row[x*3+1]; + byte &b = row[x*3+2]; + + if (x < 1*320/7) r = 0xC0, g = 0xC0, b = 0xC0; + else if(x < 2*320/7) r = 0xC0, g = 0xC0, b = 0x00; + else if(x < 3*320/7) r = 0x00, g = 0xC0, b = 0xC0; + else if(x < 4*320/7) r = 0x00, g = 0xC0, b = 0x00; + else if(x < 5*320/7) r = 0xC0, g = 0x00, b = 0xC0; + else if(x < 6*320/7) r = 0xC0, g = 0x00, b = 0x00; + else r = 0x00, g = 0x00, b = 0xC0; + } + + // fill remaining rows of the frame with the same pattern + for(int y = 1; y < 240; ++y) + memcpy(buf_ + y*sizeof(Row), row, sizeof(Row)); + + } + + // select output buffer to return + LumieraDisplayFrame outBuff; + + if (!current_) + { + outBuff = outFrame_A_; + current_= 1; + } + else + { + outBuff = outFrame_B_; + current_= 0; + } + + rgb_buffer_to_yuy2(buf_, outBuff); + return outBuff; + + } + + + LumieraDisplayFrame + DummyImageGenerator::current() + { + if (!current_) return outFrame_A_; + else return outFrame_B_; + } + + + +}} // namespace proc::node diff --git a/src/proc/engine/worker/dummy-image-generator.hpp b/src/proc/engine/worker/dummy-image-generator.hpp index c893962b8..e364423ef 100644 --- a/src/proc/engine/worker/dummy-image-generator.hpp +++ b/src/proc/engine/worker/dummy-image-generator.hpp @@ -35,8 +35,8 @@ */ -#ifndef PROC_PLAY_DUMMY_IMAGE_GENERATOR_H -#define PROC_PLAY_DUMMY_IMAGE_GENERATOR_H +#ifndef PROC_NODE_DUMMY_IMAGE_GENERATOR_H +#define PROC_NODE_DUMMY_IMAGE_GENERATOR_H #include "lib/error.hpp" @@ -44,47 +44,45 @@ namespace proc { - namespace play { +namespace node { + + + class DummyImageGenerator + { + + unsigned char buf_[320 * 240 * 3]; ///< working buffer for next frame + + unsigned char outFrame_A_[320 * 240 * 4]; ///< output frame 1 + unsigned char outFrame_B_[320 * 240 * 4]; ///< output frame 2 + + uint current_; + uint frame_; + uint fps_; + + + public: + DummyImageGenerator(uint fps); + + ~DummyImageGenerator() { } + + /** generate the next frame and + * occupy the alternate buffer. + * @return the buffer containing the new frame + */ + LumieraDisplayFrame next(); + + /** just re-return a pointer to the current frame + * without generating any new image data */ + LumieraDisplayFrame current(); + + + private: + + }; - - class DummyImageGenerator - { - - unsigned char buf_[320 * 240 * 3]; ///< working buffer for next frame - - unsigned char outFrame_A_[320 * 240 * 4]; ///< output frame 1 - unsigned char outFrame_B_[320 * 240 * 4]; ///< output frame 2 - - uint current_; - uint frame_; - uint fps_; - - - public: - DummyImageGenerator(uint fps); - - ~DummyImageGenerator() { } - - /** generate the next frame and - * occupy the alternate buffer. - * @return the buffer containing the new frame - */ - LumieraDisplayFrame next(); - - /** just re-return a pointer to the current frame - * without generating any new image data */ - LumieraDisplayFrame current(); - - - private: - - }; - - - - - } // namespace play - -} // namespace proc -#endif // PROC_PLAY_DUMMY_IMAGE_GENERATOR_H + + + +}} // namespace proc::node +#endif diff --git a/src/proc/engine/worker/tick-service.hpp b/src/proc/engine/worker/tick-service.hpp index a67116020..3f93dee56 100644 --- a/src/proc/engine/worker/tick-service.hpp +++ b/src/proc/engine/worker/tick-service.hpp @@ -46,82 +46,80 @@ namespace proc { - namespace play { +namespace node { - using std::tr1::function; - - - - /************************************************************ - * Tick generating service for a periodic callback, - * with adjustable frequency. Quick'n dirty implementation! - */ - class TickService - : backend::ThreadJoinable - { - typedef function Tick; - volatile uint timespan_; - - /** poll interval for new settings in wait state */ - static const uint POLL_TIMEOUT = 1000; - - public: - TickService (Tick callback) - : ThreadJoinable("Tick generator (dummy)" - , bind (&TickService::timerLoop, this, callback) - ) - { - INFO (proc, "TickService started."); - } - - ~TickService () - { - timespan_ = 0; - this->join(); - usleep (200000); // additional delay allowing GTK to dispatch the last output - - INFO (proc, "TickService shutdown."); - } - - - /** set the periodic timer to run with a given frequency, - * starting \em now. Well, not actually now, but at the next - * opportunity. It should be \em now, but this implementation - * is sloppy! setting fps==0 halts (pauses) the timer. - */ - void activate (uint fps) - { - REQUIRE ( 0==fps - ||( 1000000/fps < std::numeric_limits::max() - && 1000000/fps > POLL_TIMEOUT)); - if (fps) - timespan_ = 1000000/fps; // microseconds per tick - else - timespan_ = POLL_TIMEOUT; - } - - - private: - void timerLoop(Tick periodicFun) - { - timespan_ = POLL_TIMEOUT; - while (0 < timespan_) - { - if (timespan_ > POLL_TIMEOUT) - periodicFun(); - - usleep (timespan_); - } - TRACE (proc_dbg, "Tick Thread timer loop exiting..."); - } + using std::tr1::function; - }; - - - - - } // namespace play + + + /************************************************************ + * Tick generating service for a periodic callback, + * with adjustable frequency. Quick'n dirty implementation! + */ + class TickService + : backend::ThreadJoinable + { + typedef function Tick; + volatile uint timespan_; + + /** poll interval for new settings in wait state */ + static const uint POLL_TIMEOUT = 1000; + + public: + TickService (Tick callback) + : ThreadJoinable("Tick generator (dummy)" + , bind (&TickService::timerLoop, this, callback) + ) + { + INFO (proc, "TickService started."); + } + + ~TickService () + { + timespan_ = 0; + this->join(); + usleep (200000); // additional delay allowing GTK to dispatch the last output + + INFO (proc, "TickService shutdown."); + } + + + /** set the periodic timer to run with a given frequency, + * starting \em now. Well, not actually now, but at the next + * opportunity. It should be \em now, but this implementation + * is sloppy! setting fps==0 halts (pauses) the timer. + */ + void activate (uint fps) + { + REQUIRE ( 0==fps + ||( 1000000/fps < std::numeric_limits::max() + && 1000000/fps > POLL_TIMEOUT)); + if (fps) + timespan_ = 1000000/fps; // microseconds per tick + else + timespan_ = POLL_TIMEOUT; + } + + + private: + void timerLoop(Tick periodicFun) + { + timespan_ = POLL_TIMEOUT; + while (0 < timespan_) + { + if (timespan_ > POLL_TIMEOUT) + periodicFun(); + + usleep (timespan_); + } + TRACE (proc_dbg, "Tick Thread timer loop exiting..."); + } -} // namespace proc -#endif // PROC_PLAY_TICKSERVICE_H + }; + + + + +}} // namespace proc::node +#endif diff --git a/src/proc/play/dummy-play-connection.hpp b/src/proc/play/dummy-play-connection.hpp index 7186987df..0f002cb1b 100644 --- a/src/proc/play/dummy-play-connection.hpp +++ b/src/proc/play/dummy-play-connection.hpp @@ -37,33 +37,31 @@ //#include "common/instancehandle.hpp" //#include "lib/singleton-ref.hpp" // -//#include +#include //#include //#include namespace proc { - namespace play { - +namespace play { + // using std::string; // using lumiera::Subsys; // using lumiera::Display; // using lumiera::DummyPlayer; - - - - /******************************************************************** - */ - class DummyPlayConnection - : boost::noncopyable - { - - }; - - - - - } // namespace play - -} // namespace proc + + + + /******************************************************************** + */ + class DummyPlayConnection + : boost::noncopyable + { + + }; + + + + +}} // namespace proc::play #endif diff --git a/src/proc/play/dummy-player-service.cpp b/src/proc/play/dummy-player-service.cpp index ea443f709..d4905f2d4 100644 --- a/src/proc/play/dummy-player-service.cpp +++ b/src/proc/play/dummy-player-service.cpp @@ -22,8 +22,8 @@ #include "proc/play/dummy-player-service.hpp" -#include "proc/play/dummy-image-generator.hpp" -#include "proc/play/tick-service.hpp" +#include "proc/engine/worker/dummy-image-generator.hpp" +#include "proc/engine/worker/tick-service.hpp" #include "lib/singleton.hpp" extern "C" { @@ -47,6 +47,7 @@ namespace proc { using std::tr1::bind; + namespace { // hidden local details of the service implementation.... /** details of how the DummyPlayer service can be started diff --git a/src/proc/play/dummy-player-service.hpp b/src/proc/play/dummy-player-service.hpp index 75e0f3d78..5cf8438ac 100644 --- a/src/proc/play/dummy-player-service.hpp +++ b/src/proc/play/dummy-player-service.hpp @@ -52,6 +52,11 @@ namespace proc { + namespace node { + class DummyImageGenerator; + class TickService; + } + namespace play { using std::string; @@ -59,9 +64,9 @@ namespace proc { using lumiera::Display; using lumiera::DummyPlayer; + using proc::node::DummyImageGenerator; + using proc::node::TickService; - class DummyImageGenerator; - class TickService; /******************************************************************** diff --git a/src/proc/play/output-manager.cpp b/src/proc/play/output-manager.cpp index 39887ec80..6ffca994f 100644 --- a/src/proc/play/output-manager.cpp +++ b/src/proc/play/output-manager.cpp @@ -21,10 +21,11 @@ * *****************************************************/ -#include "play/output-manager.hpp" +#include "proc/play/output-manager.hpp" +namespace proc { namespace play { @@ -40,4 +41,4 @@ namespace play { -} // namespace play +}} // namespace proc::play diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp index f9d0ea85c..44a259c33 100644 --- a/src/proc/play/play-process.hpp +++ b/src/proc/play/play-process.hpp @@ -36,41 +36,39 @@ //#include "common/instancehandle.hpp" //#include "lib/singleton-ref.hpp" // -//#include +#include //#include //#include namespace proc { - namespace play { - +namespace play { + // using std::string; // using lumiera::Subsys; // using lumiera::Display; // using lumiera::DummyPlayer; - - - - /****************************************************** - * Actual implementation of the DummyPlayer service. - * Creating an instance of this class automatically - * registers the interface lumieraorg_DummyPlayer with - * the Lumiera Interface/Plugin system and creates - * a forwarding proxy within the application core to - * route calls through this interface. - */ - class PlayerProcess - : boost::noncopyable - { - - public: - - }; - - - - - } // namespace play - -} // namespace proc + + + + /****************************************************** + * Actual implementation of the DummyPlayer service. + * Creating an instance of this class automatically + * registers the interface lumieraorg_DummyPlayer with + * the Lumiera Interface/Plugin system and creates + * a forwarding proxy within the application core to + * route calls through this interface. + */ + class PlayerProcess + : boost::noncopyable + { + + public: + + }; + + + + +}} // namespace proc::play #endif diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp index 1b8cc463e..7ee13c480 100644 --- a/src/proc/play/play-service.cpp +++ b/src/proc/play/play-service.cpp @@ -32,75 +32,32 @@ -namespace proc { - namespace play{ - - using std::string; - using lumiera::Subsys; - using std::auto_ptr; - using boost::scoped_ptr; - using std::tr1::bind; - - - namespace { // hidden local details of the service implementation.... - - /** details of how the DummyPlayer service can be started - * and used as independent "subsystem" within main() */ - class DummyPlayerSubsysDescriptor - : public Subsys - { - operator string () const { return "Dummy-Player"; } - - - bool - shouldStart (lumiera::Option&) - { - return false; // for now the DummyPlayerService only comes "up" as dependency, - } // but doesn't start as a subsystem on it's own. - - bool - start (lumiera::Option&, Subsys::SigTerm terminationHandle) - { - ASSERT (!thePlayer_); - - thePlayer_.reset (new DummyPlayerService (terminationHandle)); - return true; - } - - /** manages the actual (single) instance of the player service impl */ - scoped_ptr thePlayer_; - - - void - triggerShutdown () throw() - { - thePlayer_.reset(0); - // note: shutdown of the DummyPlayerService instance may block - // for a short period, until termination of all tick services - } - - bool - checkRunningState () throw() - { - return (thePlayer_); - } - }; - - lib::Singleton theDummyPlayerDescriptor; - - - - - - /* ================== define an lumieraorg_DummyPlayer instance ======================= */ - - - } // (End) hidden service impl details - - - - - /** */ +namespace proc { +namespace play { + +//using std::string; +//using lumiera::Subsys; +//using std::auto_ptr; +//using boost::scoped_ptr; +//using std::tr1::bind; + namespace { // hidden local details of the service implementation.... + + + + + + + /* ================== define an lumieraorg_DummyPlayer instance ======================= */ + + + } // (End) hidden service impl details + + + + + /** */ + + }} // namespace proc::play diff --git a/src/proc/play/play-service.hpp b/src/proc/play/play-service.hpp index f2b8e2d4d..03780f134 100644 --- a/src/proc/play/play-service.hpp +++ b/src/proc/play/play-service.hpp @@ -41,37 +41,35 @@ namespace proc { - namespace play { +namespace play { + + using std::string; +//using lumiera::Subsys; +//using lumiera::Display; +//using lumiera::DummyPlayer; + - using std::string; - using lumiera::Subsys; - using lumiera::Display; - using lumiera::DummyPlayer; - - // class DummyImageGenerator; // class TickService; - - - - /****************************************************** - * Interface: Player subsystem. - */ - class PlayService - : boost::noncopyable - { - - public: - PlayService(Subsys::SigTerm terminationHandle); - - ~PlayService() { notifyTermination_(&error_); } - - }; - - - - - } // namespace play - -} // namespace proc + + + + /****************************************************** + * Interface: Player subsystem. + */ + class PlayService + : boost::noncopyable + { + + public: + PlayService(); /////TODO Subsys::SigTerm terminationHandle); + + ~PlayService() { }/////TODO notifyTermination_(&error_); } + + }; + + + + +}} // namespace proc::play #endif diff --git a/tests/lib/meta/config-flags-test.cpp b/tests/lib/meta/config-flags-test.cpp index 572bc3adf..57a5621d1 100644 --- a/tests/lib/meta/config-flags-test.cpp +++ b/tests/lib/meta/config-flags-test.cpp @@ -52,6 +52,7 @@ using ::test::Test; using std::string; using std::cout; +using std::endl; namespace lumiera { diff --git a/tests/lib/meta/generator-combinations-test.cpp b/tests/lib/meta/generator-combinations-test.cpp index be6b322fe..2a55998e2 100644 --- a/tests/lib/meta/generator-combinations-test.cpp +++ b/tests/lib/meta/generator-combinations-test.cpp @@ -54,7 +54,7 @@ namespace test { using boost::str; using boost::format; - format fmt ("-<%u%u>%s"); + format formatted ("-<%u%u>%s"); /** * A Test-Template to be instantiated @@ -63,17 +63,19 @@ namespace test { */ template struct TestCase + : BASE { static string visitAll() { T1 param1; T2 param2; - return str(fmt % param1 % param2 - % BASE::visitAll()); + return str(formatted % param1 % param2 + % BASE::visitAll()); } }; + template<> struct TestCase { static string diff --git a/tests/lib/meta/typelist-manip-test.cpp b/tests/lib/meta/typelist-manip-test.cpp index 3e34eab37..09ab07390 100644 --- a/tests/lib/meta/typelist-manip-test.cpp +++ b/tests/lib/meta/typelist-manip-test.cpp @@ -131,17 +131,17 @@ namespace test { Pick::Type e1; Pick::Type e2; - Pick::Type E3; - Pick::Type Nil; - Pick::Type Irrelevant; + typedef Pick::Type E3; + typedef Pick::Type Nil; + typedef Pick::Type Irrelevant; CHECK (5 == e0); CHECK (6 == e1); CHECK (7 == e2); - CHECK (is_sameType::value); - CHECK (is_sameType::value); - CHECK (is_sameType::value); + CHECK ((is_sameType::value)); + CHECK ((is_sameType::value)); + CHECK ((is_sameType::value)); } diff --git a/tests/lib/meta/typeseq-manip-test.cpp b/tests/lib/meta/typeseq-manip-test.cpp index 1221c610b..6efffd272 100644 --- a/tests/lib/meta/typeseq-manip-test.cpp +++ b/tests/lib/meta/typeseq-manip-test.cpp @@ -48,6 +48,7 @@ using ::test::Test; using std::string; using std::cout; +using std::endl; namespace lumiera { diff --git a/tests/lib/time/time-control-test.cpp b/tests/lib/time/time-control-test.cpp index b233ef114..a89b96e48 100644 --- a/tests/lib/time/time-control-test.cpp +++ b/tests/lib/time/time-control-test.cpp @@ -27,7 +27,7 @@ #include "lib/time/timequant.hpp" #include "lib/time/mutation.hpp" #include "proc/asset/meta/time-grid.hpp" -#include "lib/meta/typelist.hpp" +#include "lib/meta/generator-combinations.hpp" #include "lib/util.hpp" #include @@ -47,7 +47,7 @@ namespace test{ using asset::meta::TimeGrid; using lumiera::typelist::Types; - using lumiera::typelist::InstantiateForEach; + using lumiera::typelist::InstantiateChainedCombinations; namespace { inline string @@ -58,6 +58,24 @@ namespace test{ arg.erase (arg.begin()); return entry; } + + + template + struct TestCase + : BASE + { + void + performTestCases() + { + + } + }; + + struct IterationEnd + { + void performTestCases() { } + }; + } @@ -124,22 +142,17 @@ namespace test{ { } - template - struct TestCase4Target - { - void - performTestCases() - { - - } - }; void verifyMatrix_of_MutationCases () { typedef Types KindsOfTarget; - typedef InstantiateForEach TestMatrix; + typedef Types KindsOfSource; + typedef InstantiateChainedCombinations< KindsOfTarget + , KindsOfSource + , TestCase + , IterationEnd > TestMatrix; TestMatrix().performTestCases(); }