Ahhhh I decided to have another go at it. I think I've solved it but unsure if the code is a little messy. I was thinking along the correct lines before, just I was not following the logic. The problem was that the start position was being applied multiple times to the end position (once for each mic position) whereas it should only be applied once. Here is the modified function.
void apply(const Identifier& id)
{
auto value = propertyData.getProperty(id);
if (id == SampleIds::SampleStart)
addDelta(-int(value), { SampleIds::SampleEnd, SampleIds::LoopStart, SampleIds::LoopEnd });
for (auto f : sampleFiles)
{
apply(id, f);
}
propertyData.removeProperty(id, nullptr);
}
The addDelta part was previously in void apply(const Identifier& id, File& fileToUse).
Hoping that improving my C++ foo will make me more useful to the community :) or at least more useful to myself.