23class ActualSource final :
public HorizontalMenu {
25 ActualSource(l10n::String newName, std::span<MenuItem*> newItems, uint8_t sourceId)
26 : HorizontalMenu(newName, newItems), source_id_{sourceId} {}
28 [[nodiscard]] std::string_view
getName()
const override {
return getNameOrTitle(
title); }
29 [[nodiscard]] std::string_view
getTitle()
const override {
30 auto l10nString =
title;
34 const auto& source = soundEditor.currentSound->sources[source_id_];
35 if (renderingStyle() == HORIZONTAL && source.oscType == OscType::SAMPLE && paging.visiblePageNumber > 0) {
36 l10nString = l10n::String::STRING_FOR_OSC_SAMPLE_MENU_TITLE;
39 return getNameOrTitle(l10nString);
44 if (soundEditor.currentSound->getSynthMode() == SynthMode::FM) {
46 strcpy(buffer,
"CAR");
47 intToString(source_id_ + 1, buffer + 3);
48 display->setText(buffer);
57 mutable std::string name_or_title_;
59 std::string_view getNameOrTitle(l10n::String l10n)
const {
60 std::string result = l10n::get(l10n);
61 asterixToInt(result.data(), source_id_ + 1);
62 name_or_title_ = result;
63 return name_or_title_;