diff --git a/App/DrumGrid.h b/App/DrumGrid.h index e8a74e0..b565eb7 100644 --- a/App/DrumGrid.h +++ b/App/DrumGrid.h @@ -109,6 +109,36 @@ class DrumGrid : public juce::Component g.setColour (palette::panelDark); g.setFont (juce::FontOptions (10.0f, juce::Font::bold)); g.drawText ("END " + juce::String (len), endX - flagW, 1, flagW, kRulerH - 2, juce::Justification::centred); + + // the grip on the END line, as in the note grid: three bars between two arrows (drag it left or right) + const auto grip = gripBox(); + g.setColour (brush == Paint::ruler ? colour.brighter (0.4f) : colour); + g.fillRoundedRectangle (grip.toFloat(), 4.0f); + g.setColour (brush == Paint::ruler ? juce::Colours::white : palette::panelDark); + g.drawRoundedRectangle (grip.toFloat().reduced (0.5f), 4.0f, 1.5f); + for (int i = -1; i <= 1; ++i) + g.fillRect (grip.getCentreX() + i * 4 - 1, grip.getY() + 8, 2, grip.getHeight() - 16); + const float cy = static_cast (grip.getCentreY()); + juce::Path tri; + tri.addTriangle (static_cast (grip.getX() - 2), cy, static_cast (grip.getX() - 8), cy - 5.0f, static_cast (grip.getX() - 8), cy + 5.0f); + tri.addTriangle (static_cast (grip.getRight() + 2), cy, static_cast (grip.getRight() + 8), cy - 5.0f, static_cast (grip.getRight() + 8), cy + 5.0f); + g.fillPath (tri); + } + + /** The grip box, centred on the END line half way down the lanes. */ + juce::Rectangle gripBox() const + { + const int endX = kNameW + juce::jlimit (1, ksp::model::kSteps, pattern != nullptr ? pattern->length : 16) * kCellW; + return juce::Rectangle (22, 38).withCentre ({ endX, kRulerH + kCellH * kLanes / 2 }); + } + + /** The END line and its grip, below the ruler: grabbing them drags the length instead of painting a hit. */ + bool onEndLine (int x, int y) const + { + if (pattern == nullptr || y < kRulerH) + return false; + const int endX = kNameW + juce::jlimit (1, ksp::model::kSteps, pattern->length) * kCellW; + return std::abs (x - endX) <= 3 || gripBox().expanded (9, 0).contains (x, y); } void mouseMove (const juce::MouseEvent& e) override @@ -120,7 +150,7 @@ class DrumGrid : public juce::Component hoverLane = overName ? lane : -1; repaint(); } - setMouseCursor (e.y < kRulerH && e.x >= kNameW ? juce::MouseCursor::LeftRightResizeCursor + setMouseCursor ((e.y < kRulerH && e.x >= kNameW) || onEndLine (e.x, e.y) ? juce::MouseCursor::LeftRightResizeCursor : overName || e.x >= kNameW ? juce::MouseCursor::PointingHandCursor : juce::MouseCursor::NormalCursor); } @@ -136,10 +166,12 @@ class DrumGrid : public juce::Component brush = Paint::none; if (pattern == nullptr) return; - if (e.y < kRulerH) + if (e.y < kRulerH || onEndLine (e.x, e.y)) { - setLength (e.x); + if (e.y < kRulerH) + setLength (e.x); brush = Paint::ruler; + repaint(); return; } const int lane = laneAt (e.y); @@ -162,7 +194,12 @@ class DrumGrid : public juce::Component apply (laneAt (e.y), stepAt (e.x)); } - void mouseUp (const juce::MouseEvent&) override { brush = Paint::none; } + void mouseUp (const juce::MouseEvent&) override + { + if (brush == Paint::ruler) + repaint(); + brush = Paint::none; + } void mouseWheelMove (const juce::MouseEvent& e, const juce::MouseWheelDetails& w) override { diff --git a/App/Main.cpp b/App/Main.cpp index baa18de..ad3bb66 100644 --- a/App/Main.cpp +++ b/App/Main.cpp @@ -2463,7 +2463,7 @@ class MainComponent : public juce::Component, private juce::Timer void timerCallback() override { updatePendingGlow(); - lenDisplay.setText (juce::String (pattern.length), ksp::ui::palette::trackColour (track() - 1).brighter (0.5f)); + lenDisplay.setText (juce::String (drumView ? drum.length : pattern.length), ksp::ui::palette::trackColour (track() - 1).brighter (0.5f)); bpmDisplay.setText (engine.isRunning() ? juce::String (engine.bpm(), 1) : juce::String ("---")); updateTransportUi(); if (! engine.isRunning()) diff --git a/docs/manual/user/06-instruments.md b/docs/manual/user/06-instruments.md index 828957e..35d1f14 100644 --- a/docs/manual/user/06-instruments.md +++ b/docs/manual/user/06-instruments.md @@ -43,7 +43,7 @@ device; **Test note** plays a C3 on every loaded instrument without the KeyStep. limiter sits at the end. The label under the rows shows the output peak, limiter reduction and the BPM read from the KeyStep's clock. -> **Screenshots pending:** `shot-instruments.png`, `shot-plugins.png`. +![Track cards with an instrument loaded; the plugin key opens its window](img/shot-instruments.png) **Watch out:** a plugin missing on this machine shows **Missing: name** and is kept untouched in the project. Plugin latency is not compensated yet. diff --git a/docs/manual/user/SCREENSHOTS.md b/docs/manual/user/SCREENSHOTS.md index 8c172bd..ee9eb4a 100644 --- a/docs/manual/user/SCREENSHOTS.md +++ b/docs/manual/user/SCREENSHOTS.md @@ -13,12 +13,11 @@ Save as PNG in `img/`, named as below. Add numbered red callouts (1, 2, 3...) ma | `shot-grid.png` | 5 (done) | Grid with a few notes, one selected, knobs lit, note names on keys and notes, in-scale rows tinted (callouts as in `img/grid.svg`) | | `shot-hover-card.png` | 5 (done) | Hover card beside a step | | `shot-end-drag.png` | 5 | END grip on the line, hovered (lit, white outline) with the dimmed area after it | -| `shot-instruments.png` | 6 (use the main-window shot until a closer one exists) | Four track cards (color per track, one selected, others dimmed) with plugins loaded | +| `shot-instruments.png` | 6 (done, 0.6.0) | Four track cards (color per track, one selected, others dimmed) with plugins loaded | | `shot-plugins.png` | 6 (done) | Plugins... window (Hide column) | | `shot-generate.png` | 7 (done) | Generate... window | | `shot-library.png` | 8 (done) | Library window with a few projects | | `shot-close-warning.png` | 8 (done) | The Save / Discard / Cancel dialog | -| `shot-project-map.png` | 9 (outdated: the old overview grid was removed) | Project Map, old Scene matrix; retake as the new Scene Matrix | -| `shot-project-map-timeline.png` | 9 (done) | Project Map, Scene Matrix (was Chain timeline; retake) | +| `shot-project-map-timeline.png` | 9 (done, 0.6.0) | Project Map, Scene Matrix | | `../../../images/fx-window.png` | README (done) | Effects window | | `../../../images/main-window.png` | README (done) | Main window, refreshed for each release | diff --git a/docs/manual/user/img/shot-close-warning.png b/docs/manual/user/img/shot-close-warning.png index 7890199..c494a8b 100644 Binary files a/docs/manual/user/img/shot-close-warning.png and b/docs/manual/user/img/shot-close-warning.png differ diff --git a/docs/manual/user/img/shot-connect.png b/docs/manual/user/img/shot-connect.png index 01af841..72fccd0 100644 Binary files a/docs/manual/user/img/shot-connect.png and b/docs/manual/user/img/shot-connect.png differ diff --git a/docs/manual/user/img/shot-first-run.png b/docs/manual/user/img/shot-first-run.png index 789e778..20f5bce 100644 Binary files a/docs/manual/user/img/shot-first-run.png and b/docs/manual/user/img/shot-first-run.png differ diff --git a/docs/manual/user/img/shot-generate.png b/docs/manual/user/img/shot-generate.png index ce35188..06b2ae4 100644 Binary files a/docs/manual/user/img/shot-generate.png and b/docs/manual/user/img/shot-generate.png differ diff --git a/docs/manual/user/img/shot-grid.png b/docs/manual/user/img/shot-grid.png index 789e778..20f5bce 100644 Binary files a/docs/manual/user/img/shot-grid.png and b/docs/manual/user/img/shot-grid.png differ diff --git a/docs/manual/user/img/shot-hover-card.png b/docs/manual/user/img/shot-hover-card.png index 2541f48..039cc9c 100644 Binary files a/docs/manual/user/img/shot-hover-card.png and b/docs/manual/user/img/shot-hover-card.png differ diff --git a/docs/manual/user/img/shot-instruments.png b/docs/manual/user/img/shot-instruments.png new file mode 100644 index 0000000..8371981 Binary files /dev/null and b/docs/manual/user/img/shot-instruments.png differ diff --git a/docs/manual/user/img/shot-library.png b/docs/manual/user/img/shot-library.png index 8cc0729..ef162b2 100644 Binary files a/docs/manual/user/img/shot-library.png and b/docs/manual/user/img/shot-library.png differ diff --git a/docs/manual/user/img/shot-plugins.png b/docs/manual/user/img/shot-plugins.png index 312f63d..db2b89b 100644 Binary files a/docs/manual/user/img/shot-plugins.png and b/docs/manual/user/img/shot-plugins.png differ diff --git a/docs/manual/user/img/shot-progress.png b/docs/manual/user/img/shot-progress.png index 1eddc8f..1d7d55f 100644 Binary files a/docs/manual/user/img/shot-progress.png and b/docs/manual/user/img/shot-progress.png differ diff --git a/docs/manual/user/img/shot-project-map-timeline.png b/docs/manual/user/img/shot-project-map-timeline.png index a9b76fb..2584e0c 100644 Binary files a/docs/manual/user/img/shot-project-map-timeline.png and b/docs/manual/user/img/shot-project-map-timeline.png differ diff --git a/docs/manual/user/img/shot-project-map.png b/docs/manual/user/img/shot-project-map.png deleted file mode 100644 index 0a7f0aa..0000000 Binary files a/docs/manual/user/img/shot-project-map.png and /dev/null differ diff --git a/docs/manual/user/img/shot-write-confirm.png b/docs/manual/user/img/shot-write-confirm.png index bbb24c3..d513c4e 100644 Binary files a/docs/manual/user/img/shot-write-confirm.png and b/docs/manual/user/img/shot-write-confirm.png differ diff --git a/docs/manual/user/img/shot-write-done.png b/docs/manual/user/img/shot-write-done.png index ef10eda..db2b89b 100644 Binary files a/docs/manual/user/img/shot-write-done.png and b/docs/manual/user/img/shot-write-done.png differ