fix(D2-W2): correct manual-lane exemption, drop read-only item C_LANEPLAYS write

isOnManualLane predicate now correctly treats unnamed fixed-lane lanes as manual;
item-side C_LANEPLAYS loop removed (SDK read-only); explicit #include <set> in
view_mode_model.cpp; undo-block omission in detectNewContent documented as intentional.
This commit is contained in:
2026-07-23 17:51:55 -04:00
parent af34143107
commit ebdb4eae66
6 changed files with 96 additions and 28 deletions
+11 -19
View File
@@ -31,10 +31,6 @@
#define REAPERAPI_WANT_TrackFX_GetCount
#define REAPERAPI_WANT_TrackFX_GetOffline
#define REAPERAPI_WANT_TrackFX_SetOffline
#define REAPERAPI_WANT_CountTrackMediaItems
#define REAPERAPI_WANT_GetTrackMediaItem
#define REAPERAPI_WANT_GetMediaItemInfo_Value
#define REAPERAPI_WANT_SetMediaItemInfo_Value
#define REAPERAPI_WANT_Undo_BeginBlock2
#define REAPERAPI_WANT_Undo_EndBlock2
#define REAPERAPI_WANT_TrackList_AdjustWindows
@@ -180,25 +176,21 @@ std::map<std::string, int> managedLaneOrdinals(MediaTrack* tr) {
return byKey;
}
// Drives one managed lane on `tr` to `lanePlays` (C_LANEPLAYS value): the track-side
// C_LANEPLAYS:N for lane ordinal `laneIdx`, plus every ITEM on that lane (item-side
// C_LANEPLAYS). Items are matched to the lane by their read-only I_FIXEDLANE ordinal.
// B_FIXEDLANE_HIDDEN is READ-ONLY (SDK) — hide/show follows from C_LANEPLAYS=0/1, never
// written directly. Non-destructive: only reversible play/show flags; no item is moved
// or deleted.
// Drives one managed lane on `tr` to `lanePlays` (C_LANEPLAYS value) via the
// TRACK-SIDE C_LANEPLAYS:N write. Track-side C_LANEPLAYS:N alone produces the
// hide+silence effect for all items on lane N — no per-item write is needed or
// possible (item-side C_LANEPLAYS is marked read-only in the SDK).
// B_FIXEDLANE_HIDDEN is READ-ONLY (SDK) — hide/show follows from C_LANEPLAYS=0/1,
// never written directly. Non-destructive: only reversible play/show flags; no item
// is moved or deleted.
//
// DAW-VERIFY: confirm that track-side C_LANEPLAYS:N alone hides+silences all items
// on lane N without a per-item write. (SDK marks item-side C_LANEPLAYS as read-only;
// the track-side write is the documented mechanism.)
void applyLanePlays(MediaTrack* tr, int laneIdx, int lanePlays) {
char parm[32];
std::snprintf(parm, sizeof(parm), "C_LANEPLAYS:%d", laneIdx);
SetMediaTrackInfo_Value(tr, parm, static_cast<double>(lanePlays));
const int itemCount = CountTrackMediaItems(tr);
for (int i = 0; i < itemCount; ++i) {
MediaItem* it = GetTrackMediaItem(tr, i);
if (!it) continue;
const int itemLane = static_cast<int>(GetMediaItemInfo_Value(it, "I_FIXEDLANE"));
if (itemLane != laneIdx) continue; // item is on a different lane
SetMediaItemInfo_Value(it, "C_LANEPLAYS", static_cast<double>(lanePlays));
}
}
// Applies the plan's managed-lane ops. Groups ops by track, resolves each op's durable