Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
interpolation.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 "gui/menu_item/audio_interpolation.h"
19#include "gui/menu_item/formatted_title.h"
20#include "gui/menu_item/sample/utils.h"
21#include "model/sample/sample_controls.h"
22#include "processing/sound/sound.h"
23
24namespace deluge::gui::menu_item::sample {
25class Interpolation final : public AudioInterpolation, public FormattedTitle {
26public:
27 Interpolation(l10n::String name, l10n::String title_format_str)
28 : AudioInterpolation(name), FormattedTitle(title_format_str) {}
29
30 [[nodiscard]] std::string_view getTitle() const override { return FormattedTitle::title(); }
31
32 bool isRelevant(ModControllableAudio* modControllable, int32_t whichThing) override {
33 if (getCurrentAudioClip()) {
34 return true;
35 }
36 Sound* sound = static_cast<Sound*>(modControllable);
37 Source* source = &sound->sources[whichThing];
38 return (sound->getSynthMode() == ::SynthMode::SUBTRACTIVE
39 && ((source->oscType == OscType::SAMPLE && source->hasAtLeastOneAudioFileLoaded())
40 || source->oscType == OscType::INPUT_L || source->oscType == OscType::INPUT_R
41 || source->oscType == OscType::INPUT_STEREO));
42 }
43};
44} // namespace deluge::gui::menu_item::sample
Definition mod_controllable_audio.h:47
Definition sound.h:71
Definition source.h:31
Definition audio_interpolation.h:14
std::string_view getTitle() const override
Get the title to be used when rendering on OLED, both as a deluge::gui::menu_item::Submenu and when d...
Definition interpolation.h:30
bool isRelevant(ModControllableAudio *modControllable, int32_t whichThing) override
Check if this MenuItem should show up in a containing deluge::gui::menu_item::Submenu.
Definition interpolation.h:32