18#include "gui/menu_item/unpatched_param.h"
19#include "gui/ui/sound_editor.h"
21#include <util/comparison.h>
23namespace deluge::gui::menu_item::randomizer {
24class RandomizerUnpatchedParam :
public UnpatchedParam {
26 using UnpatchedParam::UnpatchedParam;
28 RandomizerUnpatchedParam(l10n::String newName, l10n::String
title, int32_t newP, NumberStyle style)
29 : UnpatchedParam(newName,
title, newP), style_(style) {}
32 if (soundEditor.editingCVOrMIDIClip() || soundEditor.editingNonAudioDrumRow()) {
37 const auto p =
static_cast<UnpatchedShared
>(getP());
39 util::one_of(p, {UNPATCHED_SPREAD_VELOCITY, UNPATCHED_NOTE_PROBABILITY, UNPATCHED_REVERSE_PROBABILITY});
41 return isGlobal || soundEditor.currentArpSettings->mode != ArpMode::OFF;
44 void getColumnLabel(
StringBuf& label)
override {
45 label.append(deluge::l10n::get(deluge::l10n::built_in::seven_segment, this->name));
48 [[nodiscard]] NumberStyle getNumberStyle()
const override {
return style_; }
51 NumberStyle style_ = KNOB;
56 using UnpatchedParam::UnpatchedParam;
58 return !soundEditor.editingCVOrMIDIClip() && !soundEditor.editingKitAffectEntire()
59 && !soundEditor.editingNonAudioDrumRow() && soundEditor.currentArpSettings->mode != ArpMode::OFF;
61 void getColumnLabel(
StringBuf& label)
override {
62 label.append(deluge::l10n::getView(deluge::l10n::built_in::seven_segment, this->name).data());
66class RandomizerNonKitSoundUnpatchedParam final :
public UnpatchedParam {
68 using UnpatchedParam::UnpatchedParam;
70 RandomizerNonKitSoundUnpatchedParam(l10n::String newName, l10n::String
title, int32_t newP, NumberStyle style)
71 : UnpatchedParam(newName,
title, newP), style_(style) {}
74 return !soundEditor.editingCVOrMIDIClip() && !soundEditor.editingKit()
75 && soundEditor.currentArpSettings->mode != ArpMode::OFF;
77 void getColumnLabel(
StringBuf& label)
override {
78 label.append(deluge::l10n::get(deluge::l10n::built_in::seven_segment, this->name));
80 [[nodiscard]] NumberStyle getNumberStyle()
const override {
return style_; }
83 NumberStyle style_ = KNOB;
Definition mod_controllable_audio.h:47
Definition d_stringbuf.h:16
bool isRelevant(ModControllableAudio *modControllable, int32_t whichThing) override
Check if this MenuItem should show up in a containing deluge::gui::menu_item::Submenu.
Definition randomizer_unpatched_param.h:73
Definition randomizer_unpatched_param.h:54
bool isRelevant(ModControllableAudio *modControllable, int32_t whichThing) override
Check if this MenuItem should show up in a containing deluge::gui::menu_item::Submenu.
Definition randomizer_unpatched_param.h:57
bool isRelevant(ModControllableAudio *modControllable, int32_t whichThing) override
Check if this MenuItem should show up in a containing deluge::gui::menu_item::Submenu.
Definition randomizer_unpatched_param.h:31