defuze.me  Client
main.cpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 #include "cores.hpp"
00012 #include "starter.hpp"
00013 #include "audiocore.hpp"
00014 #include "audiodecoder.hpp"
00015 #include "defuzemeapplication.hpp"
00016 #include <QtGui/QApplication>
00017 #include <QTranslator>
00018 
00019 int main(int argc, char *argv[])
00020 {
00021     DefuzemeApplication app(argc, argv);
00022 
00023     QTranslator translator;
00024     translator.load("defuzeme_" + QLocale::system().name(), "translations");
00025     app.installTranslator(&translator);
00026 
00027     Starter *starter = new Starter();
00028 
00029     Cores *cores = starter->loadCores();
00030     Plugins *plugins = starter->loadPlugins();
00031     delete starter;
00032 
00033     if (!cores || !plugins)
00034         return 1;
00035 
00036     QObject::connect(&app, SIGNAL(aboutToQuit()), plugins, SLOT(aboutToQuit()));
00037     QObject::connect(&app, SIGNAL(aboutToQuit()), cores, SLOT(aboutToQuit()));
00038 
00039     int out = app.exec();
00040     return out;
00041 }