add the impl. of the periodic playback function, now pushing output up to GUI

This commit is contained in:
Fischlurch 2009-02-08 02:00:55 +01:00
parent 4524c23832
commit 32c2c85abc
4 changed files with 15 additions and 13 deletions

View file

@ -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_;

View file

@ -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:

View file

@ -262,7 +262,7 @@ namespace proc {
ProcessImpl*
DummyPlayerService::start (LumieraDisplaySlot viewerHandle)
{
auto_ptr<ProcessImpl> newProcess (new ProcessImpl);
auto_ptr<ProcessImpl> 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());
}

View file

@ -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<DummyImageGenerator> imageGen_;
boost::scoped_ptr<TickService> tick_;
public:
ProcessImpl() ;
ProcessImpl(LumieraDisplaySlot) ;
/* Implementation-level API to be used By DummyPlayerService */