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 Clip* displayClip =
nullptr);
59 void setupLoadInstrument(OutputType newOutputType,
Instrument* instrumentToReplace_,
61 Browser::outputTypeToLoad = newOutputType;
62 instrumentToReplace = instrumentToReplace_;
63 instrumentClipToLoadFor = instrumentClipToLoadFor_;
64 loadingSynthToKitRow =
false;
65 soundDrumToReplace =
nullptr;
70 Browser::outputTypeToLoad = OutputType::SYNTH;
71 instrumentToReplace = kit;
72 instrumentClipToLoadFor = clip;
73 loadingSynthToKitRow =
true;
74 soundDrumToReplace = drum;
75 noteRowIndex = rowIndex;
80 UIType
getUIType()
override {
return UIType::LOAD_INSTRUMENT_PRESET; }
81 bool canDisplayFavourites()
override {
return true; }
84 void enterKeyPress()
override;
85 void folderContentsReady(int32_t entryDirection)
override;
86 void currentFileChanged(int32_t movementDirection)
override;
89 bool showingAuditionPads();
90 Error setupForOutputType();
91 void changeOutputType(OutputType newOutputType);
92 void revertToInitialPreset();
93 void exitAction()
override;
94 bool isInstrumentInList(Instrument* searchInstrument, Output* list);
95 bool findUnusedSlotVariation(String* oldName, String* newName);
97 InstrumentClip* instrumentClipToLoadFor;
98 Instrument* instrumentToReplace;
101 bool loadingSynthToKitRow;
102 SoundDrum* soundDrumToReplace;
103 int32_t noteRowIndex;
105 Error currentInstrumentLoadError;
107 int16_t initialChannel;
108 int8_t initialChannelSuffix;
109 OutputType initialOutputType;
111 bool changedInstrumentForClip;
112 bool replacedWholeInstrument;
115 String initialDirPath;