splitEffectOverlay method
Implementation
void splitEffectOverlay(String id, Duration projectTime) {
final index = effectOverlays.indexWhere((e) => e.id == id);
if (index == -1) return;
final effect = effectOverlays[index];
final splitAt = projectTime == Duration.zero ? _currentGlobalTime.value : projectTime;
final currentEnd = effect.effectiveEndTime;
if (splitAt <= effect.startTime || splitAt >= currentEnd) {
return;
}
effectController.updateEffectPosition(id, effect.startTime, splitAt);
final newEffect = effect.copyWith(
id: '${effect.id}_split_${DateTime.now().microsecondsSinceEpoch}',
startTime: splitAt,
endTime: currentEnd,
);
effectController.addEffectOverlay(newEffect);
_saveState();
notifyListeners();
}