diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1ba2aca..0caaf81 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,13 +1,29 @@
# Changelog
+## [1.2.0] - 2026-11-19
+
+### Added
+- **Scope only:** a new header button hides the header and controls so only the display is left. Move the mouse over it to get the button that brings them back. Saved with the project.
+- **Hex codes:** every color in Settings has a #RRGGBB box next to its swatch. The short #RGB form works too.
+- **Random colors:** a dice button in Settings gives sidechains 1–3 new colors that are easy to see on the current theme and easy to tell apart.
+
+### Changed
+- The window now resizes up to 7680 × 4320 (it stopped at 3000 × 1600), so it can fill a 4K or 8K screen or a super-ultrawide, even at 100% display scaling.
+- It also goes much smaller, down to 240 × 110 (it stopped at 760 × 360). The header and footer drop less-used controls as it shrinks, and Settings closes when the window gets smaller than it.
+- Every layer now starts at 100% opacity (sidechain layers used to start at 85%). Projects where you changed the opacity keep it.
+- The zoom readout no longer sits under the resize corner.
+
+### Fixed
+- The window now reopens at the size you left it, in the same session and in saved projects. It used to open at 760 × 360 every time. New instances still start at 760 × 360.
+
## [1.1.0] - 2026-11-18
### Added
-- **Sidechain layers:** three optional sidechain inputs, each drawn as its own coloured layer with the same tempo sync as the main input.
+- **Sidechain layers:** three optional sidechain inputs, each drawn as its own colored layer with the same tempo sync as the main input.
- **Layer chips** in the header to show or hide each layer. They also show which inputs are connected.
- **Settings panel** (gear button):
- Theme.
- - Colour picker and opacity for every layer and for the Hold trace.
+ - Color picker and opacity for every layer and for the Hold trace.
- Display options: hover readout, play cursor, 0 dB markers, main layer on top.
- An About section.
- **Themes:** Graphite, Midnight, Phosphor, Daylight.
diff --git a/CLAUDE.md b/CLAUDE.md
index 7ed5714..a1d7116 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -27,15 +27,29 @@ The product page is https://claeslanng.shop/smartscope/ (repo `claeslanng/claesl
- **Display-only low-pass** (zero-phase, run forwards and backwards), which also redraws
while stopped. It never touches the audio.
- **Hold:** a snapshot drawn as a reference trace.
-- **Three optional stereo sidechain inputs**, drawn as coloured layers above the main
+- **Three optional stereo sidechain inputs**, drawn as colored layers above the main
trace (an option puts the main trace on top). Header chips show and hide them.
- **Settings panel (gear button):** theme (Graphite, Midnight, Phosphor, Daylight), a
- colour and opacity per layer and for Hold, display toggles, and About. Everything is
- saved in the project (the `UI` ValueTree child; the theme index is a state property).
+ color (swatch + picker, plus a #RRGGBB hex box) and opacity per layer and for Hold,
+ display toggles, and About. Everything is saved in the project (the `UI` ValueTree
+ child; the theme index is a state property). Needs at least 760 × 352: the editor closes
+ it below that and grays out the gear.
+- **Every layer defaults to 100% opacity** (`UISettings::defaultOpacity`).
+- **Random colors (dice button in Settings), like FL Studio's color dice:** sidechains
+ 1-3 only, never Main. Hues about a third of the wheel apart (at least 72°), saturated
+ but not neon, contrast ≥ 3:1 against the theme's scope background, and clear of the
+ Main and Hold hues. `UISettings::randomSidechainColours`; RenderTest checks the rules.
+- **Scope only (corners button in the header):** hides header and footer, the scope fills
+ the window. A small button in the top-left corner (over the empty bit left of the ruler)
+ appears for 2.5 s after the mouse moves and brings everything back. Saved in the
+ project (`scopeOnly`). No keyboard shortcut: the scope deliberately never takes keyboard
+ focus, so FL keeps its keys.
- **Branding:** "CLAES LANNG PLUGINS" under the logo, in About, and as COMPANY_NAME.
Plugin codes: manufacturer `Clng`, plugin `Smsc`. Don't change them, or saved
projects won't find the plugin.
- **The plugin never changes the audio** (pass-through, zero latency).
+- **US spelling in anything people read** ("color", "colored", "gray"): UI text, tooltips,
+ README, changelog, product page. Code identifiers keep JUCE's `Colour`.
## Code map
@@ -43,9 +57,9 @@ The product page is https://claeslanng.shop/smartscope/ (repo `claeslanng/claesl
Source/PluginProcessor.* capture: tempo sync, window buffer per layer (main + 3 sidechains)
Source/ScopeView.* drawing, grid, zoom/scroll, display low-pass, hold, clip markers
Source/PluginEditor.* window, header (logo, status, layer chips, ?, gear), footer, look-and-feel
-Source/SettingsPanel.* settings overlay and colour pickers
-Source/Themes.h colour themes
-Source/UISettings.h saved display preferences (colours, opacity, visibility, toggles)
+Source/SettingsPanel.* settings overlay and color pickers
+Source/Themes.h color themes
+Source/UISettings.h saved display preferences (colors, opacity, visibility, toggles)
Tests/RenderTest.cpp offline sync checks with a fake host + PNG renders of the UI
```
@@ -84,9 +98,85 @@ release, update the version on the product page in `claeslanng/claeslanng.github
- **v2: inter-instance overlay.** Show another instance's signal (e.g. the kick track)
behind this one without sidechain routing, like Scyllascope's overlays.
-- **Real FL Studio screenshots on the product page.** The README's top image is now a
- real FL Studio screenshot (`docs/images/fl-studio.png`, added by hand, not written by
- RenderTest). The other README images and the product page still use synthetic renders.
+- **Real screenshots.** The product page now uses real FL Studio captures only (since
+ 2026-11-19, done in the website conversation): `main.webp`, `zoom.webp`, four
+ `theme-*.webp`, `settings.webp`, plus `main-share.jpg` for social previews and a short
+ demo video (`drag-loop.mp4`). They're lossless WebP at full size, in
+ `assets/img/smartscope/` in the site repo, framed by a 1 px outline instead of soft
+ shadows (the owner found those low quality). In this repo, the README's
+ `docs/images/fl-studio.png` (top image) and `docs/images/fullscreen.png` ("Make it big")
+ are real captures added by hand. `zoom.png`, `themes.png` and `settings.png` are still
+ RenderTest renders fed with made-up audio. The next item replaces both kinds.
+
+- **RenderTest renders the website screenshots (after 1.2.0).** The owner doesn't want
+ to capture everything by hand for every release. **Don't start this until the 1.2.0
+ features are finished** (the owner's call). Full plan:
+ `smartscope-website-handoff.md` from the website conversation, and the site repo's
+ CLAUDE.md.
+ - **Test audio:** on the **`screenshot-audio`** branch, in `Tests/audio/` (not merged;
+ merge it first when this starts). Both files are 4 bars at 128 BPM (7.5 s), 44.1 kHz
+ stereo, and start on the downbeat at the same sample. A README there says they're
+ under the repo's AGPLv3, and the owner knows the repo is public.
+ - `Smartscope Audio-Visual Test - Kick 1.wav`: one kick per beat, about 175 ms long,
+ 16-bit. It goes into **sidechain 1**.
+ - `Smartscope Audio-Visual Test - Bass 1.wav`: the bass with sidechain ducking
+ already applied, coming back about 4 ms after each kick ends. 24-bit. It goes into
+ the **main input**. (This is the second, tighter take.)
+ - **How:** load both WAVs in RenderTest and run them through the processor with the
+ fake playhead playing at 128 BPM, so the window buffers fill as in FL. Render at
+ **2× scale** (`createComponentSnapshot (bounds, true, 2.0f)`) at a window size that
+ gives about **2280 × 784 px**, the shape of the current site images. Play cursor
+ off; there's no mouse, so there's no hover readout. Layer opacity at 100%.
+ - **Keep it in the RenderTest target.** The shipping VST3 gets no hidden mode, and its
+ audio path isn't touched.
+ - **Output:** lossless PNGs in a folder of their own (e.g. `docs/images/site/`) or as
+ an Actions artifact. The website side converts them to WebP and swaps them in.
+
+ | File | Settings |
+ |---|---|
+ | `site_main.png` | Graphite, length 1/2, playing, SC 1 kick orange, main bass light gray |
+ | `site_zoom.png` | The first ~14 ms of a kick, about Zoom x68 |
+ | `site_theme_graphite.png` | Orange kick, light gray bass (the defaults) |
+ | `site_theme_midnight.png` | Cyan kick (about `#40D0FF`), white bass |
+ | `site_theme_phosphor.png` | Amber kick (about `#FFC23D`), phosphor-green bass (about `#6CFF8A`) |
+ | `site_theme_daylight.png` | Near-black bass, deep blue (`#2563EB`) or red (`#E5484D`) kick; pale colors get lost on the light background |
+ | `site_settings.png` | Settings open, Graphite, **no audio behind it**, 2× so the text is sharp |
+ | `site_drag_####.png` | Frames for the demo video (below) |
+
+ The four theme shots use the same audio, view and position, so only the look
+ changes. The site names the colors in the captions, so people know the colors are
+ chosen separately from the theme.
+ - **Demo video frames:** about Zoom x27 on a two-bar window, playback stopped, a
+ scripted smooth pan of exactly **one beat** (468.75 ms at 128 BPM). Every beat has the
+ same kick, so the last frame matches the first and the video loops without a seam
+ (the current one needed a blend). 30 or 60 fps at 2×. The website side encodes a
+ muted H.264 MP4.
+ - **Page text is tied to the images.** If renders show something different, the site
+ text has to change too: the main caption (kick on SC 1 orange over the bass gray,
+ half a bar), the zoom text ("first 14 ms… zoomed in 68 times", "the bass (white)
+ hasn't started yet"), the video text (x27, two bars, stopped, kick to kick), and the
+ features list.
+ - **Later, optional:** a GitHub Actions job runs RenderTest on each release and pushes
+ the images (and the version number) into `claeslanng/claeslanng.github.io`. It needs a
+ token or deploy key with write access there, added by the owner as a repo secret.
+ - **Until then, hand captures:** enlarge the window to about 2000 px wide (or Windows
+ scaling 200%), press Hold, turn off the play cursor, keep the mouse out, and capture
+ just the plugin without FL's frame. Send PNGs attached in the chat, not Gyazo links.
+ For video, use the Snipping Tool's video mode at full size, starting and ending on the
+ same view.
+ - **Same approach later for PitchScope**, whose site images are small 840 px JPEGs.
+
+## Selling points the owner wants promoted
+
+- **Any size** (240 × 110 up to 7680 × 4320, `minWidth`/`maxWidth` etc. in PluginEditor.h):
+ detach it in FL (the menu item is called **Detached**, under the arrow at the top left
+ of the plugin window) and give it a whole second monitor, TV or tablet, or shrink it to
+ a strip. Pairs with **Scope only**. Keep the README "Make it big" section and the
+ product page's matching section in step with the limits.
+- **Small-window layout:** header drops status, then logo, then chips become dots, then
+ `?`. Footer controls have priorities in `layoutFooter` (labels go first, then zoom,
+ low-pass slider, gain, < >, low-pass; length box and Hold stay). The footer hides when
+ the scope would get under 80 px. RenderTest checks nothing overlaps at 640/480/340/240.
## Verified in FL Studio (2026-11-19, v1.1.0)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 539185f..7d06d0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.22)
-project(Smartscope VERSION 1.1.0)
+project(Smartscope VERSION 1.2.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/README.md b/README.md
index 4d786a8..4cefb5f 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
-
In FL Studio. Top: drums, with the kick (orange), clap (blue) and a perc hit (purple) on sidechains 1 to 3. Bottom: the bass (grey) with the kick on sidechain 2 (blue).
+
In FL Studio. Top: drums, with the kick (orange), clap (blue) and a perc hit (purple) on sidechains 1 to 3. Bottom: the bass (gray) with the kick on sidechain 2 (blue).
---
@@ -38,16 +38,31 @@ The plugin passes audio through unchanged, so it's safe on any track or on the m
| **Window length** | 1/16, 1/8, 1/4, 1/2, 1 bar, 2 bars, 4 bars. |
| **Phase-friendly scale** | One combined trace (L+R) on a linear scale with dB labels. You can see polarity, so it's obvious when kick and bass push against each other. |
| **Sample-level zoom** | Zoom right in to individual samples. The grid switches from note values to milliseconds. |
-| **Sidechain layers** | Route up to three other tracks into Smartscope and see each as its own coloured layer. Typical use: kick over bass. |
+| **Sidechain layers** | Route up to three other tracks into Smartscope and see each as its own colored layer. Typical use: kick over bass. |
| **Display low-pass** | Shows only the low end. It doesn't touch the audio, adds no phase shift or delay, and redraws instantly even when playback is stopped. |
| **Hold** | Keeps a snapshot as a reference trace. Nudge the bass, then compare. |
| **0 dB markers** | Red ticks show where the signal goes above 0 dBFS. |
| **Hover readout** | Time from the start of the window in ms, plus the sample's value, sign and level. |
-| **Themes and colours** | Four themes, plus your own colour and opacity for every layer. Saved with the project. |
+| **Themes and colors** | Four themes, plus your own color (picker or #RRGGBB hex code) and opacity for every layer. A dice button gives the sidechain layers random colors that stay easy to see. Saved with the project. |
+| **Any size** | Drag the corner from a 240 × 110 strip up to 7680 × 4320. Detach the window and give it a whole second monitor, a TV or a tablet, or tuck it into a corner. The controls make room as it shrinks, and the size is saved with the project. |
+| **Scope only** | One click hides the header and controls so only the display is left. |
-
Zoomed in: the bass (grey) starts about 18 ms after the kick (orange).
+
Zoomed in: the bass (gray) starts about 18 ms after the kick (orange).
+
+
+## Make it big
+
+Smartscope resizes freely, up to 7680 × 4320. In FL Studio, choose **Detached** in the plugin window's menu (the small arrow at the top left), drag the window to another screen, and pull the corner until it fills it. A second monitor, a TV or a tablet set up as an extra display all work. The grid adds 1/32 lines and finer dB labels as there's room, and the size is saved with the project.
+
+For the cleanest picture, click the **corners button** in the header (next to **?**). The header and controls disappear and only the display is left. Move the mouse over it and a small button appears in the top-left corner to bring them back. This is saved with the project too.
+
+It also goes small, down to 240 × 110. As the window shrinks, the status text, the logo and the less-used controls step aside, the layer chips become colored dots, and below about 760 × 350 Settings closes (the gear is grayed out until there's room again).
+
+
+
+
Smartscope filling a second monitor: the kick on sidechain 2 (blue) over the bass (gray).
## Sidechain layers in FL Studio
@@ -55,9 +70,9 @@ The plugin passes audio through unchanged, so it's safe on any track or on the m
1. Put Smartscope on the mixer track you want to look at, for example the bass.
2. Select the source track, for example the kick. Then right-click the small arrow under Smartscope's track and choose **Sidechain to this track**.
3. In Smartscope's plugin window, click FL's gear (*Detailed settings*), open **Processing**, and under *Connections* set **Sidechain 1** to the source track's number.
-4. The **SC 1** chip in Smartscope's header lights up and the kick appears as a coloured layer. Repeat for Sidechain 2 and 3.
+4. The **SC 1** chip in Smartscope's header lights up and the kick appears as a colored layer. Repeat for Sidechain 2 and 3.
-Click a chip in the header to show or hide that layer. Colours and opacity are in **Settings**.
+Click a chip in the header to show or hide that layer. Colors and opacity are in **Settings**.
## Mouse
@@ -81,7 +96,8 @@ When the transport is stopped, the scope free-runs at the project tempo while th
The gear button opens **Settings**:
- Theme.
-- Colour picker and opacity for each layer and for the Hold trace.
+- Color picker, hex code (#RRGGBB) and opacity for each layer and for the Hold trace. Every layer starts at 100% opacity.
+- **Random colors** (the dice): new colors for sidechains 1–3, spread around the color wheel and bright enough to read on the current theme. Click again for another set; **Reset colors** goes back to the defaults.
- Display options: hover readout, play cursor, 0 dB markers, main layer on top.
@@ -123,8 +139,8 @@ Source/
PluginProcessor.* audio capture: tempo sync, window buffer, sidechain layers
ScopeView.* waveform drawing, grid, zoom, display low-pass, hold
PluginEditor.* window, header and footer controls, look-and-feel
- SettingsPanel.* themes, layer colours, display options, about
- Themes.h colour themes
+ SettingsPanel.* themes, layer colors, display options, about
+ Themes.h color themes
UISettings.h saved display preferences
Tests/RenderTest.cpp offline sync checks and UI renders
docs/images/ screenshots used in this README
diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp
index 94e1b30..fb791c9 100644
--- a/Source/PluginEditor.cpp
+++ b/Source/PluginEditor.cpp
@@ -4,6 +4,8 @@ namespace
{
constexpr int headerHeight = 36;
constexpr int footerHeight = 46;
+ constexpr int minScopeHeightWithFooter = 80; // below this the footer is hidden
+ constexpr juce::uint32 exitButtonShowMs = 2500; // scope-only: how long the way back stays visible
const char* helpText =
"Mouse over the display\n"
@@ -13,6 +15,9 @@ namespace
"Alt + wheel: window length\n"
"Drag: pan Double-click: reset zoom\n"
"\n"
+ "The corners button shows only the display. Move the mouse over it to get the way back "
+ "(top-left corner).\n"
+ "\n"
"Red ticks at the top mark where the signal goes above 0 dBFS.";
}
@@ -52,6 +57,10 @@ void SmartscopeLookAndFeel::setTheme (const Theme& t)
setColour (juce::TextEditor::backgroundColourId, t.control);
setColour (juce::TextEditor::textColourId, t.text);
setColour (juce::TextEditor::outlineColourId, t.outline);
+ setColour (juce::TextEditor::focusedOutlineColourId, t.accent.withAlpha (0.85f));
+ setColour (juce::TextEditor::highlightColourId, t.accent.withAlpha (0.35f));
+ setColour (juce::TextEditor::highlightedTextColourId, t.text);
+ setColour (juce::CaretComponent::caretColourId, t.text);
}
void SmartscopeLookAndFeel::drawCallOutBoxBackground (juce::CallOutBox&, juce::Graphics& g, const juce::Path& path, juce::Image&)
@@ -200,11 +209,21 @@ SmartscopeAudioProcessorEditor::SmartscopeAudioProcessorEditor (SmartscopeAudioP
helpButton.setTooltip (helpText);
addAndMakeVisible (helpButton);
- settingsButton.setTooltip ("Settings: themes, layer colours, display options");
+ settingsButton.setTooltip ("Settings: themes, layer colors, display options");
settingsButton.setClickingTogglesState (false);
settingsButton.onClick = [this] { toggleSettings(); };
addAndMakeVisible (settingsButton);
+ scopeOnlyButton.setTooltip ("Scope only: hide the header and controls so only the display shows. "
+ "Move the mouse over the display to get the button that brings them back.");
+ scopeOnlyButton.onClick = [this] { setScopeOnly (true); };
+ addAndMakeVisible (scopeOnlyButton);
+
+ exitScopeOnly.setTooltip ("Show the header and controls again");
+ exitScopeOnly.onClick = [this] { setScopeOnly (false); };
+ addChildComponent (exitScopeOnly);
+ addMouseListener (this, true); // to show the way back when the mouse moves in scope-only view
+
// Length
for (int i = 0; i < numLengthChoices; ++i)
lengthBox.addItem (lengthChoices[i].name, i + 1);
@@ -249,9 +268,18 @@ SmartscopeAudioProcessorEditor::SmartscopeAudioProcessorEditor (SmartscopeAudioP
zoomButton.onClick = [this] { scope.resetZoom(); };
addAndMakeVisible (zoomButton);
+ // Small enough to tuck into a corner, big enough to fill an 8K screen or a super-ultrawide
+ // at 100 % display scaling (people detach it and give it a whole monitor). The header and
+ // footer drop less important controls as the window gets smaller.
+ //
+ // Read the saved size first: setResizeLimits() snaps the still 0 x 0 editor to the minimum
+ // size and calls resized(), which would otherwise overwrite the saved size with the minimum.
+ const int startWidth = juce::jlimit (minWidth, maxWidth, proc.editorWidth);
+ const int startHeight = juce::jlimit (minHeight, maxHeight, proc.editorHeight);
setResizable (true, true);
- setResizeLimits (760, 360, 3000, 1600);
- setSize (juce::jlimit (760, 3000, proc.editorWidth), juce::jlimit (360, 1600, proc.editorHeight));
+ setResizeLimits (minWidth, minHeight, maxWidth, maxHeight);
+ setSize (startWidth, startHeight);
+ sizeRestored = true;
applyTheme (proc.themeIndex.load());
@@ -281,6 +309,46 @@ void SmartscopeAudioProcessorEditor::applyTheme (int index)
repaint();
}
+bool SmartscopeAudioProcessorEditor::settingsFit() const
+{
+ return getWidth() >= SettingsPanel::minWidth && getHeight() >= headerHeight + SettingsPanel::minHeight;
+}
+
+bool SmartscopeAudioProcessorEditor::isScopeOnly() const
+{
+ return UISettings::flag (proc.getUISettings(), UISettings::scopeOnlyKey, false);
+}
+
+void SmartscopeAudioProcessorEditor::setScopeOnly (bool shouldBeScopeOnly)
+{
+ proc.getUISettings().setProperty (UISettings::scopeOnlyKey, shouldBeScopeOnly, nullptr);
+ if (shouldBeScopeOnly && settingsPanel != nullptr)
+ toggleSettings();
+ lastMouseMoveMs = 0; // the way back appears on the next mouse move, not straight away
+ resized();
+ repaint();
+}
+
+void SmartscopeAudioProcessorEditor::mouseMove (const juce::MouseEvent&)
+{
+ lastMouseMoveMs = juce::Time::getMillisecondCounter();
+ updateExitButton();
+}
+
+void SmartscopeAudioProcessorEditor::mouseEnter (const juce::MouseEvent& e)
+{
+ mouseMove (e);
+}
+
+void SmartscopeAudioProcessorEditor::updateExitButton()
+{
+ const bool recentlyMoved = lastMouseMoveMs != 0
+ && juce::Time::getMillisecondCounter() - lastMouseMoveMs < exitButtonShowMs;
+ const bool show = isScopeOnly() && (recentlyMoved || exitScopeOnly.isMouseOver());
+ if (show != exitScopeOnly.isVisible())
+ exitScopeOnly.setVisible (show);
+}
+
void SmartscopeAudioProcessorEditor::toggleSettings()
{
if (settingsPanel != nullptr)
@@ -290,6 +358,9 @@ void SmartscopeAudioProcessorEditor::toggleSettings()
return;
}
+ if (! settingsFit() || isScopeOnly())
+ return;
+
settingsPanel = std::make_unique (proc);
settingsPanel->onThemeChanged = [this] (int index) { applyTheme (index); };
settingsPanel->onSettingsChanged = [this]
@@ -348,6 +419,7 @@ void SmartscopeAudioProcessorEditor::timerCallback()
}
lowpassSlider.setAlpha (lowpassButton.getToggleState() ? 1.0f : 0.55f);
+ updateExitButton();
for (auto& c : chips)
{
@@ -363,8 +435,9 @@ void SmartscopeAudioProcessorEditor::paint (juce::Graphics& g)
g.fillAll (t.window);
// Logo, with the maker's name underneath
+ if (! logoArea.isEmpty())
{
- auto r = headerArea.reduced (12, 0).withTrimmedTop (4);
+ auto r = logoArea.withTrimmedTop (4);
auto top = r.removeFromTop (19);
g.setFont (juce::FontOptions (17.0f, juce::Font::bold));
const juce::String a = "Smart", b = "scope";
@@ -381,65 +454,176 @@ void SmartscopeAudioProcessorEditor::paint (juce::Graphics& g)
g.drawText ("CLAES LANNG PLUGINS", r.removeFromTop (11).withWidth (130), juce::Justification::centredLeft);
}
- g.setFont (juce::FontOptions (12.0f));
- g.setColour (statusSynced ? t.accent : t.textDim);
- g.drawText (statusText, statusArea, juce::Justification::centredLeft);
+ if (! statusArea.isEmpty())
+ {
+ g.setFont (juce::FontOptions (12.0f));
+ g.setColour (statusSynced ? t.accent : t.textDim);
+ g.drawText (statusText, statusArea, juce::Justification::centredLeft);
+ }
+ g.setFont (juce::FontOptions (12.0f));
g.setColour (t.textDim);
- g.drawText ("Length", lengthLabelArea, juce::Justification::centredRight);
- g.drawText ("Gain", gainLabelArea, juce::Justification::centredRight);
+ if (! lengthLabelArea.isEmpty()) g.drawText ("Length", lengthLabelArea, juce::Justification::centredRight);
+ if (! gainLabelArea.isEmpty()) g.drawText ("Gain", gainLabelArea, juce::Justification::centredRight);
}
void SmartscopeAudioProcessorEditor::resized()
{
- auto r = getLocalBounds();
- headerArea = r.removeFromTop (headerHeight);
- footerArea = r.removeFromBottom (footerHeight);
+ const bool scopeOnly = isScopeOnly();
- scope.setBounds (r.reduced (8, 0));
+ // Settings can't be laid out in a small window (or when there is no header to close it from)
+ if (settingsPanel != nullptr && (scopeOnly || ! settingsFit()))
+ toggleSettings();
+ settingsButton.setEnabled (settingsFit());
+ settingsButton.setAlpha (settingsFit() ? 1.0f : 0.4f);
+ settingsButton.setTooltip (settingsFit() ? "Settings: themes, layer colors, display options"
+ : "Make the window bigger to open Settings");
- auto h = headerArea.reduced (8, 7);
- settingsButton.setBounds (h.removeFromRight (24));
- h.removeFromRight (4);
- helpButton.setBounds (h.removeFromRight (24));
- h.removeFromRight (12);
- for (int layer = numLayers - 1; layer >= 0; --layer)
+ auto r = getLocalBounds();
+ headerArea = footerArea = statusArea = logoArea = lengthLabelArea = gainLabelArea = {};
+
+ if (scopeOnly)
{
- chips[layer]->setBounds (h.removeFromRight (layer == 0 ? 58 : 52));
- h.removeFromRight (3);
+ scope.setBounds (r);
+ layoutHeader ({});
+ layoutFooter ({});
+ exitScopeOnly.setBounds (3, 1, 38, 18); // over the empty corner left of the time ruler
+ exitScopeOnly.toFront (false);
+ updateExitButton();
+ }
+ else
+ {
+ exitScopeOnly.setVisible (false);
+ headerArea = r.removeFromTop (headerHeight);
+ if (r.getHeight() >= footerHeight + minScopeHeightWithFooter)
+ footerArea = r.removeFromBottom (footerHeight);
+ else
+ r.removeFromBottom (6);
+
+ scope.setBounds (r.reduced (8, 0));
+ layoutHeader (headerArea);
+ layoutFooter (footerArea);
}
- h.removeFromLeft (128);
- statusArea = h.withTrimmedRight (8);
if (settingsPanel != nullptr)
settingsPanel->setBounds (getLocalBounds().withTrimmedTop (headerHeight));
- auto f = footerArea.reduced (8, 9);
- lengthLabelArea = f.removeFromLeft (44);
- f.removeFromLeft (6);
- lengthDown.setBounds (f.removeFromLeft (26));
- f.removeFromLeft (3);
- lengthBox.setBounds (f.removeFromLeft (78));
- f.removeFromLeft (3);
- lengthUp.setBounds (f.removeFromLeft (26));
+ if (sizeRestored) // not during construction, see the constructor
+ {
+ proc.editorWidth = getWidth();
+ proc.editorHeight = getHeight();
+ }
+}
+
+void SmartscopeAudioProcessorEditor::layoutHeader (juce::Rectangle area)
+{
+ const bool show = ! area.isEmpty();
+ for (juce::Component* c : { (juce::Component*) &settingsButton, (juce::Component*) &helpButton,
+ (juce::Component*) &scopeOnlyButton })
+ c->setVisible (show);
+ for (auto& c : chips)
+ c->setVisible (show);
+ if (! show)
+ return;
+
+ // Right to left: gear, ?, scope only, layer chips. Then the logo and status on the left
+ // if there's room. As the window narrows: the status goes first, then the logo, then the
+ // chips shrink to just their coloured dots, then the ? button goes.
+ auto h = area.reduced (8, 7);
+ constexpr int icon = 24, iconGap = 4, chipGap = 3, logoW = 128, statusMinW = 200;
+ const int fullChipsW = 58 + 3 * 52 + numLayers * chipGap + 9;
+ const int dotChipsW = numLayers * (24 + chipGap) + 9;
+ const int iconsW = 3 * icon + 2 * iconGap;
+
+ const bool showHelp = h.getWidth() >= iconsW + dotChipsW;
+ const bool fullChips = h.getWidth() >= iconsW + fullChipsW;
+ const bool showLogo = fullChips && h.getWidth() >= iconsW + fullChipsW + logoW;
+ const bool showStat = showLogo && h.getWidth() >= iconsW + fullChipsW + logoW + statusMinW;
+
+ settingsButton.setBounds (h.removeFromRight (icon));
+ h.removeFromRight (iconGap);
+ helpButton.setVisible (showHelp);
+ if (showHelp)
+ {
+ helpButton.setBounds (h.removeFromRight (icon));
+ h.removeFromRight (iconGap);
+ }
+ scopeOnlyButton.setBounds (h.removeFromRight (icon));
+ h.removeFromRight (9);
+
+ for (int layer = numLayers - 1; layer >= 0; --layer)
+ {
+ chips[layer]->setBounds (h.removeFromRight (fullChips ? (layer == 0 ? 58 : 52) : 24));
+ h.removeFromRight (chipGap);
+ }
+
+ if (showLogo)
+ logoArea = h.removeFromLeft (logoW).withX (area.getX() + 12).withY (area.getY()).withHeight (area.getHeight());
+ if (showStat)
+ statusArea = h.withTrimmedRight (8);
+}
+
+void SmartscopeAudioProcessorEditor::layoutFooter (juce::Rectangle area)
+{
+ // Each control has a priority: when the footer is too narrow, the highest numbers go first.
+ struct Item { juce::Component* comp; juce::Rectangle* label; int width; int group; int priority; };
+ Item items[] = {
+ { nullptr, &lengthLabelArea, 44, 0, 6 },
+ { &lengthDown, nullptr, 26, 0, 2 },
+ { &lengthBox, nullptr, 78, 0, 0 },
+ { &lengthUp, nullptr, 26, 0, 2 },
+ { nullptr, &gainLabelArea, 32, 1, 6 },
+ { &gainSlider, nullptr, 104, 1, 3 },
+ { &lowpassButton, nullptr, 76, 2, 1 },
+ { &lowpassSlider, nullptr, 92, 2, 4 },
+ { &holdButton, nullptr, 56, 3, 0 },
+ { &zoomButton, nullptr, 92, 4, 5 }, // sits on the right
+ };
+ constexpr int innerGap = 4, groupGap = 14, zoomGroup = 4;
- f.removeFromLeft (14);
- gainLabelArea = f.removeFromLeft (32);
- f.removeFromLeft (6);
- gainSlider.setBounds (f.removeFromLeft (104));
+ auto f = area.reduced (8, 9).withTrimmedRight (12); // keep clear of the resize corner
- f.removeFromLeft (16);
- lowpassButton.setBounds (f.removeFromLeft (76));
- f.removeFromLeft (3);
- lowpassSlider.setBounds (f.removeFromLeft (92));
+ auto widthAt = [&] (int level)
+ {
+ int w = 0, lastGroup = -1;
+ for (auto& it : items)
+ {
+ if (it.priority > level) continue;
+ if (lastGroup >= 0) w += (it.group == lastGroup ? innerGap : groupGap);
+ w += it.width;
+ lastGroup = it.group;
+ }
+ return w;
+ };
- f.removeFromLeft (12);
- holdButton.setBounds (f.removeFromLeft (56));
+ int level = area.isEmpty() ? -1 : 6;
+ while (level >= 0 && widthAt (level) > f.getWidth())
+ --level;
- zoomButton.setBounds (f.removeFromRight (92));
+ int lastGroup = -1;
+ for (auto& it : items)
+ {
+ const bool show = it.priority <= level;
+ if (it.comp != nullptr)
+ it.comp->setVisible (show);
+ if (! show)
+ continue;
+
+ juce::Rectangle slot;
+ if (it.group == zoomGroup)
+ {
+ slot = f.removeFromRight (it.width);
+ }
+ else
+ {
+ if (lastGroup >= 0) f.removeFromLeft (it.group == lastGroup ? innerGap : groupGap);
+ slot = f.removeFromLeft (it.width);
+ lastGroup = it.group;
+ }
- proc.editorWidth = getWidth();
- proc.editorHeight = getHeight();
+ if (it.comp != nullptr) it.comp->setBounds (slot);
+ else *it.label = slot;
+ }
}
//==============================================================================
@@ -460,11 +644,15 @@ void LayerChip::paintButton (juce::Graphics& g, bool isOver, bool)
g.drawRoundedRectangle (r, 3.0f, 1.0f);
const float alpha = connected ? (visible ? 1.0f : 0.35f) : 0.25f;
- auto dot = juce::Rectangle (8.0f, 8.0f).withCentre ({ r.getX() + 11.0f, r.getCentreY() });
+ const bool dotOnly = getWidth() < 40; // narrow window: just the coloured dot
+ auto dot = juce::Rectangle (8.0f, 8.0f).withCentre ({ dotOnly ? r.getCentreX() : r.getX() + 11.0f, r.getCentreY() });
g.setColour (colour.withMultipliedAlpha (alpha));
if (visible) g.fillEllipse (dot);
else g.drawEllipse (dot, 1.2f);
+ if (dotOnly)
+ return;
+
g.setColour (t.text.withMultipliedAlpha (connected ? (visible ? 1.0f : 0.5f) : 0.4f));
g.setFont (juce::FontOptions (12.0f));
g.drawText (getName(), r.withTrimmedLeft (19.0f), juce::Justification::centredLeft);
@@ -485,7 +673,7 @@ void LayerChip::updateTooltip()
if (layer == 0)
tip = "Main input (this track). Click to show/hide.";
else if (proc.isLayerConnected (layer))
- tip = juce::String (UISettings::layerLongName (layer)) + ". Click to show/hide. Colours are in Settings.";
+ tip = juce::String (UISettings::layerLongName (layer)) + ". Click to show/hide. Colors are in Settings.";
else
tip = juce::String (UISettings::layerLongName (layer)) + ": nothing connected. Send a mixer track to Smartscope's "
"sidechain input " + juce::String (layer) + " to see it here.";
@@ -531,6 +719,28 @@ void IconButton::paintButton (juce::Graphics& g, bool isOver, bool isDown)
gear.setUsingNonZeroWinding (false);
g.fillPath (gear);
}
+ else if (icon == Icon::expand || icon == Icon::collapse)
+ {
+ // Four corner brackets: pointing out = scope only, pointing in = back to normal
+ const float side = juce::jmin (r.getWidth(), r.getHeight());
+ const float half = side * 0.5f - juce::jmax (3.0f, side * 0.2f);
+ const bool out = icon == Icon::expand;
+ const float arm = half * (out ? 0.55f : 0.45f);
+ juce::Path p;
+ for (float sx : { -1.0f, 1.0f })
+ for (float sy : { -1.0f, 1.0f })
+ {
+ // Corner point of the bracket, and the direction its arms run
+ const float cx = c.x + sx * (out ? half : half - arm);
+ const float cy = c.y + sy * (out ? half : half - arm);
+ const float dx = out ? -sx * arm : sx * arm;
+ const float dy = out ? -sy * arm : sy * arm;
+ p.startNewSubPath (cx + dx, cy);
+ p.lineTo (cx, cy);
+ p.lineTo (cx, cy + dy);
+ }
+ g.strokePath (p, juce::PathStrokeType (1.5f, juce::PathStrokeType::mitered, juce::PathStrokeType::square));
+ }
else
{
g.setFont (juce::FontOptions (14.0f, juce::Font::bold));
diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h
index 5271a03..af20f5b 100644
--- a/Source/PluginEditor.h
+++ b/Source/PluginEditor.h
@@ -57,11 +57,11 @@ class LayerChip : public juce::Button
int layer;
};
-/** Small icon buttons (gear / question mark) drawn as vector shapes. */
+/** Small icon buttons (gear / question mark / scope-only in and out) drawn as vector shapes. */
class IconButton : public juce::Button
{
public:
- enum class Icon { gear, help };
+ enum class Icon { gear, help, expand, collapse };
IconButton (Icon i) : juce::Button ("icon"), icon (i) {}
void paintButton (juce::Graphics&, bool isOver, bool isDown) override;
@@ -83,6 +83,19 @@ class SmartscopeAudioProcessorEditor : public juce::AudioProcessorEditor,
ScopeView& getScopeView() noexcept { return scope; }
void applyTheme (int index);
void toggleSettings();
+ bool isSettingsOpen() const noexcept { return settingsPanel != nullptr; }
+ SettingsPanel* getSettingsPanel() noexcept { return settingsPanel.get(); }
+
+ /** Scope-only view: hides the header and footer so only the oscilloscope shows.
+ Saved with the project. */
+ void setScopeOnly (bool shouldBeScopeOnly);
+ bool isScopeOnly() const;
+
+ /** Smallest and largest window sizes. */
+ static constexpr int minWidth = 240, minHeight = 110, maxWidth = 7680, maxHeight = 4320;
+
+ void mouseMove (const juce::MouseEvent&) override;
+ void mouseEnter (const juce::MouseEvent&) override;
private:
SmartscopeAudioProcessor& proc;
@@ -91,8 +104,12 @@ class SmartscopeAudioProcessorEditor : public juce::AudioProcessorEditor,
ScopeView scope;
- IconButton settingsButton { IconButton::Icon::gear };
- IconButton helpButton { IconButton::Icon::help };
+ IconButton settingsButton { IconButton::Icon::gear };
+ IconButton helpButton { IconButton::Icon::help };
+ IconButton scopeOnlyButton { IconButton::Icon::expand };
+ IconButton exitScopeOnly { IconButton::Icon::collapse }; // floats over the scope in scope-only view
+ juce::uint32 lastMouseMoveMs = 0;
+ bool sizeRestored = false; // true once the saved window size has been applied
std::unique_ptr chips[numLayers];
std::unique_ptr settingsPanel;
@@ -115,10 +132,14 @@ class SmartscopeAudioProcessorEditor : public juce::AudioProcessorEditor,
std::unique_ptr gainAttachment, lowpassHzAttachment;
std::unique_ptr lowpassAttachment;
- juce::Rectangle headerArea, footerArea, statusArea;
+ juce::Rectangle headerArea, footerArea, statusArea, logoArea;
juce::Rectangle lengthLabelArea, gainLabelArea;
void timerCallback() override;
+ void layoutHeader (juce::Rectangle);
+ void layoutFooter (juce::Rectangle);
+ void updateExitButton();
+ bool settingsFit() const;
void updateZoomText();
void stepLength (int delta);
diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h
index 409f51f..895c966 100644
--- a/Source/PluginProcessor.h
+++ b/Source/PluginProcessor.h
@@ -97,8 +97,10 @@ class SmartscopeAudioProcessor : public juce::AudioProcessor
bool isSynced() const noexcept { return synced.load(); }
bool isClamped() const noexcept { return clamped.load(); }
- // Editor size, saved with the project
- int editorWidth = 900, editorHeight = 480;
+ // Editor size, saved with the project. New instances open at 760 x 360, the size
+ // every version up to 1.1 opened at.
+ static constexpr int defaultEditorWidth = 760, defaultEditorHeight = 360;
+ int editorWidth = defaultEditorWidth, editorHeight = defaultEditorHeight;
// Colour theme, saved with the project
std::atomic themeIndex { 0 };
diff --git a/Source/ScopeView.cpp b/Source/ScopeView.cpp
index a936615..09b48f1 100644
--- a/Source/ScopeView.cpp
+++ b/Source/ScopeView.cpp
@@ -489,7 +489,8 @@ void ScopeView::paint (juce::Graphics& g)
if (UISettings::flag (ui, UISettings::showClipKey, true))
drawClipMarkers (g, trace);
- // Peak readout (top right of the trace area)
+ // Peak readout (top right of the trace area), when there's room for it
+ if (trace.getHeight() >= 90.0f && trace.getWidth() >= 200.0f)
{
const bool clipping = windowPeak > 1.0f;
const float peakDb = juce::Decibels::gainToDecibels (windowPeak, -100.0f);
diff --git a/Source/SettingsPanel.cpp b/Source/SettingsPanel.cpp
index da3d43d..d37581f 100644
--- a/Source/SettingsPanel.cpp
+++ b/Source/SettingsPanel.cpp
@@ -63,7 +63,7 @@ SettingsPanel::SettingsPanel (SmartscopeAudioProcessor& p) : proc (p)
{
auto& row = rows[layer];
- row.swatch.setTooltip ("Pick a colour for " + juce::String (UISettings::layerLongName (layer)));
+ row.swatch.setTooltip ("Pick a color for " + juce::String (UISettings::layerLongName (layer)));
row.swatch.onClick = [this, layer]
{
openColourPicker (rows[layer].swatch, UISettings::colourKey (layer),
@@ -71,11 +71,13 @@ SettingsPanel::SettingsPanel (SmartscopeAudioProcessor& p) : proc (p)
};
addAndMakeVisible (row.swatch);
+ setupHexEditor (row.hex, UISettings::colourKey (layer), UISettings::layerLongName (layer));
+
row.opacity.setSliderStyle (juce::Slider::LinearBar);
row.opacity.setTextBoxStyle (juce::Slider::TextBoxLeft, false, 0, 0);
row.opacity.setRange (10.0, 100.0, 1.0);
row.opacity.setTextValueSuffix (" %");
- row.opacity.setDoubleClickReturnValue (true, layer == 0 ? 100.0 : 85.0);
+ row.opacity.setDoubleClickReturnValue (true, UISettings::defaultOpacity * 100.0);
row.opacity.onValueChange = [this, layer]
{
ui().setProperty (UISettings::opacityKey (layer), rows[layer].opacity.getValue() / 100.0, nullptr);
@@ -92,14 +94,20 @@ SettingsPanel::SettingsPanel (SmartscopeAudioProcessor& p) : proc (p)
addAndMakeVisible (row.visible);
}
- holdSwatch.setTooltip ("Pick a colour for the held reference trace");
+ holdSwatch.setTooltip ("Pick a color for the held reference trace");
holdSwatch.onClick = [this]
{
openColourPicker (holdSwatch, UISettings::holdColourKey, UISettings::holdColour (ui(), theme()));
};
addAndMakeVisible (holdSwatch);
+ setupHexEditor (holdHex, UISettings::holdColourKey, "the held reference trace");
+
+ randomButton.setTooltip ("New random colors for sidechains 1-3. They stay easy to see on the current theme "
+ "and easy to tell apart. Click again for another set.");
+ randomButton.onClick = [this] { randomiseSidechainColours(); };
+ addAndMakeVisible (randomButton);
- resetColoursButton.setTooltip ("Back to the default colours and opacity for every layer");
+ resetColoursButton.setTooltip ("Back to the default colors and opacity for every layer");
resetColoursButton.onClick = [this]
{
auto tree = ui();
@@ -133,6 +141,109 @@ SettingsPanel::SettingsPanel (SmartscopeAudioProcessor& p) : proc (p)
SettingsPanel::~SettingsPanel()
{
stopTimer();
+
+ // Keep a code that was typed but not confirmed with Enter, then detach the callbacks:
+ // the editors lose focus while they are being destroyed, after this panel is half gone.
+ auto finish = [this] (juce::TextEditor& ed, const juce::Identifier& key)
+ {
+ juce::Colour c;
+ if (ed.hasKeyboardFocus (true) && UISettings::parseHex (ed.getText(), c) && c != currentColour (key))
+ ui().setProperty (key, c.toString(), nullptr);
+ ed.onFocusLost = nullptr;
+ ed.onReturnKey = nullptr;
+ ed.onEscapeKey = nullptr;
+ };
+ for (int layer = 0; layer < numLayers; ++layer)
+ finish (rows[layer].hex, UISettings::colourKey (layer));
+ finish (holdHex, UISettings::holdColourKey);
+}
+
+juce::Colour SettingsPanel::currentColour (const juce::Identifier& key)
+{
+ if (key == UISettings::holdColourKey)
+ return UISettings::holdColour (ui(), theme());
+
+ for (int layer = 0; layer < numLayers; ++layer)
+ if (key == UISettings::colourKey (layer))
+ return UISettings::layerColour (ui(), layer, theme());
+
+ return juce::Colours::white;
+}
+
+void SettingsPanel::setupHexEditor (juce::TextEditor& ed, const juce::Identifier& key, const juce::String& what)
+{
+ ed.setInputRestrictions (7, "#0123456789abcdefABCDEF");
+ ed.setJustification (juce::Justification::centred);
+ ed.setFont (juce::FontOptions (juce::Font::getDefaultMonospacedFontName(), 12.5f, juce::Font::plain));
+ ed.setIndents (2, 3);
+ ed.setSelectAllWhenFocused (true);
+ ed.setTooltip ("Hex color code for " + what + ", as #RRGGBB. Type or paste a code and press Enter.");
+ ed.onReturnKey = [this, &ed, key] { commitHex (ed, key); ed.giveAwayKeyboardFocus(); };
+ ed.onFocusLost = [this, &ed, key] { commitHex (ed, key); };
+ ed.onEscapeKey = [this, &ed, key]
+ {
+ ed.setText (UISettings::toHex (currentColour (key)), juce::dontSendNotification);
+ ed.giveAwayKeyboardFocus();
+ };
+ addAndMakeVisible (ed);
+}
+
+void SettingsPanel::commitHex (juce::TextEditor& ed, const juce::Identifier& key)
+{
+ juce::Colour c;
+ if (UISettings::parseHex (ed.getText(), c))
+ {
+ if (c != currentColour (key))
+ {
+ ui().setProperty (key, c.toString(), nullptr);
+ changed();
+ }
+ }
+ // Valid or not, show the colour that is actually in use, in the standard #RRGGBB form
+ ed.setText (UISettings::toHex (currentColour (key)), juce::dontSendNotification);
+ refresh();
+}
+
+void SettingsPanel::randomiseSidechainColours()
+{
+ const auto& t = theme();
+ auto tree = ui();
+ const auto picks = UISettings::randomSidechainColours (t, rng, UISettings::layerColour (tree, 0, t),
+ UISettings::holdColour (tree, t));
+ for (int layer = 1; layer < numLayers; ++layer)
+ tree.setProperty (UISettings::colourKey (layer), picks[(size_t) (layer - 1)].toString(), nullptr);
+
+ refresh();
+ changed();
+}
+
+void DiceButton::paintButton (juce::Graphics& g, bool over, bool down)
+{
+ auto& lf = getLookAndFeel();
+ lf.drawButtonBackground (g, *this, juce::Colours::transparentBlack, over, down);
+
+ const auto textColour = findColour (juce::TextButton::textColourOffId);
+ auto r = getLocalBounds().reduced (8, 0);
+
+ g.setFont (juce::FontOptions (13.0f));
+ const int textW = (int) std::ceil (juce::GlyphArrangement::getStringWidth (g.getCurrentFont(), getName()));
+ const int dieSize = juce::jmin (14, getHeight() - 8);
+ const int total = dieSize + 7 + textW;
+ auto content = r.withSizeKeepingCentre (juce::jmin (total, r.getWidth()), getHeight());
+
+ // The die: rounded square with five pips
+ auto die = content.removeFromLeft (dieSize).withSizeKeepingCentre (dieSize, dieSize).toFloat();
+ g.setColour (textColour);
+ g.drawRoundedRectangle (die.reduced (0.5f), 2.5f, 1.2f);
+ const float p = juce::jmax (1.6f, dieSize * 0.15f);
+ auto pip = [&] (float fx, float fy)
+ {
+ g.fillEllipse (die.getX() + die.getWidth() * fx - p * 0.5f, die.getY() + die.getHeight() * fy - p * 0.5f, p, p);
+ };
+ pip (0.28f, 0.28f); pip (0.72f, 0.28f); pip (0.5f, 0.5f); pip (0.28f, 0.72f); pip (0.72f, 0.72f);
+
+ content.removeFromLeft (7);
+ g.drawText (getName(), content, juce::Justification::centredLeft, false);
}
void SettingsPanel::refresh()
@@ -148,6 +259,11 @@ void SettingsPanel::refresh()
row.swatch.colour = UISettings::layerColour (tree, layer, t);
row.swatch.outline = t.outline.brighter (0.3f);
row.swatch.repaint();
+ if (! row.hex.hasKeyboardFocus (true))
+ {
+ row.hex.applyColourToAllText (t.text);
+ row.hex.setText (UISettings::toHex (row.swatch.colour), juce::dontSendNotification);
+ }
row.opacity.setValue (UISettings::layerOpacity (tree, layer) * 100.0, juce::dontSendNotification);
row.visible.setToggleState (UISettings::layerVisible (tree, layer), juce::dontSendNotification);
}
@@ -155,6 +271,11 @@ void SettingsPanel::refresh()
holdSwatch.colour = UISettings::holdColour (tree, t);
holdSwatch.outline = t.outline.brighter (0.3f);
holdSwatch.repaint();
+ if (! holdHex.hasKeyboardFocus (true))
+ {
+ holdHex.applyColourToAllText (t.text);
+ holdHex.setText (UISettings::toHex (holdSwatch.colour), juce::dontSendNotification);
+ }
hoverToggle.setToggleState (UISettings::flag (tree, UISettings::showHoverKey, true), juce::dontSendNotification);
cursorToggle.setToggleState (UISettings::flag (tree, UISettings::showCursorKey, true), juce::dontSendNotification);
@@ -208,7 +329,8 @@ void SettingsPanel::paint (juce::Graphics& g)
g.setFont (juce::FontOptions (11.0f));
g.setColour (t.textDim);
const int headY = layersArea.getY() + 18;
- g.drawText ("Colour", colSwatch, headY, 60, 16, juce::Justification::centredLeft);
+ g.drawText ("Color", colSwatch, headY, 60, 16, juce::Justification::centredLeft);
+ g.drawText ("Hex", colHex + 2, headY, 60, 16, juce::Justification::centredLeft);
g.drawText ("Opacity", colOpacity, headY, 80, 16, juce::Justification::centredLeft);
g.drawText ("Show", colShow, headY, 40, 16, juce::Justification::centredLeft);
@@ -252,7 +374,7 @@ void SettingsPanel::paint (juce::Graphics& g)
g.setFont (juce::FontOptions (11.5f));
g.setColour (t.textDim);
g.drawFittedText ("Sidechain layers: send other mixer tracks into Smartscope's sidechain inputs "
- "1-3 to see them as coloured layers on top of this track.",
+ "1-3 to see them as colored layers on top of this track.",
r.removeFromTop (46).withTrimmedTop (4), juce::Justification::topLeft, 3);
}
@@ -268,28 +390,35 @@ void SettingsPanel::resized()
doneButton.setBounds (title.removeFromRight (70).reduced (0, 1));
inner.removeFromTop (8);
- layersArea = inner.removeFromLeft ((int) (inner.getWidth() * 0.56f));
+ layersArea = inner.removeFromLeft (juce::jmin (440, (int) (inner.getWidth() * 0.58f)));
inner.removeFromLeft (24);
rightArea = inner;
- // Layers table
+ // Layers table: name | swatch | hex | opacity | show
+ constexpr int swatchW = 30, hexW = 74;
colName = layersArea.getX();
- colSwatch = colName + 118;
- colOpacity = colSwatch + 52;
- colShow = juce::jmin (layersArea.getRight() - 30, colOpacity + 140);
- const int opacityW = colShow - colOpacity - 14;
+ colSwatch = colName + 110;
+ colHex = colSwatch + swatchW + 6;
+ colOpacity = colHex + hexW + 10;
+ colShow = layersArea.getRight() - 26;
+ const int opacityW = juce::jmax (40, colShow - colOpacity - 12);
rowTop = layersArea.getY() + 18 + 18;
for (int layer = 0; layer < numLayers; ++layer)
{
const int y = rowTop + layer * rowHeight;
- rows[layer].swatch.setBounds (colSwatch, y + 4, 38, rowHeight - 8);
+ rows[layer].swatch.setBounds (colSwatch, y + 4, swatchW, rowHeight - 8);
+ rows[layer].hex.setBounds (colHex, y + 3, hexW, rowHeight - 6);
rows[layer].opacity.setBounds (colOpacity, y + 3, opacityW, rowHeight - 6);
rows[layer].visible.setBounds (colShow - 2, y + 2, 28, rowHeight - 4);
}
const int holdY = rowTop + numLayers * rowHeight;
- holdSwatch.setBounds (colSwatch, holdY + 4, 38, rowHeight - 8);
- resetColoursButton.setBounds (colOpacity, holdY + 3, opacityW, rowHeight - 6);
+ holdSwatch.setBounds (colSwatch, holdY + 4, swatchW, rowHeight - 8);
+ holdHex.setBounds (colHex, holdY + 3, hexW, rowHeight - 6);
+
+ const int buttonsY = holdY + rowHeight + 4;
+ randomButton.setBounds (colName, buttonsY, 146, rowHeight - 4);
+ resetColoursButton.setBounds (colName + 146 + 8, buttonsY, 118, rowHeight - 4);
// Right column
auto r = rightArea;
diff --git a/Source/SettingsPanel.h b/Source/SettingsPanel.h
index 5a1cee9..ca6060b 100644
--- a/Source/SettingsPanel.h
+++ b/Source/SettingsPanel.h
@@ -24,15 +24,30 @@ class ColourSwatch : public juce::Button
}
};
+//==============================================================================
+/** "Random colors" button with a little die drawn next to the text. */
+class DiceButton : public juce::Button
+{
+public:
+ DiceButton() : juce::Button ("Random colors") {}
+ void paintButton (juce::Graphics&, bool over, bool down) override;
+};
+
//==============================================================================
/** Overlay with themes, layer colours/opacity/visibility, display options and about info. */
class SettingsPanel : public juce::Component,
private juce::Timer
{
public:
+ /** The smallest area the panel can lay itself out in. The editor closes it below this. */
+ static constexpr int minWidth = 760, minHeight = 316;
+
explicit SettingsPanel (SmartscopeAudioProcessor&);
~SettingsPanel() override;
+ /** Give sidechains 1-3 new random colours (the dice button). */
+ void randomiseSidechainColours();
+
void paint (juce::Graphics&) override;
void resized() override;
void mouseDown (const juce::MouseEvent&) override {} // swallow clicks so the scope underneath doesn't react
@@ -53,12 +68,16 @@ class SettingsPanel : public juce::Component,
struct LayerRow
{
ColourSwatch swatch;
+ juce::TextEditor hex;
juce::Slider opacity;
juce::ToggleButton visible;
};
LayerRow rows[numLayers];
ColourSwatch holdSwatch;
- juce::TextButton resetColoursButton { "Reset colours" };
+ juce::TextEditor holdHex;
+ DiceButton randomButton;
+ juce::TextButton resetColoursButton { "Reset colors" };
+ juce::Random rng;
juce::ToggleButton hoverToggle { "Hover readout" };
juce::ToggleButton cursorToggle { "Play cursor" };
@@ -67,12 +86,15 @@ class SettingsPanel : public juce::Component,
juce::Rectangle panelBounds, layersArea, rightArea;
int rowTop = 0, rowHeight = 28;
- int colName = 0, colSwatch = 0, colOpacity = 0, colShow = 0;
+ int colName = 0, colSwatch = 0, colHex = 0, colOpacity = 0, colShow = 0;
const Theme& theme() const { return getTheme (proc.themeIndex.load()); }
juce::ValueTree ui() { return proc.getUISettings(); }
void openColourPicker (juce::Component& anchor, const juce::Identifier& key, juce::Colour current);
+ void setupHexEditor (juce::TextEditor&, const juce::Identifier& key, const juce::String& what);
+ void commitHex (juce::TextEditor&, const juce::Identifier& key);
+ juce::Colour currentColour (const juce::Identifier& key);
void changed();
void timerCallback() override { repaint(); }
diff --git a/Source/UISettings.h b/Source/UISettings.h
index d643cab..29f2cd5 100644
--- a/Source/UISettings.h
+++ b/Source/UISettings.h
@@ -4,6 +4,9 @@
#include
#include "Themes.h"
+#include
+#include
+
/** Display preferences stored in the processor's "UI" ValueTree (saved with the project).
Message thread only. */
namespace UISettings
@@ -39,6 +42,7 @@ namespace UISettings
inline const juce::Identifier showCursorKey { "showCursor" };
inline const juce::Identifier showClipKey { "showClip" };
inline const juce::Identifier mainOnTopKey { "mainOnTop" };
+ inline const juce::Identifier scopeOnlyKey { "scopeOnly" };
inline juce::Colour readColour (const juce::ValueTree& ui, const juce::Identifier& key, juce::Colour fallback)
{
@@ -51,9 +55,11 @@ namespace UISettings
return readColour (ui, colourKey (layer), defaultLayerColour (layer, t));
}
+ inline constexpr float defaultOpacity = 1.0f; // every layer starts fully opaque
+
inline float layerOpacity (const juce::ValueTree& ui, int layer)
{
- return juce::jlimit (0.1f, 1.0f, (float) ui.getProperty (opacityKey (layer), layer == 0 ? 1.0f : 0.85f));
+ return juce::jlimit (0.1f, 1.0f, (float) ui.getProperty (opacityKey (layer), defaultOpacity));
}
inline bool layerVisible (const juce::ValueTree& ui, int layer)
@@ -70,4 +76,101 @@ namespace UISettings
{
return (bool) ui.getProperty (key, fallback);
}
+
+ //==========================================================================
+ // Hex colour codes (#RRGGBB)
+
+ inline juce::String toHex (juce::Colour c)
+ {
+ return "#" + juce::String::toHexString ((int) (c.getARGB() & 0xffffffu)).paddedLeft ('0', 6).toUpperCase();
+ }
+
+ /** Accepts "RRGGBB", "#RRGGBB" and the short "RGB" / "#RGB" form (spaces ignored).
+ Returns false and leaves `out` alone if the text isn't a colour. */
+ inline bool parseHex (const juce::String& text, juce::Colour& out)
+ {
+ auto s = text.removeCharacters (" \t").trimCharactersAtStart ("#");
+ if (s.length() == 3)
+ s = juce::String::charToString (s[0]) + s[0] + s[1] + s[1] + s[2] + s[2];
+ if (s.length() != 6 || ! s.containsOnly ("0123456789abcdefABCDEF"))
+ return false;
+ out = juce::Colour ((juce::uint32) (0xff000000u | (juce::uint32) s.getHexValue32()));
+ return true;
+ }
+
+ //==========================================================================
+ // Random colours for the sidechain layers
+
+ /** WCAG contrast ratio between two colours (1 = none, 21 = black on white). */
+ inline float contrastRatio (juce::Colour a, juce::Colour b)
+ {
+ auto lum = [] (juce::Colour c)
+ {
+ auto ch = [] (juce::uint8 v)
+ {
+ const float x = (float) v / 255.0f;
+ return x <= 0.03928f ? x / 12.92f : std::pow ((x + 0.055f) / 1.055f, 2.4f);
+ };
+ return 0.2126f * ch (c.getRed()) + 0.7152f * ch (c.getGreen()) + 0.0722f * ch (c.getBlue());
+ };
+ const float la = lum (a), lb = lum (b);
+ return (juce::jmax (la, lb) + 0.05f) / (juce::jmin (la, lb) + 0.05f);
+ }
+
+ /** Distance between two hues on the colour wheel (0..0.5, where 0.5 = opposite). */
+ inline float hueDistance (float a, float b)
+ {
+ const float d = std::abs (a - b);
+ return juce::jmin (d, 1.0f - d);
+ }
+
+ inline constexpr float minRandomContrast = 3.0f; // against the scope background
+ inline constexpr float minRandomHueGap = 0.2f; // between the three layers (72 degrees)
+ inline constexpr float minAvoidHueGap = 0.08f; // from the Main and Hold colours (29 degrees)
+
+ /** Three colours for sidechains 1-3, like FL Studio's dice: spread around the colour
+ wheel, saturated but not neon, bright enough to read on the theme's scope background,
+ and kept clear of the hues of `avoidA` / `avoidB` (Main and Hold) if those have a hue. */
+ inline std::array randomSidechainColours (const Theme& t, juce::Random& rng,
+ juce::Colour avoidA, juce::Colour avoidB)
+ {
+ const bool lightBackground = t.scopeBg.getPerceivedBrightness() > 0.5f;
+
+ float avoid[2] {};
+ int numAvoid = 0;
+ for (auto c : { avoidA, avoidB })
+ if (c.getSaturation() > 0.25f)
+ avoid[numAvoid++] = c.getHue();
+
+ for (int attempt = 0; attempt < 500; ++attempt)
+ {
+ std::array out;
+ const float base = rng.nextFloat();
+ bool ok = true;
+
+ for (int i = 0; i < 3 && ok; ++i)
+ {
+ // Roughly a third of the wheel apart, with some wobble so it doesn't look mechanical
+ const float h = std::fmod (base + (float) i / 3.0f + (rng.nextFloat() - 0.5f) * 0.12f + 1.0f, 1.0f);
+ const float s = 0.55f + rng.nextFloat() * 0.30f;
+ const float l = lightBackground ? 0.34f + rng.nextFloat() * 0.12f
+ : 0.58f + rng.nextFloat() * 0.12f;
+ out[(size_t) i] = juce::Colour::fromHSL (h, s, l, 1.0f);
+
+ ok = contrastRatio (out[(size_t) i], t.scopeBg) >= minRandomContrast;
+ for (int k = 0; k < numAvoid && ok; ++k)
+ ok = hueDistance (h, avoid[k]) >= minAvoidHueGap;
+ }
+
+ if (ok)
+ {
+ // Shuffle so SC 1 isn't always the "first" hue
+ for (int i = 2; i > 0; --i)
+ std::swap (out[(size_t) i], out[(size_t) rng.nextInt (i + 1)]);
+ return out;
+ }
+ }
+
+ return { defaultLayerColour (1, t), defaultLayerColour (2, t), defaultLayerColour (3, t) };
+ }
}
diff --git a/Tests/RenderTest.cpp b/Tests/RenderTest.cpp
index 93618c8..1a6c6d6 100644
--- a/Tests/RenderTest.cpp
+++ b/Tests/RenderTest.cpp
@@ -167,6 +167,20 @@ static void renderLayers (SmartscopeAudioProcessor& p, FakePlayHead& ph, double
buf.setSample (2, i, (float) kick);
buf.setSample (3, i, (float) kick);
}
+ if (numCh >= 8)
+ {
+ // Clap on beats 2 and 4 (sidechain 2), a short perc hit on the off-beats (sidechain 3)
+ const double tClap = std::fmod ((double) s + spb, 2.0 * spb) / sr;
+ const double clap = tClap < 0.25 ? 0.55 * (juce::Random::getSystemRandom().nextFloat() * 2.0 - 1.0)
+ * std::exp (-tClap * 28.0) : 0.0;
+ const double tPerc = std::fmod ((double) s + 0.5 * spb, spb) / sr;
+ const double perc = 0.45 * std::sin (juce::MathConstants::twoPi * 420.0 * tPerc)
+ * std::exp (-tPerc * 70.0);
+ buf.setSample (4, i, (float) clap);
+ buf.setSample (5, i, (float) clap);
+ buf.setSample (6, i, (float) perc);
+ buf.setSample (7, i, (float) perc);
+ }
}
p.processBlock (buf, midi);
}
@@ -340,12 +354,26 @@ int main()
p2.getUISettings().setProperty (UISettings::colourKey (1), juce::Colour (0xffffd23f).toString(), nullptr);
p2.getUISettings().setProperty (UISettings::opacityKey (0), 0.6, nullptr);
sv.refreshForTest();
- snapshot (*e2, "11_layers_custom_colour");
+ snapshot (*e2, "11_layers_custom_color");
e2->toggleSettings();
snapshot (*e2, "12_settings");
e2->setSize (760, 360);
snapshot (*e2, "13_settings_min");
+ e2->toggleSettings();
+
+ // Big screens: the old 3000 x 1600 cap must be gone, and a 4K window must draw
+ if (auto* c = e2->getConstrainer())
+ {
+ check (c->getMaximumWidth() >= 7680 && c->getMaximumHeight() >= 4320,
+ "resize limit reaches 7680 x 4320");
+ check (c->getMinimumWidth() <= 240 && c->getMinimumHeight() <= 110,
+ "resize limit goes down to 240 x 110");
+ }
+ e2->setSize (3840, 2160);
+ check (e2->getWidth() == 3840 && e2->getHeight() == 2160, "editor can be 3840 x 2160");
+ sv.refreshForTest();
+ snapshot (*e2, "14_layers_4k");
e2.reset();
@@ -371,6 +399,196 @@ int main()
p2.setPlayHead (nullptr);
}
+ //--------------------------------------------------------------------------
+ std::cout << "Colors, hex codes, small windows, scope only" << std::endl;
+ {
+ // Hex codes
+ juce::Colour c;
+ check (UISettings::parseHex ("#556BAA", c) && c == juce::Colour (0xff556baa), "hex #556BAA parses");
+ check (UISettings::parseHex ("73848c", c) && c == juce::Colour (0xff73848c), "hex without # and in lower case parses");
+ check (UISettings::parseHex ("#5ab", c) && c == juce::Colour (0xff55aabb), "short hex #5AB parses as #55AABB");
+ check (! UISettings::parseHex ("#12345", c) && ! UISettings::parseHex ("zzzzzz", c) && ! UISettings::parseHex ("", c),
+ "invalid hex is rejected");
+ check (UISettings::toHex (juce::Colour (0xff0a0b0c)) == "#0A0B0C", "colors are shown as #RRGGBB");
+
+ // Random colours: readable on every theme, spread out, clear of Main and Hold
+ juce::Random rng (1234);
+ bool contrastOk = true, spreadOk = true, avoidOk = true;
+ float worstContrast = 99.0f, worstSpread = 1.0f;
+ for (int ti = 0; ti < numThemes; ++ti)
+ {
+ const auto& th = themes[ti];
+ const auto mainC = UISettings::defaultLayerColour (0, th);
+ for (int run = 0; run < 300; ++run)
+ {
+ const auto cs = UISettings::randomSidechainColours (th, rng, mainC, th.hold);
+ for (int i = 0; i < 3; ++i)
+ {
+ const float cr = UISettings::contrastRatio (cs[(size_t) i], th.scopeBg);
+ worstContrast = juce::jmin (worstContrast, cr);
+ contrastOk = contrastOk && cr >= UISettings::minRandomContrast;
+ for (auto avoidC : { mainC, th.hold })
+ if (avoidC.getSaturation() > 0.25f)
+ avoidOk = avoidOk && UISettings::hueDistance (cs[(size_t) i].getHue(), avoidC.getHue())
+ >= UISettings::minAvoidHueGap - 0.005f;
+ for (int k = i + 1; k < 3; ++k)
+ {
+ const float d = UISettings::hueDistance (cs[(size_t) i].getHue(), cs[(size_t) k].getHue());
+ worstSpread = juce::jmin (worstSpread, d);
+ spreadOk = spreadOk && d >= UISettings::minRandomHueGap - 0.01f;
+ }
+ }
+ }
+ }
+ check (contrastOk, "random colors are readable on every theme (worst contrast " + juce::String (worstContrast, 2) + ")");
+ check (spreadOk, "random colors are spread around the wheel (closest pair " + juce::String (worstSpread * 360.0f, 0) + " deg)");
+ check (avoidOk, "random colors keep clear of the Main and Hold colors");
+
+ // A processor with all three sidechains
+ SmartscopeAudioProcessor p3;
+ auto layout = p3.getBusesLayout();
+ for (int b = 1; b <= 3; ++b)
+ layout.inputBuses.getReference (b) = juce::AudioChannelSet::stereo();
+ check (p3.setBusesLayout (layout), "three stereo sidechains accepted");
+ FakePlayHead ph3;
+ p3.setPlayHead (&ph3);
+ p3.setRateAndBufferSizeDetails (sr, 512);
+ p3.prepareToPlay (sr, 512);
+ if (auto* lp = p3.apvts.getParameter (ParamIDs::length))
+ lp->setValueNotifyingHost (lp->convertTo0to1 (3.0f)); // 1/2 bar
+ renderLayers (p3, ph3, sr, 2.5, 60.0);
+
+ bool allOpaque = true;
+ for (int layer = 0; layer < numLayers; ++layer)
+ allOpaque = allOpaque && UISettings::layerOpacity (p3.getUISettings(), layer) == 1.0f;
+ check (allOpaque, "every layer starts at 100% opacity");
+
+ std::unique_ptr e4 (
+ dynamic_cast (p3.createEditor()));
+ e4->setSize (900, 480);
+ auto& sv = e4->getScopeView();
+ sv.refreshForTest();
+ snapshot (*e4, "15_default_opaque");
+
+ e4->toggleSettings();
+ check (e4->isSettingsOpen(), "Settings opens at 900 x 480");
+ e4->getSettingsPanel()->randomiseSidechainColours();
+ snapshot (*e4, "16_settings_hex_random");
+ e4->toggleSettings();
+ sv.refreshForTest();
+ snapshot (*e4, "17_random_colors");
+
+ e4->toggleSettings();
+ e4->setSize (700, 420);
+ check (! e4->isSettingsOpen(), "Settings closes when the window gets narrower than it");
+ e4->setSize (900, 480);
+ e4->toggleSettings();
+ e4->setSize (900, 340);
+ check (! e4->isSettingsOpen(), "Settings closes when the window gets shorter than it");
+ e4->toggleSettings();
+ check (! e4->isSettingsOpen(), "Settings doesn't open in a window too small for it");
+ e4->setSize (760, 352);
+ e4->toggleSettings();
+ check (e4->isSettingsOpen(), "Settings opens at its minimum, 760 x 352");
+ snapshot (*e4, "18_settings_at_minimum");
+ e4->toggleSettings();
+
+ // Small windows: every visible control inside the window, none overlapping
+ for (auto size : { juce::Point (640, 300), juce::Point (480, 220), juce::Point (340, 160),
+ juce::Point (240, 110) })
+ {
+ e4->setSize (size.x, size.y);
+ sv.refreshForTest();
+ const juce::String tag = juce::String (size.x) + "x" + juce::String (size.y);
+ bool inside = true, apart = true;
+ juce::Array shown;
+ for (auto* ch : e4->getChildren())
+ if (ch->isVisible() && ch != &sv)
+ shown.add (ch); // includes JUCE's resize corner, so nothing may sit under it
+ for (auto* a : shown)
+ {
+ inside = inside && e4->getLocalBounds().contains (a->getBounds());
+ for (auto* b : shown)
+ if (a != b && a->getBounds().intersects (b->getBounds()))
+ apart = false;
+ }
+ check (inside && apart, tag + ": controls fit and don't overlap (" + juce::String (shown.size()) + " shown)");
+ if (! (inside && apart))
+ for (auto* a : shown)
+ std::cout << " '" << a->getName() << "' " << a->getBounds().toString() << std::endl;
+ check (sv.getHeight() >= 60, tag + ": the display keeps at least 60 px of height (" + juce::String (sv.getHeight()) + ")");
+ snapshot (*e4, "19_small_" + tag);
+ }
+
+ // Scope only
+ e4->setSize (900, 480);
+ e4->setScopeOnly (true);
+ sv.refreshForTest();
+ auto countOthers = [&]
+ {
+ int n = 0;
+ for (auto* ch : e4->getChildren())
+ if (ch->isVisible() && ch != &sv && dynamic_cast (ch) == nullptr)
+ ++n;
+ return n;
+ };
+ int others = countOthers();
+ check (sv.getBounds() == e4->getLocalBounds() && others == 0,
+ "scope only: the display fills the window, nothing else shows (apart from the resize corner)");
+ snapshot (*e4, "20_scope_only");
+
+ auto src = juce::Desktop::getInstance().getMainMouseSource();
+ const juce::MouseEvent move (src, { 300.0f, 200.0f }, juce::ModifierKeys(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+ e4.get(), e4.get(), juce::Time::getCurrentTime(), { 300.0f, 200.0f },
+ juce::Time::getCurrentTime(), 0, false);
+ e4->mouseMove (move);
+ others = countOthers();
+ check (others == 1, "scope only: moving the mouse shows the way back");
+ snapshot (*e4, "21_scope_only_mouse");
+
+ juce::MemoryBlock state;
+ p3.getStateInformation (state);
+ SmartscopeAudioProcessor p4;
+ p4.setStateInformation (state.getData(), (int) state.getSize());
+ check (UISettings::flag (p4.getUISettings(), UISettings::scopeOnlyKey, false), "scope only is saved with the project");
+
+ e4->setScopeOnly (false);
+ check (sv.getBounds() != e4->getLocalBounds() && e4->getSettingsPanel() == nullptr,
+ "leaving scope only brings the header and footer back");
+ e4.reset();
+ p3.setPlayHead (nullptr);
+ }
+
+ //--------------------------------------------------------------------------
+ std::cout << "Window size when the plugin opens" << std::endl;
+ {
+ SmartscopeAudioProcessor p5;
+ std::unique_ptr e5 (p5.createEditor());
+ check (e5->getWidth() == 760 && e5->getHeight() == 360,
+ "a new instance opens at 760 x 360 (got " + juce::String (e5->getWidth()) + " x " + juce::String (e5->getHeight()) + ")");
+
+ e5->setSize (1234, 567);
+ e5.reset();
+ e5.reset (p5.createEditor());
+ check (e5->getWidth() == 1234 && e5->getHeight() == 567,
+ "reopening the window keeps its size (got " + juce::String (e5->getWidth()) + " x " + juce::String (e5->getHeight()) + ")");
+ e5.reset();
+
+ juce::MemoryBlock state;
+ p5.getStateInformation (state);
+ SmartscopeAudioProcessor p6;
+ p6.setStateInformation (state.getData(), (int) state.getSize());
+ std::unique_ptr e6 (p6.createEditor());
+ check (e6->getWidth() == 1234 && e6->getHeight() == 567,
+ "a saved project reopens at its saved size (got " + juce::String (e6->getWidth()) + " x " + juce::String (e6->getHeight()) + ")");
+ e6.reset();
+
+ SmartscopeAudioProcessor p7;
+ p7.editorWidth = 100000; p7.editorHeight = 1; // nonsense in a saved project
+ std::unique_ptr e7 (p7.createEditor());
+ check (e7->getWidth() == 7680 && e7->getHeight() == 110, "an out-of-range saved size is clamped to the limits");
+ }
+
std::cout << (failures == 0 ? "ALL CHECKS PASSED" : "SOME CHECKS FAILED") << std::endl;
return failures == 0 ? 0 : 1;
}
diff --git a/docs/images/fullscreen.png b/docs/images/fullscreen.png
new file mode 100644
index 0000000..ea4a27b
Binary files /dev/null and b/docs/images/fullscreen.png differ
diff --git a/docs/images/hero.png b/docs/images/hero.png
index 9bea040..5da9738 100644
Binary files a/docs/images/hero.png and b/docs/images/hero.png differ
diff --git a/docs/images/settings.png b/docs/images/settings.png
index 4f4028e..943df15 100644
Binary files a/docs/images/settings.png and b/docs/images/settings.png differ
diff --git a/docs/images/themes.png b/docs/images/themes.png
index 4ea2f29..ad85ed2 100644
Binary files a/docs/images/themes.png and b/docs/images/themes.png differ
diff --git a/docs/images/zoom.png b/docs/images/zoom.png
index 8cb0321..7f0e908 100644
Binary files a/docs/images/zoom.png and b/docs/images/zoom.png differ