31 using Selection::Selection;
34 if (getCurrentUI() == &soundEditor && soundEditor.inNoteRowEditor() && !isUIModeActive(UI_MODE_AUDITIONING)) {
35 display->displayPopup(
"Select Row");
42 auto* clip =
static_cast<InstrumentClip*
>(modelStack->getTimelineCounter());
43 if (!clip->affectEntire && clip->output->type == OutputType::KIT) {
44 Kit* kit = getCurrentKit();
45 if (kit->selectedDrum !=
nullptr) {
46 return clip->getNoteRowForDrum(modelStack, kit->selectedDrum);
49 else if (clip->output->type != OutputType::KIT) {
50 if (soundEditor.selectedNoteRow) {
53 clip->getNoteRowOnScreen(instrumentClipView.lastAuditionedYDisplay, modelStack);
54 if (!modelStackWithNoteRow->getNoteRowAllowNull()) {
55 modelStackWithNoteRow = instrumentClipView.createNoteRowForYDisplay(
56 modelStack, instrumentClipView.lastAuditionedYDisplay);
58 return modelStackWithNoteRow;
61 return modelStack->addNoteRow(0,
nullptr);
65 char modelStackMemory[MODEL_STACK_MAX_SIZE];
69 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
70 this->setValue(modelStackWithNoteRow->getNoteRow()->sequenceDirectionMode);
73 this->setValue(getCurrentInstrumentClip()->sequenceDirectionMode);
77 void writeCurrentValue()
override {
78 auto current_value = this->getValue<SequenceDirection>();
79 char modelStackMemory[MODEL_STACK_MAX_SIZE];
82 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
83 modelStackWithNoteRow->getNoteRow()->setSequenceDirectionMode(modelStackWithNoteRow, current_value);
86 getCurrentInstrumentClip()->setSequenceDirectionMode(modelStackWithNoteRow->toWithTimelineCounter(),
91 deluge::vector<std::string_view> getOptions(OptType optType)
override {
93 deluge::vector<std::string_view> sequenceDirectionOptions = {
94 l10n::getView(l10n::String::STRING_FOR_FORWARD),
95 l10n::getView(l10n::String::STRING_FOR_REVERSED),
96 l10n::getView(l10n::String::STRING_FOR_PING_PONG),
99 char modelStackMemory[MODEL_STACK_MAX_SIZE];
102 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
103 sequenceDirectionOptions.push_back(l10n::getView(l10n::String::STRING_FOR_NONE));
106 return sequenceDirectionOptions;
109 MenuPermission checkPermissionToBeginSession(ModControllableAudio* modControllable, int32_t whichThing,
110 ::MultiRange** currentRange)
override {
111 OutputType outputType = getCurrentOutputType();
112 if (!getCurrentInstrumentClip()->affectEntire && outputType == OutputType::KIT
113 && (getCurrentKit()->selectedDrum ==
nullptr)) {
114 return MenuPermission::NO;
116 else if (outputType != OutputType::KIT) {
117 soundEditor.selectedNoteRow = isUIModeActive(UI_MODE_AUDITIONING);
119 return MenuPermission::YES;