27class Reverse final :
public Toggle,
public FormattedTitle {
29 Reverse(l10n::String
name, l10n::String title_format_str) :
Toggle(
name), FormattedTitle(title_format_str) {}
31 [[nodiscard]] std::string_view
getTitle()
const override {
return FormattedTitle::title(); }
35 void readCurrentValue()
override { this->setValue(soundEditor.currentSource->sampleControls.reversed); }
37 void writeCurrentValue()
override {
40 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
42 Kit* kit = getCurrentKit();
44 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
45 if (thisDrum->type == DrumType::SOUND) {
46 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
47 Source* source = &soundDrum->sources[soundEditor.currentSourceIndex];
49 soundDrum->killAllVoices();
50 source->setReversed(this->getValue());
56 soundEditor.currentSound->killAllVoices();
57 soundEditor.currentSource->setReversed(this->getValue());
61 return isSampleModeSample(modControllable, whichThing);