Skip to content

Commit a29ea89

Browse files
committed
Modify to horizontal layout
WIth the 1.2 roadmap, I need a collection of space for some of the ideas and the UI was too cramped with the eit screen below, so move it to the side. This looks like a massive commit but it really isn't. Its just mechanically changing hlists to vlists and stuff. The resulting layouts arent great but are on screen so I can start tweaking as I develop 1.2 It also adds a power button for macro ahead of super-macros and a vu meter for each operator, but neither is hooked up yet. Assisted-By: claude opus 4.7
1 parent acca217 commit a29ea89

20 files changed

Lines changed: 353 additions & 219 deletions

src/ui/dahdsr-components.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ template <typename Comp, typename PatchPart> struct DAHDSRComponents
101101

102102
namespace jlo = sst::jucegui::layouts;
103103

104-
auto lo = jlo::VList()
105-
.at(x, y)
106-
.withHeight(asComp()->getHeight() - y)
107-
.withWidth(nels * uicSliderWidth);
104+
auto lo = jlo::VList().at(x, y).withHeight(180).withWidth(nels * uicSliderWidth);
108105

109106
lo.add(titleLabelLayout(titleLab));
110107
auto sliders = jlo::HList().expandToFill();

src/ui/finetune-sub-panel.cpp

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -89,37 +89,32 @@ void FineTuneSubPanel::resized()
8989
{
9090
auto p = getLocalBounds().reduced(uicMargin, 0);
9191
auto pn = layoutDAHDSRAt(p.getX(), p.getY());
92-
auto gh = (pn.getHeight() - 2 * uicPowerButtonSize) / 2;
9392
auto r = layoutLFOAt(pn.getX() + uicMargin, p.getY());
9493

95-
auto depx = r.getX() + uicMargin;
96-
auto depy = r.getY();
94+
auto depx = p.getX();
95+
auto depy = std::min(pn.getBottom(), r.getBottom()) + uicMargin;
9796

9897
namespace jlo = sst::jucegui::layouts;
99-
auto lo = jlo::HList().at(depx, depy).withAutoGap(uicMargin * 2);
100-
101-
auto cel = jlo::VList().withWidth(uicSubPanelColumnWidth).withAutoGap(uicMargin);
102-
cel.add(titleLabelGaplessLayout(tuneTitle));
103-
cel.add(labelKnobLayout(fine, fineL).centerInParent());
104-
cel.add(labelKnobLayout(coarse, coarseL).centerInParent());
105-
lo.add(cel);
106-
107-
auto kl = jlo::VList().withWidth(uicKnobSize * 2 + uicMargin * 2).withAutoGap(uicMargin);
108-
kl.add(titleLabelGaplessLayout(envTitle));
109-
110-
auto hl = jlo::HList().withAutoGap(uicMargin).withHeight(uicLabeledKnobHeight);
111-
hl.add(labelKnobLayout(envDepth, envDepthLL));
112-
hl.add(labelKnobLayout(envCDepth, envCDepthLL));
113-
kl.add(hl);
114-
115-
kl.add(titleLabelGaplessLayout(lfoTitle));
116-
117-
hl = jlo::HList().withAutoGap(uicMargin).withHeight(uicLabeledKnobHeight);
118-
hl.add(labelKnobLayout(lfoDep, lfoDepL));
119-
hl.add(labelKnobLayout(lfoCDep, lfoCDepL));
120-
kl.add(hl);
121-
122-
lo.add(kl);
98+
auto lo =
99+
jlo::VList().at(depx, depy).withWidth(uicKnobSize * 2 + uicMargin).withAutoGap(uicMargin);
100+
101+
lo.add(titleLabelGaplessLayout(tuneTitle));
102+
auto tk = jlo::HList().withHeight(uicLabeledKnobHeight).withAutoGap(uicMargin);
103+
tk.add(labelKnobLayout(fine, fineL).centerInParent());
104+
tk.add(labelKnobLayout(coarse, coarseL).centerInParent());
105+
lo.add(tk);
106+
107+
lo.add(titleLabelGaplessLayout(envTitle));
108+
auto ek = jlo::HList().withHeight(uicLabeledKnobHeight).withAutoGap(uicMargin);
109+
ek.add(labelKnobLayout(envDepth, envDepthLL).centerInParent());
110+
ek.add(labelKnobLayout(envCDepth, envCDepthLL).centerInParent());
111+
lo.add(ek);
112+
113+
lo.add(titleLabelGaplessLayout(lfoTitle));
114+
auto lk = jlo::HList().withHeight(uicLabeledKnobHeight).withAutoGap(uicMargin);
115+
lk.add(labelKnobLayout(lfoDep, lfoDepL).centerInParent());
116+
lk.add(labelKnobLayout(lfoCDep, lfoCDepL).centerInParent());
117+
lo.add(lk);
123118

124119
lo.doLayout();
125120

src/ui/macro-panel.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace baconpaul::six_sines::ui
2323
MacroPanel::MacroPanel(SixSinesEditor &e) : jcmp::NamedPanel("Macros"), HasEditor(e)
2424
{
2525
auto &mn = editor.patchCopy.macroNodes;
26-
for (auto i = 0U; i < numOps; ++i)
26+
for (auto i = 0U; i < numMacros; ++i)
2727
{
2828
createComponent(editor, *this, mn[i].level, knobs[i], knobsData[i], i);
2929
knobs[i]->setDrawLabel(false);
@@ -34,19 +34,28 @@ MacroPanel::MacroPanel(SixSinesEditor &e) : jcmp::NamedPanel("Macros"), HasEdito
3434
labels[i] = std::make_unique<jcmp::Label>();
3535
labels[i]->setText("Macro " + std::to_string(i + 1));
3636
addAndMakeVisible(*labels[i]);
37+
38+
powerOnState[i] = true;
39+
powerD[i] = std::make_unique<
40+
sst::jucegui::component_adapters::DiscreteToValueReference<jcmp::ToggleButton, bool>>(
41+
powerOnState[i]);
42+
power[i] = powerD[i]->widget.get();
43+
power[i]->setDrawMode(sst::jucegui::components::ToggleButton::DrawMode::GLYPH);
44+
power[i]->setGlyph(sst::jucegui::components::GlyphPainter::POWER);
45+
addAndMakeVisible(*power[i]);
3746
}
3847
}
3948
MacroPanel::~MacroPanel() = default;
4049

4150
void MacroPanel::resized()
4251
{
4352
auto b = getContentArea().reduced(uicMargin, 0);
44-
auto x = b.getX() + (b.getWidth() - uicKnobSize) / 2;
53+
auto x = b.getX();
4554
auto y = b.getY();
46-
for (auto i = 0U; i < numOps; ++i)
55+
for (auto i = 0U; i < numMacros; ++i)
4756
{
48-
positionKnobAndLabel(x, y, knobs[i], labels[i]);
49-
y += uicLabeledKnobHeight + uicMargin;
57+
positionPowerKnobAndLabel(x, y, power[i], knobs[i], labels[i], true);
58+
x += uicPowerKnobWidth + uicMargin;
5059
}
5160
}
5261

src/ui/macro-panel.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <sst/jucegui/components/Knob.h>
2020
#include <sst/jucegui/components/Label.h>
2121
#include <sst/jucegui/components/ToggleButton.h>
22+
#include <sst/jucegui/component-adapters/DiscreteToReference.h>
2223
#include <sst/jucegui/data/Continuous.h>
2324
#include "six-sines-editor.h"
2425
#include "patch-data-bindings.h"
@@ -37,9 +38,17 @@ struct MacroPanel : jcmp::NamedPanel, HasEditor
3738

3839
void beginEdit(size_t idx);
3940

40-
std::array<std::unique_ptr<jcmp::Knob>, numOps> knobs;
41-
std::array<std::unique_ptr<PatchContinuous>, numOps> knobsData;
42-
std::array<std::unique_ptr<jcmp::Label>, numOps> labels;
41+
std::array<std::unique_ptr<jcmp::Knob>, numMacros> knobs;
42+
std::array<std::unique_ptr<PatchContinuous>, numMacros> knobsData;
43+
std::array<std::unique_ptr<jcmp::Label>, numMacros> labels;
44+
45+
// Placeholder power toggles — not yet wired to any patch data.
46+
std::array<bool, numMacros> powerOnState{};
47+
std::array<std::unique_ptr<sst::jucegui::component_adapters::DiscreteToValueReference<
48+
jcmp::ToggleButton, bool>>,
49+
numMacros>
50+
powerD;
51+
std::array<jcmp::ToggleButton *, numOps> power{};
4352
};
4453
} // namespace baconpaul::six_sines::ui
4554
#endif // Macro_PANE_H

src/ui/main-panel.cpp

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,6 @@ MainPanel::MainPanel(SixSinesEditor &e) : jcmp::NamedPanel("Main"), HasEditor(e)
5454
w->editor.fineTuneSubPanel->repaint();
5555
};
5656

57-
voiceCount = std::make_unique<jcmp::Label>();
58-
addAndMakeVisible(*voiceCount);
59-
setVoiceCount(0);
60-
61-
playScreenD = std::make_unique<
62-
sst::jucegui::component_adapters::DiscreteToValueReference<jcmp::ToggleButton, bool>>(
63-
isPlayScreenShowing);
64-
playScreen = playScreenD->widget.get();
65-
playScreen->setDrawMode(sst::jucegui::components::ToggleButton::DrawMode::GLYPH_WITH_BG);
66-
playScreen->setGlyph(sst::jucegui::components::GlyphPainter::SETTINGS);
67-
addAndMakeVisible(*playScreen);
68-
playScreenD->onValueChanged = [this](bool b)
69-
{
70-
if (b)
71-
{
72-
beginEdit(3);
73-
}
74-
};
75-
sst::jucegui::component_adapters::setTraversalId(playScreen, 4);
76-
7757
highlight = std::make_unique<KnobHighlight>(editor);
7858
addChildComponent(*highlight);
7959
}
@@ -89,14 +69,6 @@ void MainPanel::resized()
8969

9070
b = b.withTrimmedLeft(uicKnobSize + uicMargin);
9171
positionKnobAndLabel(b.getX(), b.getY(), tun, tunLabel);
92-
b = b.withTrimmedLeft(uicKnobSize + uicMargin);
93-
94-
positionKnobAndLabel(b.getX(), b.getY(), playScreenD->widget, voiceCount);
95-
96-
// vb = vb.translated(0, uicLabelHeight + uicMargin);
97-
// voiceCount->setBounds(vb);
98-
// vb = vb.translated(0, uicLabelHeight + uicMargin);
99-
// voiceLimit->setBounds(vb);
10072
}
10173

10274
void MainPanel::mouseDown(const juce::MouseEvent &e)
@@ -124,15 +96,8 @@ juce::Rectangle<int> MainPanel::rectangleFor(int idx)
12496

12597
void MainPanel::beginEdit(int which)
12698
{
127-
if (which == 3)
128-
supressPowerOff = true;
12999
editor.hideAllSubPanels();
130-
editor.activateHamburger(which != 3);
131-
supressPowerOff = false;
132-
if (which != 3)
133-
{
134-
playScreenD->setValueFromModel(false);
135-
}
100+
editor.activateHamburger(true);
136101
if (which == 0)
137102
{
138103
editor.mainSubPanel->setVisible(true);
@@ -156,14 +121,6 @@ void MainPanel::beginEdit(int which)
156121
highlight->setBounds(b.getX() + 2 * uicKnobSize + 1.5 * uicMargin, b.getY(),
157122
uicKnobSize + uicMargin, uicLabeledKnobHeight);
158123
}
159-
else if (which == 3)
160-
{
161-
editor.playModeSubPanel->setVisible(true);
162-
editor.singlePanel->setName("Settings");
163-
auto b = getContentArea().reduced(uicMargin, 0);
164-
highlight->setBounds(b.getX() + 3 * uicKnobSize + 2.5 * uicMargin, b.getY(),
165-
uicKnobSize + uicMargin, uicLabeledKnobHeight);
166-
}
167124
highlight->setVisible(true);
168125
highlight->toBack();
169126
}

src/ui/main-panel.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
#ifndef BACONPAUL_SIX_SINES_UI_MAIN_PANEL_H
1717
#define BACONPAUL_SIX_SINES_UI_MAIN_PANEL_H
1818

19-
#include <sst/jucegui/component-adapters/DiscreteToReference.h>
20-
2119
#include "sst/jucegui/components/Label.h"
22-
#include "sst/jucegui/components/VUMeter.h"
2320

2421
#include "six-sines-editor.h"
2522
#include "patch-data-bindings.h"
@@ -39,13 +36,10 @@ struct MainPanel : jcmp::NamedPanel, HasEditor
3936
void beginEdit(int which);
4037

4138
std::unique_ptr<juce::Component> highlight;
42-
bool supressPowerOff{false};
4339
void clearHighlight()
4440
{
4541
if (highlight)
4642
highlight->setVisible(false);
47-
if (playScreenD && !supressPowerOff)
48-
playScreenD->setValueFromModel(false);
4943
}
5044

5145
std::unique_ptr<PatchContinuous> levData;
@@ -59,15 +53,6 @@ struct MainPanel : jcmp::NamedPanel, HasEditor
5953
std::unique_ptr<PatchContinuous> tunData;
6054
std::unique_ptr<jcmp::Knob> tun;
6155
std::unique_ptr<jcmp::Label> tunLabel;
62-
63-
void setVoiceCount(int vc) { voiceCount->setText("V: " + std::to_string(vc)); }
64-
std::unique_ptr<jcmp::Label> voiceCount;
65-
66-
jcmp::ToggleButton *playScreen{nullptr}; // owned by the d. detail to fix up later
67-
std::unique_ptr<
68-
sst::jucegui::component_adapters::DiscreteToValueReference<jcmp::ToggleButton, bool>>
69-
playScreenD;
70-
bool isPlayScreenShowing{false};
7156
};
7257
} // namespace baconpaul::six_sines::ui
7358
#endif // MAIN_PANEL_H

src/ui/main-sub-panel.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,20 @@ void MainSubPanel::resized()
5656
{
5757
auto p = getLocalBounds().reduced(uicMargin, 0);
5858
auto r = layoutDAHDSRAt(p.getX(), p.getY());
59-
r = layoutLFOAt(r.getX() + uicMargin, p.getY());
59+
auto r2 = layoutLFOAt(r.getX() + uicMargin, p.getY());
6060

61-
auto depx = r.getX() + uicMargin;
62-
auto depy = r.getY();
61+
auto depx = p.getX();
62+
auto depy = std::min(r.getBottom(), r2.getBottom()) + uicMargin;
6363

6464
namespace jlo = sst::jucegui::layouts;
6565
auto lo = jlo::HList().at(depx, depy).withAutoGap(uicMargin * 2);
6666

67-
auto el = jlo::VList().withWidth(uicSubPanelColumnWidth).withAutoGap(uicMargin);
67+
auto el = jlo::VList().withWidth(uicKnobSize * 2 + uicMargin).withAutoGap(uicMargin);
6868
el.add(titleLabelGaplessLayout(velTitle));
69-
el.add(labelKnobLayout(velSen, velSenL).centerInParent());
70-
el.add(labelKnobLayout(lfoDep, lfoDepL).centerInParent());
69+
auto kl = jlo::HList().withHeight(uicLabeledKnobHeight).withAutoGap(uicMargin);
70+
kl.add(labelKnobLayout(velSen, velSenL).centerInParent());
71+
kl.add(labelKnobLayout(lfoDep, lfoDepL).centerInParent());
72+
el.add(kl);
7173
lo.add(el);
7274

7375
lo.doLayout();

src/ui/mainpan-sub-panel.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,20 @@ void MainPanSubPanel::resized()
5454
{
5555
auto p = getLocalBounds().reduced(uicMargin, 0);
5656
auto pn = layoutDAHDSRAt(p.getX(), p.getY());
57-
auto gh = (pn.getHeight() - 2 * uicPowerButtonSize) / 2;
5857
auto r = layoutLFOAt(pn.getX() + uicMargin, p.getY());
5958

60-
auto depx = r.getX() + uicMargin;
61-
auto depy = r.getY();
59+
auto depx = p.getX();
60+
auto depy = std::min(pn.getBottom(), r.getBottom()) + uicMargin;
6261

6362
namespace jlo = sst::jucegui::layouts;
6463
auto lo = jlo::HList().at(depx, depy).withAutoGap(uicMargin * 2);
6564

66-
auto el = jlo::VList().withWidth(uicSubPanelColumnWidth).withAutoGap(uicMargin);
65+
auto el = jlo::VList().withWidth(uicKnobSize * 2 + uicMargin).withAutoGap(uicMargin);
6766
el.add(titleLabelGaplessLayout(depTitle));
68-
el.add(labelKnobLayout(envDepth, envDepthLL).centerInParent());
69-
el.add(labelKnobLayout(lfoDep, lfoDepL).centerInParent());
67+
auto kl = jlo::HList().withHeight(uicLabeledKnobHeight).withAutoGap(uicMargin);
68+
kl.add(labelKnobLayout(envDepth, envDepthLL).centerInParent());
69+
kl.add(labelKnobLayout(lfoDep, lfoDepL).centerInParent());
70+
el.add(kl);
7071
lo.add(el);
7172

7273
lo.doLayout();

src/ui/matrix-sub-panel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ void MatrixSubPanel::resized()
9191
pn = pn.translated(uicMargin, 0);
9292
auto r = layoutLFOAt(pn.getX(), p.getY());
9393

94-
auto depx = r.getX() + uicMargin;
95-
auto depy = r.getY();
94+
auto depx = p.getX();
95+
auto depy = std::min(pn.getBottom(), r.getBottom()) + uicMargin;
9696

9797
namespace jlo = sst::jucegui::layouts;
9898
auto lo = jlo::HList().at(depx, depy).withAutoGap(uicMargin * 2);

src/ui/mixer-panel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ MixerPanel::MixerPanel(SixSinesEditor &e) : jcmp::NamedPanel("Mixer"), HasEditor
6868
panLabels[i]->setText("Pan");
6969
addAndMakeVisible(*panLabels[i]);
7070

71+
vuMeters[i] = std::make_unique<jcmp::VUMeter>(jcmp::VUMeter::VERTICAL);
72+
addAndMakeVisible(*vuMeters[i]);
73+
7174
sst::jucegui::component_adapters::setTraversalId(power[i].get(), i * 12 + 50);
7275
sst::jucegui::component_adapters::setTraversalId(solo[i].get(), i * 12 + 51);
7376
sst::jucegui::component_adapters::setTraversalId(knobs[i].get(), i * 12 + 52);
@@ -89,6 +92,8 @@ void MixerPanel::resized()
8992
positionPowerKnobSwitchAndLabel(x, y, power[i], solo[i], knobs[i], labels[i]);
9093
solo[i]->setBounds(solo[i]->getBounds().reduced(4, 0).translated(0, -1));
9194
positionKnobAndLabel(x + uicPowerKnobWidth + uicMargin, y, panKnobs[i], panLabels[i]);
95+
auto vuX = x + uicPowerKnobWidth + uicMargin + uicKnobSize + 2 * uicMargin;
96+
vuMeters[i]->setBounds(vuX, y, 13, uicKnobSize);
9297
y += uicLabeledKnobHeight + uicMargin;
9398
}
9499
}

0 commit comments

Comments
 (0)