MCPcopy Create free account
hub / github.com/VCVRack/Befaco / handlePanelActions

Method handlePanelActions

src/Random8.cpp:296–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294 }
295
296 void handlePanelActions(const Random8Panel::Output &panelOutput) {
297 for (int actionIndex = 0; actionIndex < panelOutput.actionCount; actionIndex++) {
298 const Random8Panel::Action &action = panelOutput.actions[actionIndex];
299 switch (action.type) {
300 case Random8Panel::ACTION_SET_LOOP_MODE:
301 if (action.index >= 0 && action.index < NUM_CHANNELS) {
302 loopModes[action.index] = action.value;
303 }
304 break;
305 case Random8Panel::ACTION_LOAD_PRESET:
306 if (action.index >= 0 && action.index < NUM_CHANNELS) {
307 loadPresetSlot(action.index);
308 }
309 break;
310 case Random8Panel::ACTION_SAVE_PRESET:
311 if (action.index >= 0 && action.index < NUM_CHANNELS) {
312 savePresetSlot(action.index);
313 }
314 break;
315 case Random8Panel::ACTION_RESET_CHANNEL_MASK:
316 for (int channel = 0; channel < NUM_CHANNELS; channel++) {
317 if (action.mask & (1 << channel)) {
318 resetChannelToDefaults(channel);
319 }
320 }
321 break;
322 case Random8Panel::ACTION_RESET_ALL_CHANNELS:
323 for (int channel = 0; channel < NUM_CHANNELS; channel++) {
324 resetChannelToDefaults(channel);
325 }
326 break;
327 case Random8Panel::ACTION_NONE: break;
328 }
329 }
330 }
331
332 void applyPanelOutput(const Random8Panel::Output &panelOutput) {
333 inMenu = panelOutput.inMenu;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected