Ω-W1-T5: one overlay↔waveform mapping, and loop marks that tell the truth about their mode
This commit is contained in:
@@ -150,24 +150,24 @@ instrument::ui::WaveMarks ReaSamplerEditor::waveMarksFor(const SetupMarkers& m)
|
||||
w.frame[static_cast<int>(WaveMark::kLoopEnd)] = m.loopEnd;
|
||||
// The crossfade grows LEFT from the seam it closes, which is where it is audible.
|
||||
w.frame[static_cast<int>(WaveMark::kCrossfade)] = m.loopEnd - m.crossfade;
|
||||
// Trigger has no loop at all, so the pair and the fade are ABSENT rather than shown in an
|
||||
// off state — a mark whose gesture the mode does not offer was read as broken, not as off.
|
||||
// Gate keeps the pair whatever the enable says: that is the drag-to-set-loop affordance.
|
||||
// The crossfade mark belongs to an ACTIVE loop: with the enable off there is no seam for it
|
||||
// to sit on, and no length to drag.
|
||||
const bool gate = loopControlsLive();
|
||||
w.present[static_cast<int>(WaveMark::kStart)] = true;
|
||||
w.present[static_cast<int>(WaveMark::kLoopStart)] = true;
|
||||
w.present[static_cast<int>(WaveMark::kLoopEnd)] = true;
|
||||
w.present[static_cast<int>(WaveMark::kCrossfade)] = m.hasLoop;
|
||||
w.present[static_cast<int>(WaveMark::kLoopStart)] = gate;
|
||||
w.present[static_cast<int>(WaveMark::kLoopEnd)] = gate;
|
||||
w.present[static_cast<int>(WaveMark::kCrossfade)] = gate && m.hasLoop;
|
||||
return w;
|
||||
}
|
||||
|
||||
instrument::ui::WaveMarks ReaSamplerEditor::grabbableMarks(const SetupMarkers& m) const {
|
||||
using instrument::ui::WaveMark;
|
||||
instrument::ui::WaveMarks w = waveMarksFor(m);
|
||||
if (!loopControlsLive()) {
|
||||
w.present[static_cast<int>(WaveMark::kLoopStart)] = false;
|
||||
w.present[static_cast<int>(WaveMark::kLoopEnd)] = false;
|
||||
w.present[static_cast<int>(WaveMark::kCrossfade)] = false;
|
||||
}
|
||||
return w;
|
||||
// Drawn IFF grabbable. Kept as its own fold because paint and hit-test stay separate
|
||||
// questions, but do NOT re-add a suppression here: the Gate-with-loop-off marks are drawn
|
||||
// grey precisely so they can still be dragged, and dragging one is what turns the enable on.
|
||||
return waveMarksFor(m);
|
||||
}
|
||||
|
||||
void ReaSamplerEditor::setLoopEnabled(bool on) {
|
||||
|
||||
Reference in New Issue
Block a user