Skip to content

Commit 189cfbd

Browse files
committed
refactor: Update PluginEditor to use mainLayout
1 parent a99cfff commit 189cfbd

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

external/dmt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit dc66506a83c1b38f3a255c042ef1fdd4562c2509
1+
Subproject commit 15c502f99e1ab8bc83dab9a2c23bda5d8574a426

external/tomlplusplus

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit f3f625819a724be76e634efccc9accfca350cc32
1+
Subproject commit e7aaccca3fa3dbde9818ab8313250f3da4976e37

src/app/PluginEditor.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,32 @@
55
PluginEditor::PluginEditor(PluginProcessor& p)
66
: AudioProcessorEditor(&p)
77
, p(p)
8-
, sizeFactor(p.scaleFactor) // reference to processor's scaleFactor
9-
, oscilloscopePanel(p.oscilloscopeFifo, p.apvts)
10-
, compositor("DisFlux", oscilloscopePanel, p.apvts, p.properties, sizeFactor)
8+
, sizeFactor(p.scaleFactor)
9+
, mainLayout({ 1.0 }, { 1.0 })
10+
, compositor("Oscilloscope", mainLayout, p.apvts, p.properties, sizeFactor)
1111
, compositorAttached(true)
1212
{
1313
if (OS_IS_WINDOWS) {
14-
setResizable(false, true);
14+
setResizable(true, true);
1515
}
1616

1717
if (OS_IS_DARWIN) {
18-
setResizable(false, true);
18+
setResizable(true, true);
1919
}
2020

2121
if (OS_IS_LINUX) {
2222
openGLContext.setComponentPaintingEnabled(true);
2323
openGLContext.setContinuousRepainting(false);
2424
openGLContext.attachTo(*getTopLevelComponent());
25+
setResizable(true, true);
2526
}
27+
// Add Panel to Layout
28+
mainLayout.addPanel<dmt::gui::panel::OscilloscopePanel<float>>(
29+
0, 0, 1, 1, p.oscilloscopeFifo, p.apvts);
2630

2731
setConstraints(baseWidth, baseHeight + headerHeight);
2832
addAndMakeVisible(compositor);
29-
setResizable(false, true);
33+
setResizable(true, true);
3034

3135
const auto startWidth = baseWidth * sizeFactor;
3236
const auto startHeight = (baseHeight + headerHeight) * sizeFactor;

src/app/PluginEditor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class PluginEditor
5050
Image image;
5151
bool isResizing = false;
5252
//==============================================================================
53-
dmt::gui::panel::OscilloscopePanel<float> oscilloscopePanel;
53+
dmt::gui::window::Layout mainLayout;
5454
dmt::gui::window::Compositor compositor;
5555
//==============================================================================
5656
juce::Image compositorSnapshot;

0 commit comments

Comments
 (0)