add implementation of PlayProcess logic

This commit is contained in:
Fischlurch 2009-01-22 23:16:46 +01:00
parent 3dae60f559
commit 7150ab9ee9
3 changed files with 41 additions and 5 deletions

View file

@ -163,6 +163,11 @@ namespace lumiera {
//----Proxy-Implementation-of-DummyPlayer--------
typedef proc::DummyPlayer::Process Process;
/** @note as an optimisation we hand out a direct reference
* to the implementing process object. While this ref could
* still be passed as handle to the C Language interface, using
* it directly within the client (=GUI) retains only on level
* of indirection, irrespective which interface is used. */
Process& start()
{
Process* pP = static_cast<Process*> (_i_.startPlay());

View file

@ -247,7 +247,7 @@ namespace proc {
, implInstance_(this,_instance)
, serviceInstance_( LUMIERA_INTERFACE_REF (lumieraorg_DummyPlayer, 0, lumieraorg_DummyPlayerFacade))
{
INFO (operate, "GuiNotification Facade opened.");
INFO (operate, "DummyPlayer Facade opened.");
}
@ -260,7 +260,8 @@ namespace proc {
return theDescriptor();
}
DummyPlayer::~DummyPlayer() { } ///< emit the vtable here into this translation unit within liblumieraproc.so ...
// emit the vtable here into this translation unit within liblumieraproc.so ...
DummyPlayer::~DummyPlayer() { }
DummyPlayer::Process::~Process() { }
@ -268,7 +269,22 @@ namespace proc {
DummyPlayer::Process&
DummyPlayerService::start()
{
UNIMPLEMENTED ("initiate a new playback process");
REQUIRE (!theProcess_.isActive());
theProcess_.setRate(25);
return theProcess_;
}
void
ProcessImpl::setRate (uint fps)
{
REQUIRE (fps==0 || fps_==0 );
REQUIRE (fps==0 || !play_ );
fps_ = fps;
play_ = (fps != 0);
}
@ -276,7 +292,8 @@ namespace proc {
void
ProcessImpl::pause(bool doPlay)
{
UNIMPLEMENTED ("pause playback");
REQUIRE (isActive());
play_ = doPlay;
}
@ -284,6 +301,8 @@ namespace proc {
void* const
ProcessImpl::getFrame()
{
REQUIRE (isActive());
UNIMPLEMENTED ("actually deliver a frame");
}

View file

@ -59,8 +59,20 @@ namespace proc {
void pause(bool doPlay);
void* const getFrame();
uint fps_;
bool play_;
public:
ProcessImpl() {}
ProcessImpl() : fps_(0), play_(false) {}
/* Implementation-level API to be used By DummyPlayerService */
/** activate a playback process
* with given specification */
void setRate (uint fps);
bool isActive () { return fps_ != 0; }
bool isPlaying() { return play_; }
};