From 32c2c85abc8ec8e6d4de21cd9610aa17eb81a0ec Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 8 Feb 2009 02:00:55 +0100 Subject: [PATCH] add the impl. of the periodic playback function, now pushing output up to GUI --- src/proc/play/dummy-image-generator.cpp | 6 +++--- src/proc/play/dummy-image-generator.hpp | 5 +++-- src/proc/play/dummy-player-service.cpp | 12 +++++------- src/proc/play/dummy-player-service.hpp | 5 ++++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/proc/play/dummy-image-generator.cpp b/src/proc/play/dummy-image-generator.cpp index 29d58a1ac..603b0d033 100644 --- a/src/proc/play/dummy-image-generator.cpp +++ b/src/proc/play/dummy-image-generator.cpp @@ -89,7 +89,7 @@ namespace proc { { } - void * const + const LumieraDisplayFrame DummyImageGenerator::next() { @@ -137,7 +137,7 @@ namespace proc { } // select output buffer to return - unsigned char * outBuff; + LumieraDisplayFrame outBuff; if (!current_) { @@ -156,7 +156,7 @@ namespace proc { } - void * const + const LumieraDisplayFrame DummyImageGenerator::current() { if (!current_) return outFrame_A_; diff --git a/src/proc/play/dummy-image-generator.hpp b/src/proc/play/dummy-image-generator.hpp index e24a4592e..693a6058e 100644 --- a/src/proc/play/dummy-image-generator.hpp +++ b/src/proc/play/dummy-image-generator.hpp @@ -40,6 +40,7 @@ #include "lib/error.hpp" +#include "include/display-facade.h" namespace proc { @@ -68,11 +69,11 @@ namespace proc { * occupy the alternate buffer. * @return the buffer containing the new frame */ - void * const next(); + const LumieraDisplayFrame next(); /** just re-return a pointer to the current frame * without generating any new image data */ - void * const current(); + const LumieraDisplayFrame current(); private: diff --git a/src/proc/play/dummy-player-service.cpp b/src/proc/play/dummy-player-service.cpp index 9b2d80cf7..52b66cf42 100644 --- a/src/proc/play/dummy-player-service.cpp +++ b/src/proc/play/dummy-player-service.cpp @@ -262,7 +262,7 @@ namespace proc { ProcessImpl* DummyPlayerService::start (LumieraDisplaySlot viewerHandle) { - auto_ptr newProcess (new ProcessImpl); + auto_ptr newProcess (new ProcessImpl (viewerHandle)); REQUIRE (!newProcess->isActive()); newProcess->setRate(25); @@ -282,9 +282,10 @@ namespace proc { /* === Process Implementation === */ - ProcessImpl::ProcessImpl() + ProcessImpl::ProcessImpl(LumieraDisplaySlot viewerHandle) : fps_(0) , play_(false) + , display_(Display::facade().getHandle (viewerHandle)) , imageGen_(0) , tick_(new TickService (bind (&ProcessImpl::doFrame, this))) { } @@ -343,13 +344,10 @@ namespace proc { REQUIRE (isActive()); ASSERT (imageGen_); - /////////////////////////////////////////TODO rewrite impl; now actively pushing up the frame! -/* if (play_) - return imageGen_->next(); + display_(imageGen_->next()); else - return imageGen_->current(); -*/ + display_(imageGen_->current()); } diff --git a/src/proc/play/dummy-player-service.hpp b/src/proc/play/dummy-player-service.hpp index 0a7bce34e..b7d3f5656 100644 --- a/src/proc/play/dummy-player-service.hpp +++ b/src/proc/play/dummy-player-service.hpp @@ -40,6 +40,7 @@ #include "include/dummy-player-facade.h" +#include "include/display-facade.h" #include "common/instancehandle.hpp" #include "lib/singleton-ref.hpp" @@ -53,6 +54,7 @@ namespace proc { using std::string; using lumiera::Subsys; + using lumiera::Display; class DummyImageGenerator; @@ -74,12 +76,13 @@ namespace proc { uint fps_; bool play_; + Display::Sink display_; boost::scoped_ptr imageGen_; boost::scoped_ptr tick_; public: - ProcessImpl() ; + ProcessImpl(LumieraDisplaySlot) ; /* Implementation-level API to be used By DummyPlayerService */