31class LoadInstrumentPresetUI final :
public LoadUI {
33 LoadInstrumentPresetUI() =
default;
34 bool opened()
override;
36 ActionResult buttonAction(deluge::hid::Button b,
bool on,
bool inCardRoutine)
override;
37 ActionResult padAction(int32_t x, int32_t y, int32_t velocity)
override;
38 ActionResult verticalEncoderAction(int32_t offset,
bool inCardRoutine)
override;
40 Error performLoad(
bool doClone =
false);
41 Error performLoadSynthToKit();
42 ActionResult timerCallback()
override;
43 bool getGreyoutColsAndRows(uint32_t* cols, uint32_t* rows)
override;
44 bool renderMainPads(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth] =
nullptr,
45 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth] =
nullptr,
bool drawUndefinedArea =
true,
46 int32_t navSys = -1) {
49 bool renderSidebar(uint32_t whichRows,
RGB image[][kDisplayWidth + kSideBarWidth],
50 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth])
override;
51 std::expected<FileItem*, Error>
52 findAnUnlaunchedPresetIncludingWithinSubfolders(
Song* song, OutputType outputType,
53 Availability availabilityRequirement);
54 std::expected<FileItem*, Error> confirmPresetOrNextUnlaunchedOne(OutputType outputType,
String* searchName,
55 Availability availabilityRequirement);
57 Availability availabilityRequirement,
bool doBlink);
58 void setupLoadInstrument(OutputType newOutputType,
Instrument* instrumentToReplace_,
60 Browser::outputTypeToLoad = newOutputType;
61 instrumentToReplace = instrumentToReplace_;
62 instrumentClipToLoadFor = instrumentClipToLoadFor_;
63 loadingSynthToKitRow =
false;
64 soundDrumToReplace =
nullptr;
69 Browser::outputTypeToLoad = OutputType::SYNTH;
70 instrumentToReplace = kit;
71 instrumentClipToLoadFor = clip;
72 loadingSynthToKitRow =
true;
73 soundDrumToReplace = drum;
74 noteRowIndex = rowIndex;
79 UIType getUIType()
override {
return UIType::LOAD_INSTRUMENT_PRESET; }
82 void enterKeyPress()
override;
83 void folderContentsReady(int32_t entryDirection)
override;
84 void currentFileChanged(int32_t movementDirection)
override;
87 bool showingAuditionPads();
88 Error setupForOutputType();
89 void changeOutputType(OutputType newOutputType);
90 void revertToInitialPreset();
91 void exitAction()
override;
93 bool findUnusedSlotVariation(
String* oldName,
String* newName);
99 bool loadingSynthToKitRow;
101 int32_t noteRowIndex;
103 Error currentInstrumentLoadError;
105 int16_t initialChannel;
106 int8_t initialChannelSuffix;
107 OutputType initialOutputType;
109 bool changedInstrumentForClip;
110 bool replacedWholeInstrument;