PITCH/RATE deck: Rate and Pitch knobs compounded into one read increment, on a three-state commit predicate and payload v16
This commit is contained in:
@@ -23,11 +23,16 @@ std::vector<DeckGroupDesc> sampleDeckGroups(PlayMode playMode) {
|
||||
const bool trigger = (playMode == PlayMode::Trigger);
|
||||
std::vector<DeckGroupDesc> out;
|
||||
{
|
||||
// PITCH/RATE. The three cells make the knob row 180, which is what the group measures
|
||||
// from; the caption row (caption + gap + two 48px segments) must stay under it, so the
|
||||
// caption reserve has a hard ceiling of 80 — past that the caption row overtakes the knob
|
||||
// row and the group grows past 192. Widening the group is not the answer if the text ever
|
||||
// outgrows 80: narrow the Varisp|Presrv segments to 44 instead.
|
||||
DeckGroupDesc pitch;
|
||||
pitch.id = kGroupPitch;
|
||||
pitch.captionWidth = 38;
|
||||
pitch.captionWidth = 70;
|
||||
pitch.captionToggle = {id(DeckParam::kPitchEngine), 48};
|
||||
pitch.cellIds = {id(DeckParam::kKeyTrack)};
|
||||
pitch.cellIds = {id(DeckParam::kKeyTrack), id(DeckParam::kRate), id(DeckParam::kPitch)};
|
||||
out.push_back(std::move(pitch));
|
||||
}
|
||||
{
|
||||
@@ -131,7 +136,7 @@ std::vector<DeckGroupDesc> sampleDeckGroups(PlayMode playMode) {
|
||||
}
|
||||
|
||||
DeckRow deckRowFor(DeckGroupId group) {
|
||||
// Every enumerator listed and no default, on the same gate isLiveDeckParam below relies on.
|
||||
// Every enumerator listed and no default, on the same gate deckParamCommit below relies on.
|
||||
switch (group) {
|
||||
case kGroupPitch:
|
||||
case kGroupFilter:
|
||||
@@ -180,8 +185,12 @@ DeckParam curveParamFor(DeckParam knob) {
|
||||
}
|
||||
}
|
||||
|
||||
bool isLiveDeckParam(DeckParam id) {
|
||||
LiveCommit deckParamCommit(DeckParam id) {
|
||||
switch (id) {
|
||||
// The one note-on-latched control; the header owns why.
|
||||
case DeckParam::kRate:
|
||||
return LiveCommit::NoteOnLatched;
|
||||
case DeckParam::kPitch:
|
||||
case DeckParam::kAttack:
|
||||
case DeckParam::kHold:
|
||||
case DeckParam::kDecay:
|
||||
@@ -221,7 +230,7 @@ bool isLiveDeckParam(DeckParam id) {
|
||||
case DeckParam::kFilterEnvReleaseCurve:
|
||||
case DeckParam::kFilterTrigAttackCurve:
|
||||
case DeckParam::kFilterTrigDecayCurve:
|
||||
return true;
|
||||
return LiveCommit::Live;
|
||||
// Listed rather than defaulted so a newly added control is a COMPILE error here on
|
||||
// every toolchain — /we4062 on MSVC, -Werror=switch on GCC/Clang, both set on this
|
||||
// library alone in cmake/reasampler_targets.cmake — instead of silently defaulting
|
||||
@@ -249,9 +258,9 @@ bool isLiveDeckParam(DeckParam id) {
|
||||
case DeckParam::kMonoTrigger:
|
||||
case DeckParam::kMasterGain:
|
||||
case DeckParam::kCount: // not a control
|
||||
return false;
|
||||
return LiveCommit::Reload;
|
||||
}
|
||||
return false; // unreachable for a valid enumerator; silences a warning.
|
||||
return LiveCommit::Reload; // unreachable for a valid enumerator; silences a warning.
|
||||
}
|
||||
|
||||
OverlayEnv overlayEnvForRadio(int radioId) {
|
||||
@@ -349,17 +358,18 @@ bool deckKnobInert(DeckParam id, const DeckEnableState& state) {
|
||||
}
|
||||
}
|
||||
|
||||
bool liveCommitFor(LiveDragKind kind, int paramId) {
|
||||
LiveCommit liveCommitFor(LiveDragKind kind, int paramId) {
|
||||
switch (kind) {
|
||||
case LiveDragKind::kDeckKnob:
|
||||
return paramId >= 0 && paramId < static_cast<int>(DeckParam::kCount) &&
|
||||
isLiveDeckParam(static_cast<DeckParam>(paramId));
|
||||
return (paramId >= 0 && paramId < static_cast<int>(DeckParam::kCount))
|
||||
? deckParamCommit(static_cast<DeckParam>(paramId))
|
||||
: LiveCommit::Reload;
|
||||
case LiveDragKind::kEnvNode:
|
||||
return true;
|
||||
return LiveCommit::Live;
|
||||
case LiveDragKind::kOther:
|
||||
return false;
|
||||
return LiveCommit::Reload;
|
||||
}
|
||||
return false;
|
||||
return LiveCommit::Reload;
|
||||
}
|
||||
|
||||
} // namespace reasampler::instrument::ui
|
||||
|
||||
Reference in New Issue
Block a user