27 Interpolation(l10n::String name, l10n::String title_format_str, uint8_t source_id)
28 :
AudioInterpolation(name), FormattedTitle(title_format_str, source_id + 1), source_id_{source_id} {}
30 [[nodiscard]] std::string_view
getTitle()
const override {
return FormattedTitle::title(); }
33 const auto& sampleControls = getCurrentSampleControls(source_id_);
34 setValue(sampleControls.interpolationMode);
37 void writeCurrentValue()
override {
38 const auto current_value = getValue<InterpolationMode>();
41 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
43 const Kit* kit = getCurrentKit();
45 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
46 if (thisDrum->type == DrumType::SOUND) {
47 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
49 Source* source = &soundDrum->sources[source_id_];
50 source->sampleControls.interpolationMode = current_value;
56 auto& sampleControls = getCurrentSampleControls(source_id_);
57 sampleControls.interpolationMode = current_value;
62 if (getCurrentAudioClip() !=
nullptr) {
65 const auto sound =
static_cast<Sound*
>(modControllable);
66 Source& source = sound->sources[source_id_];
67 return sound->getSynthMode() == ::SynthMode::SUBTRACTIVE
68 && ((source.oscType == OscType::SAMPLE && source.hasAtLeastOneAudioFileLoaded())
69 || source.oscType == OscType::INPUT_L || source.oscType == OscType::INPUT_R
70 || source.oscType == OscType::INPUT_STEREO);
73 void getColumnLabel(
StringBuf& label)
override {
74 label.append(l10n::get(l10n::String::STRING_FOR_INTERPOLATION_SHORT));