|
@@ -998,20 +998,26 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
// 注:删除录音后图片素材需要回撤指针进度,同时后面录音往前挪
|
|
|
if itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
|
- let currDuration = model.endCMTime.seconds - model.startCMTime.seconds
|
|
|
- itemModels[currItemModelIndex].materialDuraion = itemModels[currItemModelIndex].materialDuraion - currDuration
|
|
|
+ let currDuration = model.endCMTime - model.startCMTime
|
|
|
+ itemModels[currItemModelIndex].materialDuraion = itemModels[currItemModelIndex].materialDuraion - currDuration.seconds
|
|
|
currentAssetProgress = CMTime(seconds: model.startCMTime.seconds, preferredTimescale: 1000)
|
|
|
// 更新进度
|
|
|
resetCurrentProgress()
|
|
|
for (index, item) in itemModels[currItemModelIndex].voiceStickers.enumerated() {
|
|
|
if index >= isStopAtRecordRange {
|
|
|
// 注:开始时间减去duration or 等一前一段录音的结束时间
|
|
|
-// item.startCMTime.seconds -= currDuration
|
|
|
-// item.endCMTime.seconds -= currDuration
|
|
|
- let startTime = item.startCMTime.seconds
|
|
|
- let endTime = item.endCMTime.seconds
|
|
|
- item.startCMTime = CMTime(seconds: startTime - currDuration, preferredTimescale: 1000)
|
|
|
- item.endCMTime = CMTime(seconds: endTime - currDuration, preferredTimescale: 1000)
|
|
|
+ item.startCMTime = item.startCMTime - currDuration
|
|
|
+ item.endCMTime = item.endCMTime - currDuration
|
|
|
+
|
|
|
+ let titlsList = itemModels[currItemModelIndex].titleStickers.filter({ tm in
|
|
|
+ tm.audioFilePath == item.wavFilePath
|
|
|
+ })
|
|
|
+
|
|
|
+ for titleM in titlsList {
|
|
|
+ titleM.timelineIn = titleM.timelineIn - currDuration
|
|
|
+ titleM.timelineOut = titleM.timelineOut - currDuration
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/// 重绘录音进度视图
|