Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions App/DrumGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<float> (grip.getCentreY());
juce::Path tri;
tri.addTriangle (static_cast<float> (grip.getX() - 2), cy, static_cast<float> (grip.getX() - 8), cy - 5.0f, static_cast<float> (grip.getX() - 8), cy + 5.0f);
tri.addTriangle (static_cast<float> (grip.getRight() + 2), cy, static_cast<float> (grip.getRight() + 8), cy - 5.0f, static_cast<float> (grip.getRight() + 8), cy + 5.0f);
g.fillPath (tri);
}

/** The grip box, centred on the END line half way down the lanes. */
juce::Rectangle<int> gripBox() const
{
const int endX = kNameW + juce::jlimit (1, ksp::model::kSteps, pattern != nullptr ? pattern->length : 16) * kCellW;
return juce::Rectangle<int> (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
Expand All @@ -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);
}
Expand All @@ -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);
Expand All @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion App/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/user/06-instruments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 2 additions & 3 deletions docs/manual/user/SCREENSHOTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Binary file modified docs/manual/user/img/shot-close-warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-first-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-generate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-hover-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/manual/user/img/shot-instruments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-plugins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-project-map-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/manual/user/img/shot-project-map.png
Binary file not shown.
Binary file modified docs/manual/user/img/shot-write-confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual/user/img/shot-write-done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading