28class Mode final :
public Selection,
public FormattedTitle {
30 deluge::vector<l10n::String> options_ = {
31 l10n::String::STRING_FOR_V_TRIGGER,
32 l10n::String::STRING_FOR_S_TRIGGER,
36 Mode() :
Selection(), FormattedTitle(l10n::String::STRING_FOR_GATE_MODE_TITLE) {}
37 [[nodiscard]] std::string_view
getTitle()
const override {
return FormattedTitle::title(); }
39 void readCurrentValue()
override { this->setValue(cvEngine.gateChannels[soundEditor.currentSourceIndex].mode); }
40 void writeCurrentValue()
override {
41 cvEngine.setGateType(soundEditor.currentSourceIndex, this->getValue<GateType>());
43 deluge::vector<std::string_view> getOptions(OptType optType)
override {
45 deluge::vector<std::string_view> output;
46 for (l10n::String str : options_) {
47 output.push_back(l10n::getView(str));
52 void updateOptions(int32_t value) {
53 using enum l10n::String;
55 if (options_.size() > 2) {
60 case WHICH_GATE_OUTPUT_IS_CLOCK:
61 options_.push_back(STRING_FOR_CLOCK);
64 case WHICH_GATE_OUTPUT_IS_RUN:
65 options_.push_back(STRING_FOR_RUN_SIGNAL);