/** * THE entry point for the application * * @param argc Number of arguments in array argv * @param argv Arguments array */ int main(int argc, char** argv) { /* Create the Qt core application object */ QApplication qapp(argc, argv); /* At least MIDI plugin requires this so best to declare it here for everyone */ qRegisterMetaType<QVariant>("QVariant"); #if defined(__APPLE__) || defined(Q_OS_MAC) /* Load plugins from within the bundle ONLY */ QDir dir(QApplication::applicationDirPath()); dir.cdUp(); dir.cd("plugins"); QApplication::setLibraryPaths(QStringList(dir.absolutePath())); #endif QLCi18n::init(); /* Let the world know... */ printVersion(); /* Parse command-line arguments */ if (parseArgs() == false) return 0; /* Load translation for main application */ QLCi18n::loadTranslation("qlcplus"); /* Handle debug messages */ #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) qInstallMsgHandler(qlcMessageHandler); #else qInstallMessageHandler(qlcMessageHandler); #endif /* Create and initialize the QLC application object */ App app; if (QLCArgs::enableOverscan == true) app.enableOverscan(); if (QLCArgs::noGui == true) app.disableGUI(); app.startup(); app.show(); if (QLCArgs::workspace.isEmpty() == false) { if (app.loadXML(QLCArgs::workspace) == QFile::NoError) app.updateFileOpenMenu(QLCArgs::workspace); } if (QLCArgs::operate == true) app.slotModeOperate(); if (QLCArgs::kioskMode == true) app.enableKioskMode(); if (QLCArgs::fullScreen == true) app.slotControlFullScreen(QLCArgs::fullScreenResize); if (QLCArgs::kioskMode == true && QLCArgs::closeButtonRect.isValid() == true) app.createKioskCloseButton(QLCArgs::closeButtonRect); if (QLCArgs::enableWebAccess == true) { WebAccess *webAccess = new WebAccess(app.doc(), VirtualConsole::instance(), SimpleDesk::instance()); QObject::connect(webAccess, SIGNAL(toggleDocMode()), &app, SLOT(slotModeToggle())); QObject::connect(webAccess, SIGNAL(loadProject(QString)), &app, SLOT(slotLoadDocFromMemory(QString))); QObject::connect(webAccess, SIGNAL(storeAutostartProject(QString)), &app, SLOT(slotSaveAutostart(QString))); } return qapp.exec(); }