fix(m10): item-scope take-FX fingerprint; Windows path case-fold; comments
Item scope now reads the active take's FX chain via TakeFX_* (new fxChainIdentityForItems helper), not the owning track's chain. normalizeSlashes lowercases on _WIN32 for detectParent. Stale comments corrected; case-fold tests added.
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
// * TrackFX_GetFXName(MediaTrack*, int, char*, int) -> bool (~7356)
|
||||
// * TrackFX_GetFXGUID(MediaTrack*, int) -> GUID* (~7348)
|
||||
// * TrackFX_GetEnabled(MediaTrack*, int) -> bool (~7291)
|
||||
// * TakeFX_GetCount(MediaItem_Take*) (~6710)
|
||||
// * TakeFX_GetFXName(MediaItem_Take*, int, char*, int) -> bool (~6758)
|
||||
// * TakeFX_GetFXGUID(MediaItem_Take*, int) -> GUID* (~6750)
|
||||
// * TakeFX_GetEnabled(MediaItem_Take*, int) -> bool (~6718)
|
||||
// * CountSelectedMediaItems / GetSelectedMediaItem (selection reads)
|
||||
// * GetActiveTake(MediaItem*) -> MediaItem_Take* (active take)
|
||||
// * GetMediaItemTake_Source(MediaItem_Take*) -> PCM_source* (~2053)
|
||||
@@ -28,6 +32,10 @@
|
||||
#define REAPERAPI_WANT_TrackFX_GetFXName
|
||||
#define REAPERAPI_WANT_TrackFX_GetFXGUID
|
||||
#define REAPERAPI_WANT_TrackFX_GetEnabled
|
||||
#define REAPERAPI_WANT_TakeFX_GetCount
|
||||
#define REAPERAPI_WANT_TakeFX_GetFXName
|
||||
#define REAPERAPI_WANT_TakeFX_GetFXGUID
|
||||
#define REAPERAPI_WANT_TakeFX_GetEnabled
|
||||
#define REAPERAPI_WANT_CountSelectedMediaItems
|
||||
#define REAPERAPI_WANT_GetSelectedMediaItem
|
||||
#define REAPERAPI_WANT_CountTrackMediaItems
|
||||
@@ -67,6 +75,37 @@ std::string fxChainIdentityForTrack(MediaTrack* tr) {
|
||||
return fxChainIdentity(rows);
|
||||
}
|
||||
|
||||
std::string fxChainIdentityForItems(const std::vector<MediaItem*>& items) {
|
||||
// For Item scope the in-scope chain is each item's active take's FX chain, NOT
|
||||
// the owning track's FX chain (the track chain is out-of-scope and is bypassed
|
||||
// during render). TakeFX_* is the correct family here.
|
||||
std::vector<std::string> perItem;
|
||||
perItem.reserve(items.size());
|
||||
for (MediaItem* it : items) {
|
||||
if (!it) { perItem.push_back(fxChainIdentity({})); continue; }
|
||||
MediaItem_Take* take = GetActiveTake(it);
|
||||
if (!take) { perItem.push_back(fxChainIdentity({})); continue; }
|
||||
std::vector<FxIdentityEntry> rows;
|
||||
const int n = TakeFX_GetCount(take);
|
||||
rows.reserve(static_cast<std::size_t>(n < 0 ? 0 : n));
|
||||
for (int i = 0; i < n; ++i) {
|
||||
FxIdentityEntry e;
|
||||
char nameBuf[512] = {0};
|
||||
if (TakeFX_GetFXName(take, i, nameBuf, static_cast<int>(sizeof(nameBuf))))
|
||||
e.name = nameBuf;
|
||||
if (GUID* g = TakeFX_GetFXGUID(take, i)) {
|
||||
char gb[64] = {0};
|
||||
guidToString(g, gb);
|
||||
e.guid = gb;
|
||||
}
|
||||
e.enabled = TakeFX_GetEnabled(take, i);
|
||||
rows.push_back(std::move(e));
|
||||
}
|
||||
perItem.push_back(fxChainIdentity(rows));
|
||||
}
|
||||
return combineChainIdentities(perItem);
|
||||
}
|
||||
|
||||
namespace {
|
||||
// The active take source file of one item, normalized. Empty if unresolvable.
|
||||
std::string itemSourceFile(MediaItem* it) {
|
||||
|
||||
Reference in New Issue
Block a user