50 using std::unique_ptr;
68 operator string ()
const {
return "Dummy-Player"; }
82 thePlayer_.createInstance (terminationHandle);
89 thePlayer_.shutdown();
97 return bool(thePlayer_);
110 ,lumieraorg_DummyPlayerFacade_descriptor
112 , LUMIERA_INTERFACE_INLINE (
name,
113 const char*, (LumieraInterface ifa),
114 { (void)ifa;
return "DummyPlayer"; }
116 , LUMIERA_INTERFACE_INLINE (brief,
117 const char*, (LumieraInterface ifa),
118 { (void)ifa;
return "Steam Interface: dummy player to test integration with the GUI"; }
120 , LUMIERA_INTERFACE_INLINE (homepage,
121 const char*, (LumieraInterface ifa),
122 { (void)ifa;
return "http://www.lumiera.org/develompent.html" ;}
124 , LUMIERA_INTERFACE_INLINE (version,
125 const char*, (LumieraInterface ifa),
126 { (void)ifa;
return "0.1~pre"; }
128 , LUMIERA_INTERFACE_INLINE (author,
129 const char*, (LumieraInterface ifa),
130 { (void)ifa;
return "Hermann Vosseler"; }
132 , LUMIERA_INTERFACE_INLINE (email,
133 const char*, (LumieraInterface ifa),
134 { (void)ifa;
return "Ichthyostega@web.de"; }
136 , LUMIERA_INTERFACE_INLINE (copyright,
137 const char*, (LumieraInterface ifa),
141 "Copyright (C) Lumiera.org\n" 142 " 2009 Hermann Vosseler <Ichthyostega@web.de>";
145 , LUMIERA_INTERFACE_INLINE (license,
146 const char*, (LumieraInterface ifa),
150 "This program is free software; you can redistribute it and/or modify\n" 151 "it under the terms of the GNU General Public License as published by\n" 152 "the Free Software Foundation; either version 2 of the License, or\n" 153 "(at your option) any later version.\n" 155 "This program is distributed in the hope that it will be useful,\n" 156 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" 157 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" 158 "GNU General Public License for more details.\n" 160 "You should have received a copy of the GNU General Public License\n" 161 "along with this program; if not, write to the Free Software\n" 162 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA";
165 , LUMIERA_INTERFACE_INLINE (state,
166 int, (LumieraInterface ifa),
169 , LUMIERA_INTERFACE_INLINE (versioncmp,
170 int, (
const char* a,
const char* b),
171 {(void)a;(void)b;
return 0;}
179 using LERR_(LIFECYCLE);
186 ,lumieraorg_DummyPlayerService
190 , LUMIERA_INTERFACE_INLINE (startPlay,
191 LumieraPlayProcess, (LumieraDisplaySlot viewerHandle),
199 return static_cast<LumieraPlayProcess
> (
_instance().start(viewerHandle));
202 , LUMIERA_INTERFACE_INLINE (togglePlay,
203 void, (LumieraPlayProcess handle,
bool doPlay),
212 ProcP proc =
static_cast<ProcP
> (handle);
217 , LUMIERA_INTERFACE_INLINE (terminate,
218 void, (LumieraPlayProcess handle),
227 ProcP proc =
static_cast<ProcP
> (handle);
242 DummyPlayerService::DummyPlayerService (Subsys::SigTerm terminationHandle)
244 , notifyTermination_(terminationHandle)
245 , serviceInstance_(
LUMIERA_INTERFACE_REF (lumieraorg_DummyPlayer, 0, lumieraorg_DummyPlayerService))
247 INFO (progress,
"DummyPlayer Facade opened.");
266 unique_ptr<ProcessImpl> newProcess (
new ProcessImpl (viewerHandle));
268 REQUIRE (!newProcess->isActive());
269 newProcess->setRate(25);
271 return newProcess.release();
282 ProcessImpl::ProcessImpl(LumieraDisplaySlot viewerHandle)
291 ProcessImpl::~ProcessImpl()
293 INFO (proc_dbg,
"Playback process halted...");
318 handle.
activate(implementationLink, &terminate);
327 REQUIRE (fps==0 || fps_==0 );
328 REQUIRE (fps==0 || !play_ );
338 tick_->activate(fps);
346 REQUIRE (isActive());
347 tick_->activate (yes? fps_:0);
356 REQUIRE (isActive());
360 display_(imageGen_->next());
362 display_(imageGen_->current());
381 return steam::play::theDummyPlayerDescriptor();
Dependencies and lifecycle of a partially independent Subsystem of the Application.
DummyPlayer::Process createHandle()
activate a forwarding smart-Handle to be used by client code for communication with the play process ...
static lib::Depend< Display > facade
get an implementation instance of this service
Playback process, front-end to be used by client code.
void doPlay(bool yes)
forward the play/pause toggle to the play process implementation
lib::Depend< DummyPlayerService > _instance
a backdoor for the C Language impl to access the actual SessionCommand implementation...
Configuration handle to expose a service implementation through the Depend<SRV> front-end.
Generator for test dummy video frames to simulate playback of rendered output.
ProcessImpl * start(LumieraDisplaySlot viewerHandle)
conceptually, this serves as implementation of the DummyPlayer::start() function. ...
Per type specific configuration of instances created as service dependencies.
A public service provided by the Steam-Layer, implementing a dummy/mockup playback process...
bool checkRunningState() noexcept override
whether this subsystem is actually operational.
Frontend for handling the Lumiera application commandline arguments.
static lumiera::Subsys & getDescriptor()
provide a descriptor for lumiera::AppState, wired accordingly to allow main to deal with the dummy pl...
Mediator to allow the client to communicate with the Process implementation via the Process handle...
Steam-Layer implementation namespace root.
Access point to singletons and other kinds of dependencies designated by type.
Not finished development code.
bool start(lumiera::Option &, Subsys::SigTerm terminationHandle) override
attempt to bring up this subsystem up.
#define LUMIERA_INTERFACE_INSTANCE(iname, version, name, descriptor, acquire, release,...)
Define an interface instance.
bool shouldStart(lumiera::Option &) override
query application option state to determine if this subsystem should be activated.
#define LUMIERA_INTERFACE_REF(iname, version, dname)
Return a reference (pointer) to an interface implementation.
void setRate(uint fps)
activate a playback process with given specification
void triggerShutdown() noexcept override
initiate termination of this subsystem.
void doFrame()
periodically invoked while playing
details of how the DummyPlayer service can be started and used as independent "subsystem" within main...
static void terminate(DummyPlayer::ProcessImplementationLink *)
deleter function for lib::Handle
Tick generating service for a periodic callback, with adjustable frequency.
Actual implementation of a single (dummy) playback process.
Singleton services and Dependency Injection.
lumiera_err lumiera_error_set(lumiera_err nerr, const char *extra)
Set error state for the current thread.
Handle & activate(IMP *impl, DEL whenDead)
Activation of the handle by the managing service.
A data record to describe interface, interface instances and plug-in instances.
Lumiera public interface.
A timer service invoking a given callback periodically.