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
2011-02-05 20:56:51 +01:00
2007 , 2011 , Joel Holdsworth < joel @ airwebreathe . org . uk >
2008-11-26 05:19:59 +01:00
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
2010-12-17 23:28:49 +01:00
published by the Free Software Foundation ; either version 2 of
the License , or ( at your option ) any later version .
2007-07-03 00:13:12 +02:00
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 0213 9 , USA .
*/
2009-01-25 00:24:42 +01:00
# include "include/logging.h"
2008-12-27 00:53:35 +01:00
# include "lib/error.hpp"
2008-12-18 08:12:40 +01:00
# include "common/appstate.hpp"
# include "common/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"
2009-01-23 20:23:24 +01:00
# include "include/dummy-player-facade.h"
2008-12-01 08:04:43 +01:00
# include "proc/facade.hpp"
# include "gui/guifacade.hpp"
2011-02-05 23:53:37 +01:00
using lib : : Cmdline ;
2008-12-01 01:04:09 +01:00
using lumiera : : Subsys ;
2008-11-30 06:43:51 +01:00
using lumiera : : AppState ;
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 ( ) ;
2011-05-24 03:48:49 +02:00
Subsys & player = lumiera : : DummyPlayer : : getDescriptor ( ) ; ///////TODO: just a dummy, until we're able to render
2008-12-01 08:04:43 +01:00
Subsys & session = proc : : Facade : : getSessionDescriptor ( ) ;
2011-05-24 03:48:49 +02:00
Subsys & playOut = proc : : Facade : : getPlayOutDescriptor ( ) ;
2008-12-01 08:04:43 +01:00
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
{
2009-01-24 03:15:26 +01:00
NOTICE ( main , " *** 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
netNode . depends ( session ) ;
netNode . depends ( engine ) ;
2011-08-24 01:26:36 +02:00
// playOut.depends (engine);
// playOut.depends (session);
2016-12-12 03:45:21 +01:00
// lumigui.depends (session); ////////////////////////////////////////////TICKET #318 : need to activate this again, after implementing minimal Session subsystem
2008-12-08 03:01:02 +01:00
// lumigui.depends (engine);
2011-05-24 03:48:49 +02:00
player . depends ( playOut ) ; //////TODO dummy player, until we're able to render
2009-01-23 20:23:24 +01:00
lumigui . depends ( player ) ;
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 ) ;
2011-05-24 03:48:49 +02:00
application . maybeStart ( playOut ) ;
2008-12-01 01:04:09 +01:00
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
}