FlightStatuses::FlightStatuses(QObject *parent) : XmlDataSource(parent) { // use http://flydata.avinor.no/flightStatuses.asp?code=A for specific statuses setUrl(QUrl("http://flydata.avinor.no/flightStatuses.asp")); setRefreshRate(86400000); //msecs == 24h QObject::connect(this, SIGNAL(dataUpdated(Node*)), this, SLOT(createMapping(Node*))); }
Rig::Rig(string filename) { m_running = false; setRefreshRate(40); m_updateLoop = nullptr; if (!load(filename)) { Logger::log(WARN, "Proceeding with default rig initialization"); } }
void Options::loadConfig() { m_settings->load(); syncFromKcfgc(); // Electric borders KConfigGroup config(m_settings->config(), "Windows"); OpTitlebarDblClick = windowOperation(config.readEntry("TitlebarDoubleClickCommand", "Maximize"), true); setOperationMaxButtonLeftClick(windowOperation(config.readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true)); setOperationMaxButtonMiddleClick(windowOperation(config.readEntry("MaximizeButtonMiddleClickCommand", "Maximize (vertical only)"), true)); setOperationMaxButtonRightClick(windowOperation(config.readEntry("MaximizeButtonRightClickCommand", "Maximize (horizontal only)"), true)); // Mouse bindings config = KConfigGroup(m_settings->config(), "MouseBindings"); // TODO: add properties for missing options CmdTitlebarWheel = mouseWheelCommand(config.readEntry("CommandTitlebarWheel", "Switch to Window Tab to the Left/Right")); CmdAllModKey = (config.readEntry("CommandAllKey", "Alt") == QStringLiteral("Meta")) ? Qt::Key_Meta : Qt::Key_Alt; CmdAllWheel = mouseWheelCommand(config.readEntry("CommandAllWheel", "Nothing")); setCommandActiveTitlebar1(mouseCommand(config.readEntry("CommandActiveTitlebar1", "Raise"), true)); setCommandActiveTitlebar2(mouseCommand(config.readEntry("CommandActiveTitlebar2", "Start Window Tab Drag"), true)); setCommandActiveTitlebar3(mouseCommand(config.readEntry("CommandActiveTitlebar3", "Operations menu"), true)); setCommandInactiveTitlebar1(mouseCommand(config.readEntry("CommandInactiveTitlebar1", "Activate and raise"), true)); setCommandInactiveTitlebar2(mouseCommand(config.readEntry("CommandInactiveTitlebar2", "Start Window Tab Drag"), true)); setCommandInactiveTitlebar3(mouseCommand(config.readEntry("CommandInactiveTitlebar3", "Operations menu"), true)); setCommandWindow1(mouseCommand(config.readEntry("CommandWindow1", "Activate, raise and pass click"), false)); setCommandWindow2(mouseCommand(config.readEntry("CommandWindow2", "Activate and pass click"), false)); setCommandWindow3(mouseCommand(config.readEntry("CommandWindow3", "Activate and pass click"), false)); setCommandWindowWheel(mouseCommand(config.readEntry("CommandWindowWheel", "Scroll"), false)); setCommandAll1(mouseCommand(config.readEntry("CommandAll1", "Move"), false)); setCommandAll2(mouseCommand(config.readEntry("CommandAll2", "Toggle raise and lower"), false)); setCommandAll3(mouseCommand(config.readEntry("CommandAll3", "Resize"), false)); // TODO: should they be moved into reloadCompositingSettings? config = KConfigGroup(m_settings->config(), "Compositing"); setMaxFpsInterval(1 * 1000 * 1000 * 1000 / config.readEntry("MaxFPS", Options::defaultMaxFps())); setRefreshRate(config.readEntry("RefreshRate", Options::defaultRefreshRate())); setVBlankTime(config.readEntry("VBlankTime", Options::defaultVBlankTime()) * 1000); // config in micro, value in nano resolution // Modifier Only Shortcuts config = KConfigGroup(m_settings->config(), "ModifierOnlyShortcuts"); m_modifierOnlyShortcuts.clear(); if (config.hasKey("Shift")) { m_modifierOnlyShortcuts.insert(Qt::ShiftModifier, config.readEntry("Shift", QStringList())); } if (config.hasKey("Control")) { m_modifierOnlyShortcuts.insert(Qt::ControlModifier, config.readEntry("Control", QStringList())); } if (config.hasKey("Alt")) { m_modifierOnlyShortcuts.insert(Qt::AltModifier, config.readEntry("Alt", QStringList())); } m_modifierOnlyShortcuts.insert(Qt::MetaModifier, config.readEntry("Meta", QStringList{QStringLiteral("org.kde.plasmashell"), QStringLiteral("/PlasmaShell"), QStringLiteral("org.kde.PlasmaShell"), QStringLiteral("activateLauncherMenu")})); }
void window::Window::open(const char *title, int width, int height, bool fullscreen, int msaa_level) { if (_fail) return; if (msaa_level > 0) { glfwWindowHint(GLFW_SAMPLES, msaa_level); _aa = msaa_level; } glfwWindowHint(GLFW_RED_BITS, 8); glfwWindowHint(GLFW_GREEN_BITS, 8); glfwWindowHint(GLFW_BLUE_BITS, 8); glfwWindowHint(GLFW_ALPHA_BITS, 8); glfwWindowHint(GLFW_DEPTH_BITS, 24); glfwWindowHint(GLFW_STENCIL_BITS, 8); glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // opengl 3.3 //glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); //glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); //glfwWindowHint(GLFW_STEREO, GL_TRUE); _primary_monitor = glfwGetPrimaryMonitor(); _glfw_vid_mode = glfwGetVideoMode(_primary_monitor); if (width == 0 && height == 0) { width = _glfw_vid_mode->width; height = _glfw_vid_mode->height; setRefreshRate(_glfw_vid_mode->refreshRate); } if (fullscreen) { _glfw_window = glfwCreateWindow(width, height, title, _primary_monitor, NULL); } else { _glfw_window = glfwCreateWindow(width, height, title, NULL, NULL); } if (!_glfw_window) { log("open(...) failed"); _fail = true; return; } glfwMakeContextCurrent(_glfw_window); _window_width = width; _window_height = height; hideMouseCursor(); setVSync(); }
/** * FUNCTION NAME: scaleDown * * DESCRIPTION: THis function shrinks the FBF and increases the refresh rate */ void FBF::scaleDown() { //trace.funcEntry("FBF::scaleDown"); size_t currentFBFsize = fbf.size(); if ( currentFBFsize > (minimumNumberOfBFs + additiveBloomFilterDecrement) ) { fbfScaleDown(); } numberOfBFs = fbf.size(); pastEnd = numberOfBFs - 1; setRefreshRate(getRefreshRate() + additiveRefreshRateIncrement); //trace.funcExit("FBF::scaleDown"); }
/** * FUNCTION NAME: scaleUp * * DESCRIPTION: This function expands the FBF and decreases the refresh rate */ void FBF::scaleUp() { //trace.funcEntry("FBF::scaleUp"); fbfScaleUp(); numberOfBFs = fbf.size(); pastEnd = numberOfBFs - 1; if ( getRefreshRate() > minRefreshRate ) { setRefreshRate(getRefreshRate() - additiveRefreshRateDecrement); } cout<<endl<<"new rr: "<<getRefreshRate()<<endl; cout<<endl<<"scale up"<<endl; //trace.funcExit("FBF::scaleUp"); }
void Rig::loadJSON(JSONNode root) { //JSONNode::const_iterator i = root.begin(); JSONNode::iterator i = root.begin(); auto version = root.find("version"); if (version == root.end()) { Logger::log(ERR, "No version specified for input file. Aborting load."); return; } else { stringstream ss; stringstream ss2(version->as_string()); ss << LumiverseCore_VERSION_MAJOR << "." << LumiverseCore_VERSION_MINOR; float libVer; float fileVer; ss >> libVer; ss2 >> fileVer; if (fileVer < libVer) { // Friendly warning if you're loading an old file. Logger::log(WARN, "File created against earlier version of Lumiverse. Check logs for any load problems."); } else if (fileVer > libVer) { // Loading newer file with older library. Logger::log(WARN, "File created against newer version of Lumiverse. Check logs for any load problems."); } } while (i != root.end()){ // get the node name and value as a string std::string nodeName = i->name(); if (nodeName == "devices") { loadDevices(*i); Logger::log(INFO, "Device load complete"); } else if (nodeName == "patches") { i->push_back(*root.find("jsonPath")); loadPatches(*i); Logger::log(INFO, "Patch load complete"); } else if (nodeName == "refreshRate") { setRefreshRate(i->as_int()); } //increment the iterator ++i; } }
// ---------------------------------------------------------------------- // load start up screen void loadStartUpScreen( unsigned short* frameBuffer, unsigned char* playerCount ) { // reset values StartUpScreen.toggle = 0; // set refresh rate setRefreshRate( 50 ); // prepare screen cls(); send(); }
Rig::Rig() { m_running = false; setRefreshRate(40); m_updateLoop = nullptr; }