Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some small playmode menu dsicrepancies #1459

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 31 additions & 28 deletions src-ui/app/edit-screen/components/GroupSettingsCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ GroupSettingsCard::GroupSettingsCard(SCXTEditor *e)
return res;
};
auto mkm = [this](auto tx, auto cs) {
auto res = std::make_unique<jcmp::MenuButton>();
auto res = std::make_unique<jcmp::TextPushButton>();
res->setLabel(tx);
res->setOnCallback(editor->makeComingSoon(std::string() + "Group Setting Pane " + cs));
addAndMakeVisible(*res);
Expand Down Expand Up @@ -216,45 +216,48 @@ void GroupSettingsCard::showPolyModeMenu()
p.addSectionHeader("Group Voice/Note Mode");
p.addSeparator();

p.addItem(
"Poly", true,
info.vmPlayModeInt == (uint32_t)engine::Engine::voiceManager_t::PlayMode::POLY_VOICES,
[w = juce::Component::SafePointer(this)]() {
if (!w)
return;
w->info.vmPlayModeInt = (uint32_t)engine::Engine::voiceManager_t::PlayMode::POLY_VOICES;
bool isAnyMono =
info.vmPlayModeInt == (uint32_t)engine::Engine::voiceManager_t::PlayMode::MONO_NOTES;
bool isMonoRetrig =
info.vmPlayModeFeaturesInt &
(uint64_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::MONO_RETRIGGER;
bool isMonoLegato = info.vmPlayModeFeaturesInt &
(uint64_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::MONO_LEGATO;

w->rebuildFromInfo();
w->sendToSerialization(messaging::client::UpdateGroupOutputInfoPolyphony{w->info});
});
p.addItem(
"Mono", true,
info.vmPlayModeInt == (uint32_t)engine::Engine::voiceManager_t::PlayMode::MONO_NOTES,
[w = juce::Component::SafePointer(this)]() {
if (!w)
return;
w->info.vmPlayModeInt = (uint32_t)engine::Engine::voiceManager_t::PlayMode::MONO_NOTES;
w->info.vmPlayModeFeaturesInt =
(uint64_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::NATURAL_MONO;
p.addItem("Poly", true, !isAnyMono, [w = juce::Component::SafePointer(this)]() {
if (!w)
return;
w->info.vmPlayModeInt = (uint32_t)engine::Engine::voiceManager_t::PlayMode::POLY_VOICES;

w->rebuildFromInfo();
w->sendToSerialization(messaging::client::UpdateGroupOutputInfoPolyphony{w->info});
});
p.addItem("Legato", true, false, [w = juce::Component::SafePointer(this)]() {
w->rebuildFromInfo();
w->sendToSerialization(messaging::client::UpdateGroupOutputInfoPolyphony{w->info});
});
p.addItem("Mono", true, isAnyMono && isMonoRetrig, [w = juce::Component::SafePointer(this)]() {
if (!w)
return;
w->info.vmPlayModeInt = (uint32_t)engine::Engine::voiceManager_t::PlayMode::MONO_NOTES;
w->info.vmPlayModeFeaturesInt =
(uint64_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::NATURAL_LEGATO;
(uint64_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::NATURAL_MONO;

w->rebuildFromInfo();
w->sendToSerialization(messaging::client::UpdateGroupOutputInfoPolyphony{w->info});
});
p.addItem(
"Legato", true, isAnyMono && isMonoLegato, [w = juce::Component::SafePointer(this)]() {
if (!w)
return;
w->info.vmPlayModeInt = (uint32_t)engine::Engine::voiceManager_t::PlayMode::MONO_NOTES;
w->info.vmPlayModeFeaturesInt =
(uint64_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::NATURAL_LEGATO;

w->rebuildFromInfo();
w->sendToSerialization(messaging::client::UpdateGroupOutputInfoPolyphony{w->info});
});
p.addSeparator();
p.addSectionHeader("Mono Release Priority");
// I could ovciously structure this better
p.addItem(
"Latest", false,
"Latest", isAnyMono,
info.vmPlayModeFeaturesInt &
(uint32_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::ON_RELEASE_TO_LATEST,
[w = juce::Component::SafePointer(this)]() {
Expand All @@ -273,7 +276,7 @@ void GroupSettingsCard::showPolyModeMenu()
w->sendToSerialization(messaging::client::UpdateGroupOutputInfoPolyphony{w->info});
});
p.addItem(
"Highest", false,
"Highest", isAnyMono,
info.vmPlayModeFeaturesInt &
(uint32_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::ON_RELEASE_TO_HIGHEST,
[w = juce::Component::SafePointer(this)]() {
Expand All @@ -291,7 +294,7 @@ void GroupSettingsCard::showPolyModeMenu()
w->sendToSerialization(messaging::client::UpdateGroupOutputInfoPolyphony{w->info});
});
p.addItem(
"Lowest", false,
"Lowest", isAnyMono,
info.vmPlayModeFeaturesInt &
(uint32_t)engine::Engine::voiceManager_t::MonoPlayModeFeatures::ON_RELEASE_TO_LOWEST,
[w = juce::Component::SafePointer(this)]() {
Expand Down
4 changes: 2 additions & 2 deletions src-ui/app/edit-screen/components/GroupSettingsCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ struct GroupSettingsCard : juce::Component, HasEditor
prioGlyph, glideGlpyh, volGlyph, panGlyph, tuneGlyph;
std::unique_ptr<sst::jucegui::components::Label> pbLabel, SRCLabel;
std::unique_ptr<sst::jucegui::components::TextPushButton> polyMenu, polyModeMenu;
std::unique_ptr<sst::jucegui::components::MenuButton> midiMenu, outputMenu, prioMenu, glideMenu,
srcMenu;
std::unique_ptr<sst::jucegui::components::TextPushButton> midiMenu, outputMenu, prioMenu,
glideMenu, srcMenu;
std::unique_ptr<sst::jucegui::components::DraggableTextEditableValue> pbDnVal, pbUpDrag,
glideDrag, volDrag, panDrag, tuneDrag;

Expand Down
Loading