feat: legible ReaSampler 9000 editor — bigger knobs, ms time constants, per-ring double-click reset, and an antialiased draw pass
This commit is contained in:
@@ -108,6 +108,43 @@ bool ReaSamplerEditor::mouseDownDeck(const FaceLayout& fl, int x, int y) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReaSamplerEditor::doubleClickDeck(const FaceLayout& fl, int x, int y) {
|
||||
const Rect& band = fl.bands.decks;
|
||||
if (!contains(band, x, y)) return false;
|
||||
const DeckLayout dl = layoutDeck(fl.deckDescs, band.x, band.y, band.width);
|
||||
// Resolved against the drawn CIRCLES (hitTestKnobFace), not the cell a drag grabs anywhere
|
||||
// in: the two rings are concentric, so only a radial resolve can tell "reset the exponent"
|
||||
// from "reset the value".
|
||||
const DeckFaceHit hit = hitTestKnobFace(dl, x, y);
|
||||
if (hit.id < 0) return false;
|
||||
if (deckKnobDisabled(hit.id)) return true; // drawn-but-dead: swallow, change nothing
|
||||
// A VELOCITY cell is a popup opener with no scalar value to reset.
|
||||
if (curveTargetFor(hit.id) != CurveTarget::kNone) return true;
|
||||
|
||||
const ParamControl curve = curveParamFor(static_cast<ParamControl>(hit.id));
|
||||
const bool inner = hit.inner && curve != ParamControl::kCount;
|
||||
const int target = inner ? static_cast<int>(curve) : hit.id;
|
||||
// The processor-side knobs own their own defaults — they never reach the parameter set.
|
||||
if (target == static_cast<int>(ParamControl::kVoiceCount)) {
|
||||
voiceCount_ = kDefaultVoiceCount;
|
||||
processor_->setVoiceCount(voiceCount_);
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
if (target == static_cast<int>(ParamControl::kMasterGain)) {
|
||||
processor_->setMasterGainLinear(1.0);
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
resetParamControl(target);
|
||||
// Same commit tiering a drag of this control takes, so a reset reaches the sounding note
|
||||
// exactly as a drag to the same value would.
|
||||
if (dragCommitsLive(DragKind::kDeckKnob, target)) commitLive();
|
||||
else commitAndReload();
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ReaSamplerEditor::dragDeck(int x, int y) {
|
||||
// Radial knob: grab-anchored vertical drag — knobDragValue maps the y delta from the
|
||||
// value at grab (up = increase), so the value tracks relative motion and never jumps on
|
||||
|
||||
Reference in New Issue
Block a user