Skip to content

Commit

Permalink
Fix some small playmode menu dsicrepancies (#1459)
Browse files Browse the repository at this point in the history
And also use TextButton not MenuButton for the coming soons

Closes #1458
  • Loading branch information
baconpaul authored Nov 23, 2024
1 parent 49d188c commit f8ed759
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
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

0 comments on commit f8ed759

Please sign in to comment.