37class ArrangerView final :
public TimelineView {
39 ArrangerView() =
default;
40 bool opened()
override;
41 void focusRegained()
override;
42 ActionResult padAction(int32_t x, int32_t y, int32_t velocity)
override;
43 ActionResult handleEditPadAction(int32_t x, int32_t y, int32_t velocity);
44 ActionResult handleStatusPadAction(int32_t y, int32_t velocity, UI* ui);
45 ActionResult handleAuditionPadAction(int32_t y, int32_t velocity, UI* ui);
46 ActionResult buttonAction(deluge::hid::Button b,
bool on,
bool inCardRoutine)
override;
47 ActionResult verticalEncoderAction(int32_t offset,
bool inCardRoutine)
override;
48 void selectEncoderAction(int8_t offset)
override;
49 void modEncoderAction(int32_t whichModEncoder, int32_t offset)
override;
51 void repopulateOutputsOnScreen(
bool doRender =
true);
52 bool renderSidebar(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth],
53 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth])
override;
54 bool renderMainPads(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth],
55 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth],
bool drawUndefinedArea =
true)
override;
56 bool renderRow(
ModelStack* modelStack, int32_t yDisplay, int32_t xScroll, uint32_t xZoom,
RGB* thisImage,
57 uint8_t thisOccupancyMask[], int32_t renderWidth);
58 void editPadAction(int32_t x, int32_t y,
bool on);
59 ActionResult horizontalEncoderAction(int32_t offset)
override;
60 uint32_t getMaxLength()
override;
61 uint32_t getMaxZoom()
override;
62 void graphicsRoutine()
override;
63 [[nodiscard]] int32_t getNavSysId()
const override {
return NAVIGATION_ARRANGEMENT; }
64 void navigateThroughPresets(int32_t offset);
65 void notifyActiveClipChangedOnOutput(
Output* output);
66 ActionResult timerCallback()
override;
67 void reassessWhetherDoingAutoScroll(int32_t pos = -1);
68 void autoScrollOnPlaybackEnd();
69 bool initiateXScroll(int32_t newScrollPos);
70 [[nodiscard]]
bool supportsTriplets()
const override {
return false; }
71 bool putDraggedClipInstanceInNewPosition(
Output* output);
72 void tellMatrixDriverWhichRowsContainSomethingZoomable()
override;
73 void scrollFinished()
override;
74 void notifyPlaybackBegun()
override;
75 uint32_t getGreyedOutRowsNotRepresentingOutput(
Output* output)
override;
76 void playbackEnded()
override;
77 void clipNeedsReRendering(
Clip* clip)
override;
78 void exitSubModeWithoutAction(UI* ui =
nullptr);
79 bool transitionToArrangementEditor();
80 bool getGreyoutColsAndRows(uint32_t* cols, uint32_t* rows)
override;
82 ActionResult verticalScrollOneSquare(int32_t direction);
83 ActionResult horizontalScrollOneSquare(int32_t direction);
87 Output* outputsOnScreen[kDisplayHeight]{};
88 int8_t yPressedEffective{};
89 int8_t yPressedActual{};
91 bool actionOnDepress{};
93 int32_t desiredLength{};
94 int32_t originallyPressedClipActualLength{};
97 int32_t pressedClipInstanceIndex{};
98 Output* pressedClipInstanceOutput{};
99 int32_t pressedClipInstanceXScrollWhenLastInValidPosition{};
100 bool pressedClipInstanceIsInValidPosition{};
104 bool doingAutoScrollNow =
false;
105 bool mustRedrawTickSquares{};
107 int32_t autoScrollNumSquaresBehind{};
109 int32_t lastInteractedOutputIndex = 0;
110 int32_t lastInteractedPos = -1;
111 uint8_t lastInteractedSection = 0;
114 int32_t lastInteractedArrangementPos = -1;
116 int32_t lastTickSquare{};
118 int32_t xScrollWhenPlaybackStarted{};
121 UIType getUIType()
override {
return UIType::ARRANGER; }
123 Clip* getClipForSelection();
125 void requestRendering(UI* ui, uint32_t whichMainRows = 0xFFFFFFFF, uint32_t whichSideRows = 0xFFFFFFFF);
128 RGB getMutePadColor(int32_t yDisplay);
129 RGB getAuditionPadColor(int32_t yDisplay);
131 void changeOutputType(OutputType newOutputType);
132 void moveClipToSession();
133 void auditionPadAction(
bool on, int32_t y, UI* ui);
134 void beginAudition(
Output* output);
135 void endAudition(
Output* output,
bool evenIfPlaying =
false);
137 Drum* getDrumForAudition(
Kit* kit);
139 void outputActivated(
Output* output);
140 void outputDeactivated(
Output* output);
143 bool clearingWholeArrangement =
false);
144 void clearArrangement();
145 void interactWithClipInstance(
Output* output, int32_t yDisplay,
ClipInstance* clipInstance);
146 void rememberInteractionWithClipInstance(int32_t yDisplay,
ClipInstance* clipInstance);
148 void auditionEnded();
150 void changeOutputToAudio();
151 bool renderRowForOutput(
ModelStack* modelStack,
Output* output, int32_t xScroll, uint32_t xZoom,
RGB* image,
152 uint8_t occupancyMask[], int32_t renderWidth, int32_t ignoreI);
153 Instrument* createNewInstrument(OutputType newOutputType,
bool* instrumentAlreadyInSong);
154 uint32_t doActualRender(int32_t xScroll, uint32_t xZoom, uint32_t whichRows,
RGB* image,
155 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t renderWidth,