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;
102 ActionResult horizontalEncoderAction(int32_t offset)
override;
103 uint32_t getMaxLength()
override;
104 uint32_t getMaxZoom()
override;
105 [[nodiscard]] int32_t getNavSysId()
const override;
109 ActionResult verticalEncoderAction(int32_t offset,
bool inCardRoutine)
override;
113 void modEncoderAction(int32_t whichModEncoder, int32_t offset)
override;
114 void modEncoderButtonAction(uint8_t whichModEncoder,
bool on)
override;
115 CopiedParamAutomation copiedParamAutomation;
118 void selectEncoderAction(int8_t offset)
override;
119 void getLastSelectedParamShortcut(Clip* clip);
120 void getLastSelectedParamArrayPosition(Clip* clip);
121 bool multiPadPressSelected;
124 void noteRowChanged(InstrumentClip* clip, NoteRow* noteRow)
override;
127 void notifyPlaybackBegun()
override;
130 bool interpolationBefore;
131 bool interpolationAfter;
134 ModelStackWithAutoParam*
135 getModelStackWithParamForClip(ModelStackWithTimelineCounter* modelStack, Clip* clip,
140 void initParameterSelection(
bool updateDisplay =
true);
144 void blinkInterpolationShortcut();
145 void blinkPadSelectionShortcut();
150 int32_t getAutomationParameterKnobPos(ModelStackWithAutoParam* modelStack, uint32_t pos);
151 void setAutomationKnobIndicatorLevels(ModelStackWithAutoParam* modelStack, int32_t knobPosLeft,
152 int32_t knobPosRight);
153 void initInterpolation();
154 void resetInterpolationShortcutBlinking();
155 void initPadSelection();
156 void resetPadSelectionShortcutBlinking();
158 AutomationParamType automationParamType;
159 bool getAffectEntire()
override;
162 void resetShortcutBlinking();
165 bool multiPadPressActive;
166 bool middlePadPressSelected;
167 int32_t leftPadSelectedX;
168 int32_t leftPadSelectedY;
169 int32_t rightPadSelectedX;
170 int32_t rightPadSelectedY;
171 int32_t lastPadSelectedKnobPos;
175 void handleSessionButtonAction(Clip* clip,
bool on);
176 void handleKeyboardButtonAction(
bool on);
177 void handleClipButtonAction(
bool on,
bool isAudioClip);
178 void handleCrossScreenButtonAction(
bool on);
179 void handleKitButtonAction(OutputType outputType,
bool on);
180 void handleSynthButtonAction(OutputType outputType,
bool on);
181 void handleMidiButtonAction(OutputType outputType,
bool on);
182 void handleCVButtonAction(OutputType outputType,
bool on);
183 bool handleHorizontalEncoderButtonAction(
bool on,
bool isAudioClip);
184 bool handleBackAndHorizontalEncoderButtonComboAction(Clip* clip,
bool on);
185 void handleVerticalEncoderButtonAction(
bool on);
186 void handleSelectEncoderButtonAction(
bool on);
187 void handleAffectEntireButtonAction(
bool on);
190 ActionResult handleEditPadAction(ModelStackWithAutoParam* modelStackWithParam,
191 ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, Clip* clip,
192 Output* output, OutputType outputType, int32_t effectiveLength, int32_t x,
193 int32_t y, int32_t velocity, SquareInfo& squareInfo);
194 bool shortcutPadAction(ModelStackWithAutoParam* modelStackWithParam, Clip* clip, Output* output,
195 OutputType outputType, int32_t effectiveLength, int32_t x, int32_t y, int32_t velocity,
196 int32_t xScroll, int32_t xZoom, SquareInfo& squareInfo);
197 void handleParameterSelection(Clip* clip, Output* output, OutputType outputType, int32_t xDisplay,
200 ActionResult handleMutePadAction(ModelStackWithTimelineCounter* modelStackWithTimelineCounter,
201 InstrumentClip* instrumentClip, Output* output, OutputType outputType, int32_t y,
205 ActionResult handleAuditionPadAction(InstrumentClip* instrumentClip, Output* output, OutputType outputType,
206 int32_t y, int32_t velocity);
207 ActionResult auditionPadAction(InstrumentClip* clip, Output* output, OutputType outputType, int32_t yDisplay,
208 int32_t velocity,
bool shiftButtonDown);
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;