#include "mainwindow.h" #include #include "debug.h" #include "io/config.h" extern "C" { #include #include } int main(int argc, char *argv[]) { QString appName = "Olive (February 2019 | Alpha"; #ifdef GITHASH appName += " | "; appName += GITHASH; #endif appName += ")"; bool launch_fullscreen = false; QString load_proj; bool use_internal_logger = true; if (argc > 1) { for (int i=1;i\tSet an external language file to use\n" "\n" "Environment Variables:\n" "\tOLIVE_EFFECTS_PATH\tSpecify a path to search for GLSL shader effects\n" "\tFREI0R_PATH\t\tSpecify a path to search for Frei0r effects\n" "\tOLIVE_LANG_PATH\t\tSpecify a path to search for translation files\n" "\n", argv[0]); return 0; } else if (!strcmp(argv[i], "--fullscreen") || !strcmp(argv[i], "-f")) { launch_fullscreen = true; } else if (!strcmp(argv[i], "--disable-shaders")) { runtime_config.shaders_are_enabled = false; } else if (!strcmp(argv[i], "--no-debug")) { use_internal_logger = false; } else if (!strcmp(argv[i], "--disable-blend-modes")) { runtime_config.disable_blending = true; } else if (!strcmp(argv[i], "--translation")) { if (i + 1 < argc && argv[i + 1][0] != '-') { // load translation file runtime_config.external_translation_file = argv[i + 1]; i++; } else { printf("[ERROR] No translation file specified\n"); return 1; } } else { printf("[ERROR] Unknown argument '%s'\n", argv[1]); return 1; } } else if (load_proj.isEmpty()) { load_proj = argv[i]; } } } if (use_internal_logger) { qInstallMessageHandler(debug_message_handler); } QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QApplication a(argc, argv); a.setWindowIcon(QIcon(":/icons/olive64.png")); QCoreApplication::setOrganizationDomain("olivevideoeditor.org"); QCoreApplication::setApplicationName("Olive"); MainWindow w(nullptr, appName); w.updateTitle(""); if (!load_proj.isEmpty()) { w.launch_with_project(load_proj); } if (launch_fullscreen) { w.showFullScreen(); } else { w.showMaximized(); } return a.exec(); }