|
@@ -528,7 +528,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
}
|
|
|
DispatchQueue.main.async { [weak self] in
|
|
|
// 录音完,重绘撤销按钮,更新录音按钮,
|
|
|
- self?.changeWithDrawBtnLayout(true)
|
|
|
+ self?.changeWithDrawBtnLayout(2)
|
|
|
// 注:在录制结束时矫正当前位置,避免跟指针无法对其
|
|
|
if deletedVoices.count == 0 {
|
|
|
self?.indirectionView?.resetCurrentItem(start: model.startTime, end: model.endTime)
|
|
@@ -569,6 +569,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
self?.resetCurrentProgress()
|
|
|
// 移除
|
|
|
self?.indirectionView?.deleteItem(isCurrent: true)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
recorderManager?.NeoNuiDebugHandle = { [weak self] msg in
|
|
@@ -908,6 +909,9 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
resetAllIndirectionView()
|
|
|
}
|
|
|
searchStopAtRecordRange()
|
|
|
+
|
|
|
+ changeWithDrawBtnLayout(3)
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -970,7 +974,16 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
collectionView.isScrollEnabled = true
|
|
|
|
|
|
recorderManager?.stopRecord(isCancel: false)
|
|
|
- changeWithDrawBtnLayout(true)
|
|
|
+// changeWithDrawBtnLayout(2)
|
|
|
+ /*
|
|
|
+ if currentAssetProgress.seconds - (recorderManager?.voiceModel?.startTime ?? 0 ) >= 1.0 {
|
|
|
+ recorderManager?.stopRecord(isCancel: false)
|
|
|
+ changeWithDrawBtnLayout(2)
|
|
|
+ }else{
|
|
|
+ recorderManager?.stopRecord(isCancel: true)
|
|
|
+ changeProgress(progress: Float(recorderManager?.voiceModel?.startTime ?? 0))
|
|
|
+ }
|
|
|
+ */
|
|
|
if !avatarView.isHidden {
|
|
|
avatarView.endRecord()
|
|
|
}
|
|
@@ -1079,10 +1092,11 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
hadPrepareToPlayRecord = false
|
|
|
progressThumV.progress = jumpTime
|
|
|
|
|
|
- if let event = events.last, event.type == 2 {
|
|
|
- changeWithDrawBtnLayout(true)
|
|
|
+ if let event = events.last{
|
|
|
+ changeWithDrawBtnLayout(event.type)
|
|
|
} else {
|
|
|
- changeWithDrawBtnLayout(false)
|
|
|
+ changeWithDrawBtnLayout(0)
|
|
|
+ withDrawBtn.isEnabled = false
|
|
|
}
|
|
|
searchStopAtRecordRange()
|
|
|
let itemModel = itemModels[currItemModelIndex]
|
|
@@ -1111,7 +1125,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
searchStopAtRecordRange()
|
|
|
} else {
|
|
|
events.append(WithDrawModel(type: 1, timestamp: currentAssetProgress.seconds))
|
|
|
- changeWithDrawBtnLayout(false)
|
|
|
+ changeWithDrawBtnLayout(0)
|
|
|
play()
|
|
|
}
|
|
|
}
|
|
@@ -1141,7 +1155,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
BFLog(1, message: "isDragingProgressSlder : \(isDragingProgressSlder)")
|
|
|
BFLog(3, message: "重置播放index-\(#function) = \(currentPlayRecordIndex)")
|
|
|
searchStopAtRecordRange(needAdsorb: true)
|
|
|
- changeWithDrawBtnLayout(false)
|
|
|
+ changeWithDrawBtnLayout(0)
|
|
|
isEndPlay = (progress == 1)
|
|
|
}
|
|
|
|
|
@@ -1151,7 +1165,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
// TODO: 滑动,播放暂停,撤销时,判断是否停止录音区间,是则删除相关录音,画笔,头像,字幕
|
|
|
let elems = itemModels[currItemModelIndex].voiceStickers.enumerated().filter { elem in
|
|
|
- elem.1.startTime <= self.currentAssetProgress.seconds && elem.1.endTime > self.currentAssetProgress.seconds
|
|
|
+ (elem.1.startTime + 0.001) <= self.currentAssetProgress.seconds && (elem.1.endTime - 0.001) > self.currentAssetProgress.seconds
|
|
|
}
|
|
|
|
|
|
isEndPlay = false
|
|
@@ -1594,10 +1608,13 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
// MARK: - 录音对应图像绘制
|
|
|
|
|
|
// 撤销按钮修改title,重绘
|
|
|
- func changeWithDrawBtnLayout(_ recorded: Bool) {
|
|
|
- if recorded {
|
|
|
+ func changeWithDrawBtnLayout(_ type: Int) {
|
|
|
+ switch type {
|
|
|
+ case 3:
|
|
|
+ withDrawBtn.setTitle("撤销删除", for: .normal)
|
|
|
+ case 2:
|
|
|
withDrawBtn.setTitle("撤销录制", for: .normal)
|
|
|
- } else {
|
|
|
+ default:
|
|
|
withDrawBtn.setTitle("回退", for: .normal)
|
|
|
}
|
|
|
withDrawBtn.imageEdgeInsets = UIEdgeInsets(top: -withDrawBtn.imageView!.height, left: 0, bottom: 0, right: -withDrawBtn.titleLabel!.width)
|
|
@@ -1795,7 +1812,7 @@ extension BFRecordScreenController: UICollectionViewDelegate, UICollectionViewDa
|
|
|
recordPlayer?.seek(to: CMTime.zero)
|
|
|
|
|
|
searchStopAtRecordRange()
|
|
|
- changeWithDrawBtnLayout(false)
|
|
|
+ changeWithDrawBtnLayout(0)
|
|
|
pauseTime = 0
|
|
|
if recordItem.mediaType == .VIDEO {
|
|
|
reloadMaterial()
|
|
@@ -1881,7 +1898,7 @@ public extension BFRecordScreenController {
|
|
|
/// 重置进度
|
|
|
func resetCurrentProgress() {
|
|
|
DispatchQueue.main.async { [weak self] in
|
|
|
- BFLog(message: "更新录音进度\(#function)-\(self?.currentAssetProgress.seconds ?? 0)")
|
|
|
+ BFLog(1, message: "更新录音进度\(#function)-\(self?.currentAssetProgress.seconds ?? 0)")
|
|
|
self?.progreddL.text = String(format: "%@", (self?.currentAssetProgress.seconds ?? 0).formatDurationToHMS())
|
|
|
self?.progressThumV.progress = (self?.currentAssetProgress.seconds ?? 0)
|
|
|
self?.updateSubtitle(time: self?.currentAssetProgress ?? CMTime.zero)
|