|
@@ -169,7 +169,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
var currentAssetProgress: CMTime = .zero
|
|
var currentAssetProgress: CMTime = .zero
|
|
{
|
|
{
|
|
didSet {
|
|
didSet {
|
|
- BFLog(1, message: "currentAssetProgress=\(currentAssetProgress.seconds)")
|
|
+
|
|
rscurrentManager.currentAssetProgress = currentAssetProgress
|
|
rscurrentManager.currentAssetProgress = currentAssetProgress
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -636,16 +636,85 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+ func layoutsubview() {
|
|
|
|
+ bottomeView.snp.makeConstraints { make in
|
|
|
|
+ make.left.bottom.right.equalToSuperview()
|
|
|
|
+ make.height.equalTo(adapterWidth(width: 180))
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ progreddL.snp.makeConstraints { make in
|
|
|
|
+ make.width.equalTo(100)
|
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
|
+ make.top.equalToSuperview().offset(-5)
|
|
|
|
+ make.height.equalTo(18)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ withDrawBtn.snp.makeConstraints { make in
|
|
|
|
+ make.left.equalToSuperview()
|
|
|
|
+ make.width.height.equalTo(65)
|
|
|
|
+ make.top.equalTo(88)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ recordBtn.snp.makeConstraints { make in
|
|
|
|
+ make.left.equalTo(withDrawBtn.snp.right)
|
|
|
|
+ make.right.equalTo(-65)
|
|
|
|
+ make.height.equalTo(42)
|
|
|
|
+ make.top.equalTo(withDrawBtn).offset(6)
|
|
|
|
+ }
|
|
|
|
+ deleteRecordBtn.snp.makeConstraints { make in
|
|
|
|
+ make.left.equalTo(withDrawBtn.snp.right)
|
|
|
|
+ make.right.equalTo(-65)
|
|
|
|
+ make.height.equalTo(42)
|
|
|
|
+ make.top.equalTo(withDrawBtn).offset(6)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ soundSettingBtn.snp.makeConstraints { make in
|
|
|
|
+ make.right.equalToSuperview().offset(-12)
|
|
|
|
+ make.top.equalToSuperview().offset(98)
|
|
|
|
+ make.width.equalTo(40)
|
|
|
|
+ make.height.equalTo(62)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ subtitleBtn.snp.makeConstraints { make in
|
|
|
|
+ make.right.equalTo(soundSettingBtn)
|
|
|
|
+ make.top.equalTo(soundSettingBtn.snp.bottom).offset(18)
|
|
|
|
+ make.width.equalTo(40)
|
|
|
|
+ make.height.equalTo(62)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ withDrawBtn.imageEdgeInsets = UIEdgeInsets(top: -withDrawBtn.imageView!.height, left: 0, bottom: 0, right: -withDrawBtn.titleLabel!.width)
|
|
|
|
+ withDrawBtn.titleEdgeInsets = UIEdgeInsets(top: withDrawBtn.titleLabel!.height + 2, left: -withDrawBtn.imageView!.width, bottom: 0, right: 0)
|
|
|
|
+
|
|
|
|
+ changeVoiceBtn.imageEdgeInsets = UIEdgeInsets(top: -changeVoiceBtn.imageView!.height - 2, left: 0, bottom: 0, right: -changeVoiceBtn.titleLabel!.width)
|
|
|
|
+ changeVoiceBtn.titleEdgeInsets = UIEdgeInsets(top: changeVoiceBtn.titleLabel!.height + 2, left: -changeVoiceBtn.imageView!.width, bottom: 0, right: 0)
|
|
|
|
+ }
|
|
|
|
+
|
|
func initlizeRecordManager() {
|
|
func initlizeRecordManager() {
|
|
recorderManager = BFVoiceRecordManager()
|
|
recorderManager = BFVoiceRecordManager()
|
|
|
|
|
|
recorderManager?.recorderProgrossHandle = { [weak self] progress in
|
|
recorderManager?.recorderProgrossHandle = { [weak self] progress in
|
|
-
|
|
|
|
self?.drawProgressIndication(progress: (progress.isNaN || progress.isInfinite) ? 0 : progress)
|
|
self?.drawProgressIndication(progress: (progress.isNaN || progress.isInfinite) ? 0 : progress)
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+
|
|
recorderManager?.subtitleRecordHandle = { [weak self] eventCode, recordId, asrResult, audioFilePath, _ in
|
|
recorderManager?.subtitleRecordHandle = { [weak self] eventCode, recordId, asrResult, audioFilePath, _ in
|
|
|
|
|
|
|
|
|
|
@@ -715,7 +784,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+
|
|
recorderManager?.endRecordHandle = { [weak self, weak recorderManager] voideModel, _ in
|
|
recorderManager?.endRecordHandle = { [weak self, weak recorderManager] voideModel, _ in
|
|
if let wself = self, let model = voideModel, FileManager.default.fileExists(atPath: model.wavFilePath ?? "") {
|
|
if let wself = self, let model = voideModel, FileManager.default.fileExists(atPath: model.wavFilePath ?? "") {
|
|
|
|
|
|
@@ -807,7 +876,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
self?.resetCurrentProgress()
|
|
self?.resetCurrentProgress()
|
|
self?.deleteRecordBtn.isHidden = true
|
|
self?.deleteRecordBtn.isHidden = true
|
|
- self?.recordBtn.isHidden = (self?.itemModels[self?.currItemModelIndex ?? 0].mediaType == .Image && (self?.isEndPlay ?? false)) ? false : (self?.isEndPlay ?? false)
|
|
+ self?.recordBtn.isHidden = (self?.itemModels[self?.currItemModelIndex ?? 0].mediaType != .Video && (self?.isEndPlay ?? false)) ? false : (self?.isEndPlay ?? false)
|
|
}
|
|
}
|
|
wself.currentPlayRecordIndex = -3
|
|
wself.currentPlayRecordIndex = -3
|
|
BFLog(3, message: "重置播放index-\(#function) = \(wself.currentPlayRecordIndex)")
|
|
BFLog(3, message: "重置播放index-\(#function) = \(wself.currentPlayRecordIndex)")
|
|
@@ -929,77 +998,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- func layoutsubview() {
|
|
|
|
- bottomeView.snp.makeConstraints { make in
|
|
|
|
- make.left.bottom.right.equalToSuperview()
|
|
|
|
- make.height.equalTo(adapterWidth(width: 180))
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- progreddL.snp.makeConstraints { make in
|
|
|
|
- make.width.equalTo(100)
|
|
|
|
- make.centerX.equalToSuperview()
|
|
|
|
- make.top.equalToSuperview().offset(-5)
|
|
|
|
- make.height.equalTo(18)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- withDrawBtn.snp.makeConstraints { make in
|
|
|
|
- make.left.equalToSuperview()
|
|
|
|
- make.width.height.equalTo(65)
|
|
|
|
- make.top.equalTo(88)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- recordBtn.snp.makeConstraints { make in
|
|
|
|
- make.left.equalTo(withDrawBtn.snp.right)
|
|
|
|
- make.right.equalTo(-65)
|
|
|
|
- make.height.equalTo(42)
|
|
|
|
- make.top.equalTo(withDrawBtn).offset(6)
|
|
|
|
- }
|
|
|
|
- deleteRecordBtn.snp.makeConstraints { make in
|
|
|
|
- make.left.equalTo(withDrawBtn.snp.right)
|
|
|
|
- make.right.equalTo(-65)
|
|
|
|
- make.height.equalTo(42)
|
|
|
|
- make.top.equalTo(withDrawBtn).offset(6)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- soundSettingBtn.snp.makeConstraints { make in
|
|
|
|
- make.right.equalToSuperview().offset(-12)
|
|
|
|
- make.top.equalToSuperview().offset(98)
|
|
|
|
- make.width.equalTo(40)
|
|
|
|
- make.height.equalTo(62)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- subtitleBtn.snp.makeConstraints { make in
|
|
|
|
- make.right.equalTo(soundSettingBtn)
|
|
|
|
- make.top.equalTo(soundSettingBtn.snp.bottom).offset(18)
|
|
|
|
- make.width.equalTo(40)
|
|
|
|
- make.height.equalTo(62)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- withDrawBtn.imageEdgeInsets = UIEdgeInsets(top: -withDrawBtn.imageView!.height, left: 0, bottom: 0, right: -withDrawBtn.titleLabel!.width)
|
|
|
|
- withDrawBtn.titleEdgeInsets = UIEdgeInsets(top: withDrawBtn.titleLabel!.height + 2, left: -withDrawBtn.imageView!.width, bottom: 0, right: 0)
|
|
|
|
-
|
|
|
|
- changeVoiceBtn.imageEdgeInsets = UIEdgeInsets(top: -changeVoiceBtn.imageView!.height - 2, left: 0, bottom: 0, right: -changeVoiceBtn.titleLabel!.width)
|
|
|
|
- changeVoiceBtn.titleEdgeInsets = UIEdgeInsets(top: changeVoiceBtn.titleLabel!.height + 2, left: -changeVoiceBtn.imageView!.width, bottom: 0, right: 0)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1569,7 +1567,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
recordBtn.alpha = 1
|
|
recordBtn.alpha = 1
|
|
|
|
|
|
isStopAtRecordRange = -1
|
|
isStopAtRecordRange = -1
|
|
- BFLog(1, message: "停在了录音区间外 \(isStopAtRecordRange)")
|
|
+ BFLog(1, message: "停在了录音区间外 \(isStopAtRecordRange), currTime:\(currentAssetProgress.seconds)")
|
|
}
|
|
}
|
|
pauseTime = currentAssetProgress.seconds
|
|
pauseTime = currentAssetProgress.seconds
|
|
}
|
|
}
|