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; }
65 return getUIContextType() == UIType::ARRANGER ? UIModControllableContext::SONG : UIModControllableContext::CLIP;
71 void setAutomationParamType();
73 bool onAutomationOverview();
74 bool inAutomationEditor();
79 bool renderMainPads(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth],
80 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth],
bool drawUndefinedArea =
true)
override;
81 void renderUndefinedArea(int32_t xScroll, uint32_t xZoom, int32_t lengthToDisplay,
82 RGB image[][kDisplayWidth + kSideBarWidth],
83 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t imageWidth,
84 TimelineView* timelineView,
bool tripletsOnHere, int32_t xDisplay);
85 bool renderSidebar(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth],
86 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth])
override;
87 void renderDisplay(int32_t knobPosLeft = kNoSelection, int32_t knobPosRight = kNoSelection,
88 bool modEncoderAction =
false);
89 void displayAutomation(
bool padSelected =
false,
bool updateDisplay =
true);
92 InstrumentClipMinder::renderOLED(canvas);
96 ActionResult buttonAction(deluge::hid::Button b,
bool on,
bool inCardRoutine)
override;
99 ActionResult padAction(int32_t x, int32_t y, int32_t velocity)
override;
100 ActionResult auditionPadAction(InstrumentClip* clip, Output* output, OutputType outputType, int32_t yDisplay,
101 int32_t velocity,
bool shiftButtonDown);
104 ActionResult horizontalEncoderAction(int32_t offset)
override;
105 uint32_t getMaxLength()
override;
106 uint32_t getMaxZoom()
override;
107 [[nodiscard]] int32_t getNavSysId()
const override;
111 ActionResult verticalEncoderAction(int32_t offset,
bool inCardRoutine)
override;
115 void modEncoderAction(int32_t whichModEncoder, int32_t offset)
override;
116 void modEncoderButtonAction(uint8_t whichModEncoder,
bool on)
override;
117 CopiedParamAutomation copiedParamAutomation;
120 void selectEncoderAction(int8_t offset)
override;
121 void getLastSelectedParamShortcut(Clip* clip);
122 void getLastSelectedParamArrayPosition(Clip* clip);
123 bool multiPadPressSelected;
126 void noteRowChanged(InstrumentClip* clip, NoteRow* noteRow)
override;
129 void notifyPlaybackBegun()
override;
132 bool interpolationBefore;
133 bool interpolationAfter;
136 ModelStackWithAutoParam*
137 getModelStackWithParamForClip(ModelStackWithTimelineCounter* modelStack, Clip* clip,
142 void initParameterSelection(
bool updateDisplay =
true);
146 void blinkInterpolationShortcut();
147 void blinkPadSelectionShortcut();
152 int32_t getAutomationParameterKnobPos(ModelStackWithAutoParam* modelStack, uint32_t pos);
153 void setAutomationKnobIndicatorLevels(ModelStackWithAutoParam* modelStack, int32_t knobPosLeft,
154 int32_t knobPosRight);
155 void initInterpolation();
156 void resetInterpolationShortcutBlinking();
157 void initPadSelection();
158 void resetPadSelectionShortcutBlinking();
160 AutomationParamType automationParamType;
161 bool getAffectEntire()
override;
164 void resetShortcutBlinking();
167 bool multiPadPressActive;
168 bool middlePadPressSelected;
169 int32_t leftPadSelectedX;
170 int32_t leftPadSelectedY;
171 int32_t rightPadSelectedX;
172 int32_t rightPadSelectedY;
173 int32_t lastPadSelectedKnobPos;
177 void handleSessionButtonAction(Clip* clip,
bool on);
178 void handleKeyboardButtonAction(
bool on);
179 void handleClipButtonAction(
bool on,
bool isAudioClip);
180 void handleCrossScreenButtonAction(
bool on);
181 void handleKitButtonAction(OutputType outputType,
bool on);
182 void handleSynthButtonAction(OutputType outputType,
bool on);
183 void handleMidiButtonAction(OutputType outputType,
bool on);
184 void handleCVButtonAction(OutputType outputType,
bool on);
185 bool handleHorizontalEncoderButtonAction(
bool on,
bool isAudioClip);
186 bool handleBackAndHorizontalEncoderButtonComboAction(Clip* clip,
bool on);
187 void handleVerticalEncoderButtonAction(
bool on);
188 void handleSelectEncoderButtonAction(
bool on);
189 void handleAffectEntireButtonAction(
bool on);
192 ActionResult handleEditPadAction(ModelStackWithAutoParam* modelStackWithParam,
193 ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, Clip* clip,
194 Output* output, OutputType outputType, int32_t effectiveLength, int32_t x,
195 int32_t y, int32_t velocity, SquareInfo& squareInfo);
196 bool shortcutPadAction(ModelStackWithAutoParam* modelStackWithParam, Clip* clip, Output* output,
197 OutputType outputType, int32_t effectiveLength, int32_t x, int32_t y, int32_t velocity,
198 int32_t xScroll, int32_t xZoom, SquareInfo& squareInfo);
199 void handleParameterSelection(Clip* clip, Output* output, OutputType outputType, int32_t xDisplay,
202 ActionResult handleMutePadAction(ModelStackWithTimelineCounter* modelStackWithTimelineCounter,
203 InstrumentClip* instrumentClip, Output* output, OutputType outputType, int32_t y,
207 ActionResult handleAuditionPadAction(InstrumentClip* instrumentClip, Output* output, OutputType outputType,
208 int32_t y, int32_t velocity);
211 void performActualRender(RGB image[][kDisplayWidth + kSideBarWidth],
212 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xScroll, uint32_t xZoom,
213 int32_t renderWidth, int32_t imageWidth,
bool drawUndefinedArea =
true);
214 void renderAutomationOverview(ModelStackWithTimelineCounter* modelStackWithTimelineCounter,
215 ModelStackWithThreeMainThings* modelStackWithThreeMainThings, Clip* clip,
216 OutputType outputType, RGB image[][kDisplayWidth + kSideBarWidth],
217 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay,
219 void renderDisplayOLED(Clip* clip, Output* output, OutputType outputType, int32_t knobPosLeft = kNoSelection,
220 int32_t knobPosRight = kNoSelection);
221 void renderAutomationOverviewDisplayOLED(deluge::hid::display::oled_canvas::Canvas& canvas, Output* output,
222 OutputType outputType);
223 void renderDisplay7SEG(Clip* clip, Output* output, OutputType outputType, int32_t knobPosLeft = kNoSelection,
224 bool modEncoderAction =
false);
225 void renderAutomationOverviewDisplay7SEG(Output* output, OutputType outputType);
228 void shiftAutomationHorizontally(ModelStackWithAutoParam* modelStackWithParam, int32_t offset,
229 int32_t effectiveLength);
232 void selectGlobalParam(int32_t offset, Clip* clip);
233 void selectNonGlobalParam(int32_t offset, Clip* clip);
234 bool selectPatchCable(int32_t offset, Clip* clip);
235 bool selectPatchCableAtIndex(Clip* clip, PatchCableSet* set, int32_t patchCableIndex,
bool& foundCurrentPatchCable);
236 void selectMIDICC(int32_t offset, Clip* clip);
237 int32_t getNextSelectedParamArrayPosition(int32_t offset, int32_t lastSelectedParamArrayPosition,
239 void getLastSelectedNonGlobalParamArrayPosition(Clip* clip);
240 void getLastSelectedGlobalParamArrayPosition(Clip* clip);
242 void blinkShortcuts();
243 void resetParameterShortcutBlinking();
244 bool parameterShortcutBlinking;
245 bool interpolationShortcutBlinking;
246 bool padSelectionShortcutBlinking;
248 int32_t getEffectiveLength(ModelStackWithTimelineCounter* modelStack);
251 void initMIDICCShortcutsForAutomation();
252 uint32_t midiCCShortcutsForAutomation[kDisplayWidth][kDisplayHeight];
253 bool midiCCShortcutsLoaded;
255 bool probabilityChanged;
256 uint32_t timeSelectKnobLastReleased;