Strip FX writes from the Design View mode switch; split view.cpp into park/lanes/reconcile/tracks and add the record-scoped undo repair pass
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
// Managed fixed lanes, REAPER side: minting one lane per mode on a track whose own
|
||||
// content spans modes, driving the active mode's lane audible and every other
|
||||
// managed lane silent+hidden, and recovering ownership from the durable P_LANENAME
|
||||
// on project open. Manual lanes are never minted, driven, renamed or reassigned.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "core/view/view_mode_model.h"
|
||||
#include "shell/view/view_tracks.h"
|
||||
|
||||
// Forward-declared to keep this header SDK-free; the .cpp includes the real SDK header.
|
||||
class ReaProject;
|
||||
|
||||
namespace reasampler {
|
||||
|
||||
// `freeMode` alone decides whether UpdateTimeline is owed (SDK: required after an
|
||||
// I_FREEMODE change); `wrote` is any project write at all, which is what the apply's
|
||||
// undo-point decision reads.
|
||||
struct LaneApplyResult {
|
||||
bool freeMode = false;
|
||||
bool wrote = false;
|
||||
};
|
||||
|
||||
// Reconciles each op's durable laneKey to the track's current ordinal (a
|
||||
// stale/renamed/deleted key is pruned, never mis-driven) and drives C_LANEPLAYS.
|
||||
LaneApplyResult applyLaneOps(const TrackByGuid& handleByGuid,
|
||||
const std::vector<LanePlayOp>& lanes);
|
||||
|
||||
// Splits any track visible in more than one mode while carrying its own media into
|
||||
// fixed lanes (one managed lane per involved mode), assigns items, and records
|
||||
// ownership in `model`. Wraps the mutation in one Undo block when non-empty. Returns
|
||||
// true if any lane was minted (repaint hint). `proj` == nullptr means the current
|
||||
// project.
|
||||
bool mintManagedLanes(ViewModeModel& model, ReaProject* proj);
|
||||
|
||||
// Recovers managed-lane ownership from durable P_LANENAME on project open —
|
||||
// self-healing, without minting/reassigning anything and without touching
|
||||
// membership. A lane without the managed prefix is left untouched (manual).
|
||||
// `proj` == nullptr means the current project.
|
||||
void reconcileManagedLanes(ViewModeModel& model, ReaProject* proj);
|
||||
|
||||
} // namespace reasampler
|
||||
Reference in New Issue
Block a user