diff --git a/src/common/guifacade.cpp b/src/common/guifacade.cpp index 81b00aa95..b3fd1db30 100644 --- a/src/common/guifacade.cpp +++ b/src/common/guifacade.cpp @@ -93,7 +93,7 @@ namespace gui { bool shouldStart (lumiera::Option& opts) override { - if (opts.isHeadless() || 0 < opts.getPort()) + if (opts.isHeadless() or 0 < opts.getPort()) { INFO (guifacade, "*not* starting the GUI..."); return false; diff --git a/src/common/subsys.hpp b/src/common/subsys.hpp index f7544e066..6b9257532 100644 --- a/src/common/subsys.hpp +++ b/src/common/subsys.hpp @@ -89,7 +89,9 @@ namespace lumiera { /** query application option state to determine - * if this subsystem should be activated. */ + * if this subsystem should be activated. + * @note even if not started explicitly, it could still + * be started as prerequisite of another one */ virtual bool shouldStart (lumiera::Option&) =0; diff --git a/src/proc/facade.cpp b/src/proc/facade.cpp index 03cea95ee..8d690deed 100644 --- a/src/proc/facade.cpp +++ b/src/proc/facade.cpp @@ -23,16 +23,23 @@ #include "proc/facade.hpp" #include "lib/depend.hpp" +//#include "lib/sync.hpp" +#include "proc/control/proc-dispatcher.hpp" #include "proc/play/output-director.hpp" #include +//#include namespace proc { using std::string; + using std::unique_ptr; using lumiera::Subsys; using lumiera::Option; + using lib::Sync; +// using lib::RecursiveLock_NoWait; + using proc::control::ProcDispatcher; class BuilderSubsysDescriptor @@ -71,38 +78,35 @@ namespace proc { - class SessionSubsysDescriptor + class SessionSubsystem : public Subsys { operator string () const { return "Session"; } + /** @remarks there is no need explicitly to start the session core, + * since it will usually be pulled up as prerequisite */ bool shouldStart (Option&) override { - TODO ("determine, if an existing Session should be loaded"); return false; } bool - start (Option&, Subsys::SigTerm termination) override + start (Option&, Subsys::SigTerm termNotification) override { - UNIMPLEMENTED ("load an existing session as denoted by the options and register shutdown hook"); - return false; - //////////////////////////////////////////////////////////TICKET #318 : start Thread and instantiate SessionCommandService + return ProcDispatcher::instance().start (termNotification); } void triggerShutdown () noexcept override { - UNIMPLEMENTED ("initiate closing this Session"); + ProcDispatcher::instance().requestStop(); } bool checkRunningState () noexcept override { - //Lock guard (*this); - TODO ("implement detecting running state"); - return false; + return ProcDispatcher::instance().isRunning(); } }; @@ -153,7 +157,7 @@ namespace proc { namespace { lib::Depend theBuilderDescriptor; - lib::Depend theSessionDescriptor; + lib::Depend theSessionSubsystemLifecycle; lib::Depend thePlayOutDescriptor; } @@ -172,7 +176,7 @@ namespace proc { Subsys& Facade::getSessionDescriptor() { - return theSessionDescriptor(); + return theSessionSubsystemLifecycle(); }