|
@@ -496,6 +496,35 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
btn.addTarget(self, action: #selector(cameraFlipAction), for: .touchUpInside)
|
|
|
return btn
|
|
|
}()
|
|
|
+
|
|
|
+ // 添加音乐设置
|
|
|
+ lazy var addMusicBtn: UIButton = {
|
|
|
+ let btn = UIButton(type: .custom)
|
|
|
+ btn.backgroundColor = UIColor.black
|
|
|
+ btn.layer.cornerRadius = 16
|
|
|
+ btn.setImage(imageInRecordScreenKit(by: "addmusic"), for: .normal)
|
|
|
+ btn.setTitle("选择音乐", for: .normal)
|
|
|
+ btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
|
|
|
+ btn.addTarget(self, action: #selector(addMusicAction), for: .touchUpInside)
|
|
|
+ return btn
|
|
|
+ }()
|
|
|
+
|
|
|
+ lazy var choseMusicPanel: BFChooseMusicView = {
|
|
|
+ let vv = BFChooseMusicView(frame: CGRect(x: 0, y: cScreenHeigth, width: cScreenWidth, height: cScreenHeigth - 200))
|
|
|
+ vv.clickBtnAction = { [weak self] type in
|
|
|
+ guard let wself = self else { return }
|
|
|
+
|
|
|
+ if type == BFChooseMusicViewClickType.sure {
|
|
|
+
|
|
|
+ }else {
|
|
|
+
|
|
|
+ }
|
|
|
+ UIView.animate(withDuration: 0.25) {
|
|
|
+ wself.choseMusicPanel.frame = CGRect(x: 0, y: cScreenHeigth, width: cScreenWidth, height: cScreenHeigth - 200)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return vv
|
|
|
+ }()
|
|
|
|
|
|
// 字幕设置面板
|
|
|
lazy var subtitleSettingView: BFSubtitleSettingView = {
|
|
@@ -743,6 +772,9 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
view.addSubview(bottomeView)
|
|
|
// view.addSubview(subtitleLabel)
|
|
|
+// view.addSubview(addMusicBtn)
|
|
|
+ view.addSubview(choseMusicPanel)
|
|
|
+
|
|
|
view.addSubview(playBtn)
|
|
|
// view.addSubview(avatarView)
|
|
|
// view.addSubview(openCameraBtn)
|
|
@@ -755,6 +787,8 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
}
|
|
|
|
|
|
view.addSubview(cameraFlipBtn)
|
|
|
+
|
|
|
+
|
|
|
view.addSubview(subtitleSettingView)
|
|
|
view.addSubview(audioSettingView)
|
|
|
//??? add key windows?
|
|
@@ -945,6 +979,13 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
make.left.bottom.right.equalToSuperview()
|
|
|
make.height.equalTo(adapterWidth(width: 180))
|
|
|
}
|
|
|
+
|
|
|
+// addMusicBtn.snp.makeConstraints { make in
|
|
|
+// make.centerX.equalToSuperview()
|
|
|
+// make.top.equalTo(soundSettingBtn).offset(-8)
|
|
|
+// make.width.equalTo(100)
|
|
|
+// make.height.equalTo(32)
|
|
|
+// }
|
|
|
|
|
|
progreddL.snp.makeConstraints { make in
|
|
|
make.width.equalTo(100)
|
|
@@ -1443,6 +1484,27 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
rscmanager.cameraFlip()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @objc func addMusicAction() {
|
|
|
+ cShowHUB(superView: nil, msg: "选择音乐")
|
|
|
+
|
|
|
+ soundSettingBtn.isHidden = true
|
|
|
+ cameraFlipBtn.isHidden = true
|
|
|
+ voiceSettingBtn.isHidden = true
|
|
|
+ subtitleBtn.isHidden = true
|
|
|
+ addMusicBtn.isHidden = true
|
|
|
+
|
|
|
+ UIView.animate(withDuration: 0.25) {[weak self] in
|
|
|
+ guard let wself = self else { return }
|
|
|
+ wself.soundSettingBtn.isHidden = false
|
|
|
+ wself.cameraFlipBtn.isHidden = false
|
|
|
+ wself.voiceSettingBtn.isHidden = false
|
|
|
+ wself.subtitleBtn.isHidden = false
|
|
|
+ wself.addMusicBtn.isHidden = false
|
|
|
+
|
|
|
+ wself.choseMusicPanel.frame = CGRect(x: 0, y: 210, width: cScreenWidth, height: cScreenHeigth - 200)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/// 删除指定段落的所有字幕 数据
|
|
|
/// - Parameter voiceModel: 删除的音频数据
|
|
@@ -2005,7 +2067,9 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
//add by ak 使用的音频数据
|
|
|
let useVoiceStickers = itemModels[currItemModelIndex].getUsedVoices()
|
|
|
- if useVoiceStickers.first(where: { m in
|
|
|
+
|
|
|
+ //音量设置判断使用原录音数据
|
|
|
+ if itemModels[currItemModelIndex].voiceStickers.first(where: { m in
|
|
|
CMTimeCompare(m.startCMTime, currentT) <= 0 && CMTimeCompare(currentT, m.endCMTime) <= 0
|
|
|
}) != nil {
|
|
|
if assetPlayer.volume != haveSpeakVolume {
|