MCPcopy Create free account
hub / github.com/VCVRack/Rack / step

Method step

src/app/Scene.cpp:91–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90
91void Scene::step() {
92 if (APP->window->isFullScreen()) {
93 // Expand RackScrollWidget to cover entire screen if fullscreen
94 rackScroll->box.pos.y = 0;
95 }
96 else {
97 // Always show MenuBar if not fullscreen
98 menuBar->show();
99 rackScroll->box.pos.y = menuBar->box.size.y;
100 }
101
102 internal->resizeHandle->box.pos = box.size.minus(internal->resizeHandle->box.size);
103
104 // Resize owned descendants
105 menuBar->box.size.x = box.size.x;
106 rackScroll->box.size = box.size.minus(rackScroll->box.pos);
107
108 // Autosave periodically
109 if (settings::autosaveInterval > 0.0) {
110 double time = system::getTime();
111 if (time - internal->lastAutosaveTime >= settings::autosaveInterval) {
112 internal->lastAutosaveTime = time;
113 APP->patch->saveAutosave();
114 settings::save();
115 }
116 }
117
118 // Scroll RackScrollWidget with arrow keys
119 math::Vec arrowDelta;
120 if (internal->heldArrowKeys[0]) {
121 arrowDelta.x -= 1;
122 }
123 if (internal->heldArrowKeys[1]) {
124 arrowDelta.x += 1;
125 }
126 if (internal->heldArrowKeys[2]) {
127 arrowDelta.y -= 1;
128 }
129 if (internal->heldArrowKeys[3]) {
130 arrowDelta.y += 1;
131 }
132
133 if (!arrowDelta.isZero()) {
134 int mods = APP->window->getMods();
135 float arrowSpeed = 32.f;
136 if ((mods & RACK_MOD_MASK) == RACK_MOD_CTRL)
137 arrowSpeed /= 4.f;
138 if ((mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT)
139 arrowSpeed *= 4.f;
140 if ((mods & RACK_MOD_MASK) == (RACK_MOD_CTRL | GLFW_MOD_SHIFT))
141 arrowSpeed /= 16.f;
142
143 rackScroll->offset += arrowDelta * arrowSpeed;
144 }
145
146 Widget::step();
147}
148

Callers

nothing calls this directly

Calls 9

getTimeFunction · 0.85
saveFunction · 0.85
stepFunction · 0.85
isFullScreenMethod · 0.80
showMethod · 0.80
minusMethod · 0.80
saveAutosaveMethod · 0.80
isZeroMethod · 0.80
getModsMethod · 0.80

Tested by

no test coverage detected