2007-07-03 00:13:12 +02:00
|
|
|
/*
|
2008-03-10 04:25:03 +01:00
|
|
|
main.cpp - start the Lumiera Application
|
2007-07-03 00:13:12 +02:00
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
2008-11-26 05:19:59 +01:00
|
|
|
2007-2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
|
|
|
|
Christian Thaeter <ct@pipapo.org>
|
2007-07-03 00:13:12 +02:00
|
|
|
Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2008-11-30 21:00:20 +01:00
|
|
|
#include "include/nobugcfg.h"
|
|
|
|
|
#include "include/error.hpp"
|
|
|
|
|
#include "lumiera/appstate.hpp"
|
|
|
|
|
#include "lumiera/option.hpp"
|
2007-08-09 18:51:47 +02:00
|
|
|
|
2008-12-01 08:04:43 +01:00
|
|
|
#include "backend/enginefacade.hpp"
|
|
|
|
|
#include "backend/netnodefacade.hpp"
|
|
|
|
|
#include "backend/scriptrunnerfacade.hpp"
|
|
|
|
|
#include "proc/facade.hpp"
|
|
|
|
|
#include "gui/guifacade.hpp"
|
|
|
|
|
|
2008-12-01 01:04:09 +01:00
|
|
|
using util::Cmdline;
|
|
|
|
|
using lumiera::Subsys;
|
2008-11-30 06:43:51 +01:00
|
|
|
using lumiera::AppState;
|
2008-04-14 05:15:16 +02:00
|
|
|
using lumiera::ON_GLOBAL_INIT;
|
2008-12-01 01:04:09 +01:00
|
|
|
|
|
|
|
|
namespace {
|
2008-12-01 08:04:43 +01:00
|
|
|
Subsys& engine = backend::EngineFacade::getDescriptor();
|
|
|
|
|
Subsys& netNode = backend::NetNodeFacade::getDescriptor();
|
|
|
|
|
Subsys& script = backend::ScriptRunnerFacade::getDescriptor();
|
|
|
|
|
Subsys& builder = proc::Facade::getBuilderDescriptor();
|
|
|
|
|
Subsys& session = proc::Facade::getSessionDescriptor();
|
|
|
|
|
Subsys& lumigui = gui::GuiFacade::getDescriptor();
|
2008-12-01 01:04:09 +01:00
|
|
|
}
|
|
|
|
|
|
2007-08-17 00:36:07 +02:00
|
|
|
|
2007-07-03 00:13:12 +02:00
|
|
|
|
2008-11-30 21:00:20 +01:00
|
|
|
int
|
2008-12-01 01:04:09 +01:00
|
|
|
main (int argc, const char* argv[])
|
2007-08-26 19:14:39 +02:00
|
|
|
{
|
2008-11-30 21:00:20 +01:00
|
|
|
NOTICE (lumiera, "*** Lumiera NLE for Linux ***");
|
2008-04-14 05:15:16 +02:00
|
|
|
|
2008-11-30 21:00:20 +01:00
|
|
|
AppState& application = AppState::instance();
|
|
|
|
|
try
|
|
|
|
|
{
|
2008-12-02 04:53:30 +01:00
|
|
|
Cmdline args (argc,argv);
|
|
|
|
|
lumiera::Option options (args);
|
|
|
|
|
application.init (options);
|
2008-11-30 21:00:20 +01:00
|
|
|
|
2008-12-01 01:04:09 +01:00
|
|
|
session.depends (builder);
|
|
|
|
|
netNode.depends (session);
|
|
|
|
|
netNode.depends (engine);
|
2008-12-08 03:01:02 +01:00
|
|
|
// lumigui.depends (session); //////TODO commented out in order to be able to start up a dummy GuiStarterPlugin
|
|
|
|
|
// lumigui.depends (engine);
|
2008-12-01 01:04:09 +01:00
|
|
|
script.depends (session);
|
|
|
|
|
script.depends (engine);
|
2008-11-30 21:00:20 +01:00
|
|
|
|
2008-12-01 01:04:09 +01:00
|
|
|
application.maybeStart (session);
|
|
|
|
|
application.maybeStart (netNode);
|
|
|
|
|
application.maybeStart (lumigui);
|
|
|
|
|
application.maybeStart (script);
|
2008-11-30 21:00:20 +01:00
|
|
|
|
2008-12-01 05:35:19 +01:00
|
|
|
return application.maybeWait();
|
2008-11-30 21:00:20 +01:00
|
|
|
}
|
|
|
|
|
|
2008-12-01 01:04:09 +01:00
|
|
|
|
2008-11-30 21:00:20 +01:00
|
|
|
catch (lumiera::Error& problem)
|
|
|
|
|
{
|
2008-12-03 07:43:45 +01:00
|
|
|
return application.abort (problem);
|
2008-11-30 21:00:20 +01:00
|
|
|
}
|
|
|
|
|
catch (...)
|
|
|
|
|
{
|
2008-12-03 07:43:45 +01:00
|
|
|
return application.abort();
|
2008-11-30 21:00:20 +01:00
|
|
|
}
|
2007-08-26 19:14:39 +02:00
|
|
|
}
|