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 clipNeedsReRendering(
Clip* clip)
override;
88 void renderDisplay(int32_t knobPosLeft = kNoSelection, int32_t knobPosRight = kNoSelection,
89 bool modEncoderAction =
false);
90 void displayAutomation(
bool padSelected =
false,
bool updateDisplay =
true);
93 InstrumentClipMinder::renderOLED(canvas);
97 ActionResult buttonAction(deluge::hid::Button b,
bool on,
bool inCardRoutine)
override;
100 ActionResult padAction(int32_t x, int32_t y, int32_t velocity)
override;
101 ActionResult auditionPadAction(InstrumentClip* clip, Output* output, OutputType outputType, int32_t yDisplay,
102 int32_t velocity,
bool shiftButtonDown);
105 ActionResult horizontalEncoderAction(int32_t offset)
override;
106 uint32_t getMaxLength()
override;
107 uint32_t getMaxZoom()
override;
108 [[nodiscard]] int32_t getNavSysId()
const override;
112 ActionResult verticalEncoderAction(int32_t offset,
bool inCardRoutine)
override;
116 void modEncoderAction(int32_t whichModEncoder, int32_t offset)
override;
117 void modEncoderButtonAction(uint8_t whichModEncoder,
bool on)
override;
118 CopiedParamAutomation copiedParamAutomation;
121 void selectEncoderAction(int8_t offset)
override;
122 void getLastSelectedParamShortcut(Clip* clip);
123 void getLastSelectedParamArrayPosition(Clip* clip);
124 bool multiPadPressSelected;
127 void noteRowChanged(InstrumentClip* clip, NoteRow* noteRow)
override;
130 void notifyPlaybackBegun()
override;
133 bool interpolationBefore;
134 bool interpolationAfter;
137 ModelStackWithAutoParam*
138 getModelStackWithParamForClip(ModelStackWithTimelineCounter* modelStack, Clip* clip,
143 void initParameterSelection(
bool updateDisplay =
true);
147 void blinkInterpolationShortcut();
148 void blinkPadSelectionShortcut();
153 int32_t getAutomationParameterKnobPos(ModelStackWithAutoParam* modelStack, uint32_t pos);
154 void setAutomationKnobIndicatorLevels(ModelStackWithAutoParam* modelStack, int32_t knobPosLeft,
155 int32_t knobPosRight);
156 void initInterpolation();
157 void resetInterpolationShortcutBlinking();
158 void initPadSelection();
159 void resetPadSelectionShortcutBlinking();
161 AutomationParamType automationParamType;
162 bool getAffectEntire()
override;
165 void resetShortcutBlinking();
168 bool multiPadPressActive;
169 bool middlePadPressSelected;
170 int32_t leftPadSelectedX;
171 int32_t leftPadSelectedY;
172 int32_t rightPadSelectedX;
173 int32_t rightPadSelectedY;
174 int32_t lastPadSelectedKnobPos;
176 bool isNoteVelocityEditorShortcut(int32_t x, int32_t y);
180 void handleSessionButtonAction(Clip* clip,
bool on);
181 void handleKeyboardButtonAction(
bool on);
182 void handleClipButtonAction(
bool on,
bool isAudioClip);
183 void handleCrossScreenButtonAction(
bool on);
184 void handleKitButtonAction(OutputType outputType,
bool on);
185 void handleSynthButtonAction(OutputType outputType,
bool on);
186 void handleMidiButtonAction(OutputType outputType,
bool on);
187 void handleCVButtonAction(OutputType outputType,
bool on);
188 bool handleHorizontalEncoderButtonAction(
bool on,
bool isAudioClip);
189 bool handleBackAndHorizontalEncoderButtonComboAction(Clip* clip,
bool on);
190 void handleVerticalEncoderButtonAction(
bool on);
191 void handleSelectEncoderButtonAction(
bool on);
192 void handleAffectEntireButtonAction(
bool on);
195 ActionResult handleEditPadAction(ModelStackWithAutoParam* modelStackWithParam,
196 ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, Clip* clip,
197 Output* output, OutputType outputType, int32_t effectiveLength, int32_t x,
198 int32_t y, int32_t velocity, SquareInfo& squareInfo);
199 bool shortcutPadAction(ModelStackWithAutoParam* modelStackWithParam, Clip* clip, Output* output,
200 OutputType outputType, int32_t effectiveLength, int32_t x, int32_t y, int32_t velocity,
201 int32_t xScroll, int32_t xZoom, SquareInfo& squareInfo);
202 void handleParameterSelection(Clip* clip, Output* output, OutputType outputType, int32_t xDisplay,
205 ActionResult handleMutePadAction(ModelStackWithTimelineCounter* modelStackWithTimelineCounter,
206 InstrumentClip* instrumentClip, Output* output, OutputType outputType, int32_t y,
210 ActionResult handleAuditionPadAction(InstrumentClip* instrumentClip, Output* output, OutputType outputType,
211 int32_t y, int32_t velocity);
214 void performActualRender(RGB image[][kDisplayWidth + kSideBarWidth],
215 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xScroll, uint32_t xZoom,
216 int32_t renderWidth, int32_t imageWidth,
bool drawUndefinedArea =
true);
217 void renderAutomationOverview(ModelStackWithTimelineCounter* modelStackWithTimelineCounter,
218 ModelStackWithThreeMainThings* modelStackWithThreeMainThings, Clip* clip,
219 OutputType outputType, RGB image[][kDisplayWidth + kSideBarWidth],
220 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay,
222 void renderDisplayOLED(Clip* clip, Output* output, OutputType outputType, int32_t knobPosLeft = kNoSelection,
223 int32_t knobPosRight = kNoSelection);
224 void renderAutomationOverviewDisplayOLED(deluge::hid::display::oled_canvas::Canvas& canvas, Output* output,
225 OutputType outputType);
226 void renderDisplay7SEG(Clip* clip, Output* output, OutputType outputType, int32_t knobPosLeft = kNoSelection,
227 bool modEncoderAction =
false);
228 void renderAutomationOverviewDisplay7SEG(Output* output, OutputType outputType);
231 void shiftAutomationHorizontally(ModelStackWithAutoParam* modelStackWithParam, int32_t offset,
232 int32_t effectiveLength);
235 void selectGlobalParam(int32_t offset, Clip* clip);
236 void selectNonGlobalParam(int32_t offset, Clip* clip);
237 bool selectPatchCable(int32_t offset, Clip* clip);
238 bool selectPatchCableAtIndex(Clip* clip, PatchCableSet* set, int32_t patchCableIndex,
bool& foundCurrentPatchCable);
239 void selectMIDICC(int32_t offset, Clip* clip);
240 int32_t getNextSelectedParamArrayPosition(int32_t offset, int32_t lastSelectedParamArrayPosition,
242 void getLastSelectedNonGlobalParamArrayPosition(Clip* clip);
243 void getLastSelectedGlobalParamArrayPosition(Clip* clip);
245 void blinkShortcuts();
246 void resetParameterShortcutBlinking();
247 bool parameterShortcutBlinking;
248 bool interpolationShortcutBlinking;
249 bool padSelectionShortcutBlinking;
251 int32_t getEffectiveLength(ModelStackWithTimelineCounter* modelStack);
254 void initMIDICCShortcutsForAutomation();
255 uint32_t midiCCShortcutsForAutomation[kDisplayWidth][kDisplayHeight];
256 bool midiCCShortcutsLoaded;
258 bool probabilityChanged;
259 uint32_t timeSelectKnobLastReleased;