From 3d21a2a7b25a110fcff58c3b3d38ff0d8cbb61d6 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 24 Sep 2019 22:19:49 -0400 Subject: [PATCH] Add key command for engine CPU timer. --- CHANGELOG.md | 1 + src/app/MenuBar.cpp | 3 ++- src/app/Scene.cpp | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d56335db..e4b12e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ In this document, Mod is Ctrl on Windows/Linux and Cmd on Mac. - Automatically unzip update on Mac. - Stop worker threads when engine is paused to save CPU. - Hide menu and scrollbars when fullscreen. +- Add key command (F3) for engine CPU meter. - Core - Fix sustain pedal release bug when using polyphonic mode in MIDI-CV. - API diff --git a/src/app/MenuBar.cpp b/src/app/MenuBar.cpp index a2bb9500..5b7292cb 100644 --- a/src/app/MenuBar.cpp +++ b/src/app/MenuBar.cpp @@ -477,7 +477,8 @@ struct EngineButton : MenuButton { CpuMeterItem* cpuMeterItem = new CpuMeterItem; cpuMeterItem->text = "CPU meter"; - cpuMeterItem->rightText = CHECKMARK(settings::cpuMeter); + cpuMeterItem->rightText = "F3 "; + cpuMeterItem->rightText += CHECKMARK(settings::cpuMeter); menu->addChild(cpuMeterItem); SampleRateItem* sampleRateItem = new SampleRateItem; diff --git a/src/app/Scene.cpp b/src/app/Scene.cpp index a6021074..9cb699b4 100644 --- a/src/app/Scene.cpp +++ b/src/app/Scene.cpp @@ -148,6 +148,12 @@ void Scene::onHoverKey(const event::HoverKey& e) { e.consume(this); } } break; + case GLFW_KEY_F3: { + if ((e.mods & RACK_MOD_MASK) == 0) { + settings::cpuMeter ^= true; + e.consume(this); + } + } break; case GLFW_KEY_F11: { if ((e.mods & RACK_MOD_MASK) == 0) { APP->window->setFullScreen(!APP->window->isFullScreen());