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; }
80 bool canDisplayFavourites()
override {
return true; }
83 void enterKeyPress()
override;
84 void folderContentsReady(int32_t entryDirection)
override;
85 void currentFileChanged(int32_t movementDirection)
override;
88 bool showingAuditionPads();
89 Error setupForOutputType();
90 void changeOutputType(OutputType newOutputType);
91 void revertToInitialPreset();
92 void exitAction()
override;
93 bool isInstrumentInList(Instrument* searchInstrument, Output* list);
94 bool findUnusedSlotVariation(String* oldName, String* newName);
96 InstrumentClip* instrumentClipToLoadFor;
97 Instrument* instrumentToReplace;
100 bool loadingSynthToKitRow;
101 SoundDrum* soundDrumToReplace;
102 int32_t noteRowIndex;
104 Error currentInstrumentLoadError;
106 int16_t initialChannel;
107 int8_t initialChannelSuffix;
108 OutputType initialOutputType;
110 bool changedInstrumentForClip;
111 bool replacedWholeInstrument;
114 String initialDirPath;