Deluge Firmware 1.3.0
Build date: 2025.06.05
Loading...
Searching...
No Matches
segment.h
1/*
2 * Copyright (c) 2014-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18#include "deluge/modulation/params/param.h"
19#include "gui/menu_item/formatted_title.h"
20#include "gui/menu_item/param.h"
21#include "gui/menu_item/source/patched_param.h"
22
23namespace deluge::gui::menu_item::envelope {
25public:
26 using source::PatchedParam::PatchedParam;
27
28 void getColumnLabel(StringBuf& label) override {
29 const auto& l10nString = getStringForEnvelopeParam(menu_item::PatchedParam::getP());
30 label.append(deluge::l10n::get(l10nString));
31 }
32
33private:
34 const deluge::l10n::String getStringForEnvelopeParam(uint8_t param) const {
35 using namespace deluge::modulation;
36 switch (param) {
37 case deluge::modulation::params::LOCAL_ENV_0_ATTACK:
38 return deluge::l10n::String::STRING_FOR_ATTACK_SHORT;
39 case deluge::modulation::params::LOCAL_ENV_0_DECAY:
40 return deluge::l10n::String::STRING_FOR_DECAY_SHORT;
41 case deluge::modulation::params::LOCAL_ENV_0_SUSTAIN:
42 return deluge::l10n::String::STRING_FOR_SUSTAIN_SHORT;
43 case deluge::modulation::params::LOCAL_ENV_0_RELEASE:
44 return deluge::l10n::String::STRING_FOR_RELEASE_SHORT;
45 }
46 return deluge::l10n::String::STRING_FOR_NONE;
47 }
48};
49} // namespace deluge::gui::menu_item::envelope
Definition d_stringbuf.h:16
void getColumnLabel(StringBuf &label) override
Get the name for use on horizontal menus.
Definition segment.h:28