50class AutomationView final :
public ClipView,
public InstrumentClipMinder {
53 bool opened()
override;
54 void initializeView();
55 void openedInBackground();
56 void focusRegained()
override;
59 void graphicsRoutine()
override;
62 UIType getUIType()
override {
return UIType::AUTOMATION; }
63 AutomationSubType getAutomationSubType();
67 bool renderMainPads(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth],
68 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth],
bool drawUndefinedArea =
true)
override;
69 bool renderSidebar(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth],
70 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth])
override;
71 void renderDisplay(int32_t knobPosLeft = kNoSelection, int32_t knobPosRight = kNoSelection,
72 bool modEncoderAction =
false);
73 void displayAutomation(
bool padSelected =
false,
bool updateDisplay =
true);
76 InstrumentClipMinder::renderOLED(canvas);
80 ActionResult buttonAction(deluge::hid::Button b,
bool on,
bool inCardRoutine)
override;
83 ActionResult padAction(int32_t x, int32_t y, int32_t velocity)
override;
86 ActionResult horizontalEncoderAction(int32_t offset)
override;
87 uint32_t getMaxLength()
override;
88 uint32_t getMaxZoom()
override;
89 [[nodiscard]] int32_t getNavSysId()
const override;
93 ActionResult verticalEncoderAction(int32_t offset,
bool inCardRoutine)
override;
94 ActionResult scrollVertical(int32_t scrollAmount);
98 void modEncoderAction(int32_t whichModEncoder, int32_t offset)
override;
99 void modEncoderButtonAction(uint8_t whichModEncoder,
bool on)
override;
103 void selectEncoderAction(int8_t offset)
override;
104 void getLastSelectedParamShortcut(
Clip* clip);
105 void getLastSelectedParamArrayPosition(
Clip* clip);
106 bool multiPadPressSelected;
112 void notifyPlaybackBegun()
override;
116 return getAutomationSubType() == AutomationSubType::ARRANGER ? nullptr :
this;
119 void setAutomationParamType();
121 bool onAutomationOverview();
122 bool inAutomationEditor();
126 bool interpolationBefore;
127 bool interpolationAfter;
136 void initParameterSelection(
bool updateDisplay =
true);
140 void blinkInterpolationShortcut();
141 void blinkPadSelectionShortcut();
148 int32_t knobPosRight);
149 void resetInterpolationShortcutBlinking();
150 void resetPadSelectionShortcutBlinking();
151 AutomationParamType automationParamType;
152 bool getAffectEntire()
override;
155 void resetShortcutBlinking();
159 void handleSessionButtonAction(
Clip* clip,
bool on);
160 void handleKeyboardButtonAction(
bool on);
161 void handleClipButtonAction(
bool on,
bool isAudioClip);
162 void handleCrossScreenButtonAction(
bool on);
163 void handleKitButtonAction(OutputType outputType,
bool on);
164 void handleSynthButtonAction(OutputType outputType,
bool on);
165 void handleMidiButtonAction(OutputType outputType,
bool on);
166 void handleCVButtonAction(OutputType outputType,
bool on);
167 bool handleHorizontalEncoderButtonAction(
bool on,
bool isAudioClip);
168 bool handleBackAndHorizontalEncoderButtonComboAction(
Clip* clip,
bool on);
169 void handleVerticalEncoderButtonAction(
bool on);
170 void handleSelectEncoderButtonAction(
bool on);
171 void handleAffectEntireButtonAction(
bool on);
176 Output* output, OutputType outputType, int32_t effectiveLength, int32_t x,
177 int32_t y, int32_t velocity,
SquareInfo& squareInfo);
179 OutputType outputType, int32_t effectiveLength, int32_t x, int32_t y, int32_t velocity,
180 int32_t xScroll, int32_t xZoom,
SquareInfo& squareInfo);
184 int32_t xScroll, int32_t xZoom);
185 void handleParameterSelection(
Clip* clip,
Output* output, OutputType outputType, int32_t xDisplay,
188 int32_t x, int32_t y, int32_t velocity, int32_t effectiveLength,
SquareInfo& squareInfo);
190 int32_t y, int32_t velocity,
SquareInfo& squareInfo);
192 int32_t x, int32_t y, int32_t velocity, int32_t effectiveLength,
SquareInfo& squareInfo);
193 int32_t getVelocityFromY(int32_t y);
194 int32_t getYFromVelocity(int32_t velocity);
195 void addNoteWithNewVelocity(int32_t x, int32_t velocity, int32_t newVelocity);
197 int32_t newVelocity, uint8_t squareType);
200 SquareInfo rowSquareInfo[kDisplayWidth], int32_t velocityIncrement);
201 void recordNoteEditPadAction(int32_t x, int32_t velocity);
203 int32_t yDisplay, int32_t velocity, int32_t effectiveLength, int32_t xScroll,
205 bool recordAutomationSinglePadPress(int32_t xDisplay, int32_t yDisplay);
213 ActionResult handleAuditionPadAction(
InstrumentClip* instrumentClip,
Output* output, OutputType outputType,
214 int32_t y, int32_t velocity);
215 void auditionPadAction(int32_t velocity, int32_t yDisplay,
bool shiftButtonDown);
218 void performActualRender(
RGB image[][kDisplayWidth + kSideBarWidth],
219 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xScroll, uint32_t xZoom,
220 int32_t renderWidth, int32_t imageWidth,
bool drawUndefinedArea =
true);
223 OutputType outputType,
RGB image[][kDisplayWidth + kSideBarWidth],
224 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay,
227 RGB image[][kDisplayWidth + kSideBarWidth],
228 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t renderWidth,
229 int32_t xScroll, uint32_t xZoom, int32_t effectiveLength, int32_t xDisplay,
232 RGB image[][kDisplayWidth + kSideBarWidth],
233 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t lengthToDisplay,
234 int32_t xDisplay,
bool isAutomated, int32_t xScroll, int32_t xZoom,
237 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay,
241 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay,
242 int32_t yDisplay,
bool isAutomated, int32_t knobPos);
244 RGB image[][kDisplayWidth + kSideBarWidth],
245 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t renderWidth, int32_t xScroll,
246 uint32_t xZoom, int32_t effectiveLength, int32_t xDisplay,
bool drawUndefinedArea,
249 RGB image[][kDisplayWidth + kSideBarWidth],
250 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t xScroll,
253 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t yDisplay,
254 uint8_t squareType, int32_t value);
255 void renderUndefinedArea(int32_t xScroll, uint32_t xZoom, int32_t lengthToDisplay,
256 RGB image[][kDisplayWidth + kSideBarWidth],
257 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t imageWidth,
258 TimelineView* timelineView,
bool tripletsOnHere, int32_t xDisplay);
259 void renderDisplayOLED(
Clip* clip,
Output* output, OutputType outputType, int32_t knobPosLeft = kNoSelection,
260 int32_t knobPosRight = kNoSelection);
262 OutputType outputType);
264 OutputType outputType, int32_t knobPosLeft, int32_t knobPosRight);
266 OutputType outputType, int32_t knobPosLeft, int32_t knobPosRight);
267 void renderDisplay7SEG(
Clip* clip,
Output* output, OutputType outputType, int32_t knobPosLeft = kNoSelection,
268 bool modEncoderAction =
false);
269 void renderAutomationOverviewDisplay7SEG(
Output* output, OutputType outputType);
270 void renderAutomationEditorDisplay7SEG(
Clip* clip, OutputType outputType, int32_t knobPosLeft,
271 bool modEncoderAction);
272 void renderNoteEditorDisplay7SEG(
InstrumentClip* clip, OutputType outputType, int32_t knobPosLeft);
276 int32_t effectiveLength);
279 bool automationModEncoderActionForSelectedPad(
ModelStackWithAutoParam* modelStackWithParam, int32_t whichModEncoder,
280 int32_t offset, int32_t effectiveLength);
282 int32_t whichModEncoder, int32_t offset, int32_t effectiveLength);
287 int32_t xScroll, int32_t xZoom);
290 void selectGlobalParam(int32_t offset,
Clip* clip);
291 void selectNonGlobalParam(int32_t offset,
Clip* clip);
292 bool selectPatchCable(int32_t offset,
Clip* clip);
293 bool selectPatchCableAtIndex(
Clip* clip,
PatchCableSet* set, int32_t patchCableIndex,
bool& foundCurrentPatchCable);
294 void selectMIDICC(int32_t offset,
Clip* clip);
295 int32_t getNextSelectedParamArrayPosition(int32_t offset, int32_t lastSelectedParamArrayPosition,
297 void getLastSelectedNonGlobalParamArrayPosition(
Clip* clip);
298 void getLastSelectedGlobalParamArrayPosition(
Clip* clip);
301 void initPadSelection();
302 void initInterpolation();
305 uint32_t getSquareWidth(int32_t square, int32_t effectiveLength, int32_t xScroll, int32_t xZoom);
306 uint32_t getMiddlePosFromSquare(int32_t xDisplay, int32_t effectiveLength, int32_t xScroll, int32_t xZoom);
308 void getAutomationParameterName(
Clip* clip, OutputType outputType,
StringBuf& parameterName);
312 int32_t xDisplay, int32_t effectiveLength, int32_t xScroll, int32_t xZoom,
313 bool modEncoderAction =
false);
315 bool updateDisplay =
true,
bool updateIndicatorLevels =
true);
318 int32_t yDisplay, int32_t effectiveLength, int32_t xScroll, int32_t xZoom);
320 OutputType outputType, int32_t xDisplay, int32_t yDisplay,
321 int32_t effectiveLength, int32_t xScroll, int32_t xZoom);
322 int32_t calculateAutomationKnobPosForPadPress(
ModelStackWithAutoParam* modelStackWithParam, OutputType outputType,
328 int32_t firstPadY, int32_t secondPadX, int32_t secondPadY,
329 int32_t effectiveLength, int32_t xScroll, int32_t xZoom,
330 bool modEncoderAction =
false);
332 int32_t effectiveLength, int32_t xScroll, int32_t xZoom,
333 int32_t xDisplay = kNoSelection,
bool modEncoderAction =
false);
335 int32_t calculateAutomationKnobPosForModEncoderTurn(
ModelStackWithAutoParam* modelStackWithParam, int32_t knobPos,
338 void blinkShortcuts();
339 void resetParameterShortcutBlinking();
341 bool parameterShortcutBlinking;
343 bool interpolationShortcutBlinking;
344 bool padSelectionShortcutBlinking;
347 bool multiPadPressActive;
348 bool middlePadPressSelected;
349 int32_t leftPadSelectedX;
350 int32_t leftPadSelectedY;
351 int32_t rightPadSelectedX;
352 int32_t rightPadSelectedY;
353 int32_t lastPadSelectedKnobPos;
354 int32_t numNotesSelected;
355 int32_t selectedPadPressed;
357 bool playbackStopped;
360 void initMIDICCShortcutsForAutomation();
361 uint32_t midiCCShortcutsForAutomation[kDisplayWidth][kDisplayHeight];
362 bool midiCCShortcutsLoaded;
364 bool probabilityChanged;
365 uint32_t timeSelectKnobLastReleased;