|
@@ -423,9 +423,15 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
lazy var musicCutView: BFMusicCutView = {
|
|
|
let musicCutView = BFMusicCutView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
|
|
|
musicCutView.isHidden = true
|
|
|
- musicCutView.cutTimeHandle = {[weak self] startTime ,endTime ,musicInfo in
|
|
|
+ musicCutView.cutTimeHandle = {[weak self] iscancel ,endTime ,musicInfo in
|
|
|
guard let wself = self else { return }
|
|
|
- wself.hadChoosed(music:musicInfo)
|
|
|
+
|
|
|
+ if(!iscancel){
|
|
|
+ wself.hadChoosed(music:musicInfo)
|
|
|
+ }
|
|
|
+
|
|
|
+ //add by ak
|
|
|
+ wself.showOptBtn(isShow: true)
|
|
|
}
|
|
|
return musicCutView
|
|
|
}()
|
|
@@ -559,7 +565,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
vc.cutActionCallback = {[weak self] voiceModel in
|
|
|
guard let wself = self else { return }
|
|
|
-
|
|
|
+ wself.showOptBtn(isShow: false)
|
|
|
wself.showCutView(voiceModel)
|
|
|
}
|
|
|
wself.present(vc, animated: true, completion: nil)
|
|
@@ -572,11 +578,9 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
wself.choseMusicPanel.frame = CGRect(x: 0, y: cScreenHeigth, width: cScreenWidth, height: cScreenHeigth)
|
|
|
|
|
|
- wself.soundSettingBtn.isHidden = false
|
|
|
- wself.cameraFlipBtn.isHidden = false
|
|
|
- wself.voiceSettingBtn.isHidden = false
|
|
|
- wself.subtitleBtn.isHidden = false
|
|
|
- wself.addMusicBtn.isHidden = false
|
|
|
+ if(type != .search){
|
|
|
+ wself.showOptBtn(isShow: true)
|
|
|
+ }
|
|
|
wself.cleanScreen?(false)
|
|
|
}
|
|
|
|
|
@@ -589,12 +593,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
guard let wself = self else { return }
|
|
|
|
|
|
wself.choseMusicPanel.frame = CGRect(x: 0, y: cScreenHeigth, width: cScreenWidth, height: cScreenHeigth)
|
|
|
-
|
|
|
- wself.soundSettingBtn.isHidden = false
|
|
|
- wself.cameraFlipBtn.isHidden = false
|
|
|
- wself.voiceSettingBtn.isHidden = false
|
|
|
- wself.subtitleBtn.isHidden = false
|
|
|
- wself.addMusicBtn.isHidden = false
|
|
|
+
|
|
|
} completion: {[weak self] _ in
|
|
|
guard let wself = self else { return }
|
|
|
wself.showCutView(voiceModel)
|
|
@@ -659,7 +658,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
audioSettingView.callBack = { [weak self] originalVolume, musicVolume in
|
|
|
// BFLog(1, message: "haveSpeak is:\(haveSpeak),noHaveSpeak is:\(noHaveSpeak)")
|
|
|
guard let wself = self else { return }
|
|
|
-
|
|
|
+ wself.showOptBtn(isShow: true)
|
|
|
wself.bgmModel?.volume = Int(musicVolume)
|
|
|
wself.originalVolume = originalVolume / 100.0
|
|
|
wself.choseMusicPanel.musicVolume = Double(musicVolume / 100.0)
|
|
@@ -754,6 +753,21 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
assetPlayer.pause()
|
|
|
recordPlayer.pause()
|
|
|
}
|
|
|
+
|
|
|
+ /// 显示或隐藏功能 btn
|
|
|
+ /// - Parameter isShow: <#isShow description#>
|
|
|
+ func showOptBtn(isShow:Bool){
|
|
|
+
|
|
|
+ soundSettingBtn.isHidden = !isShow
|
|
|
+ cameraFlipBtn.isHidden = !isShow
|
|
|
+ voiceSettingBtn.isHidden = !isShow
|
|
|
+ subtitleBtn.isHidden = !isShow
|
|
|
+ addMusicBtn.isHidden = !isShow
|
|
|
+
|
|
|
+ cleanScreen?(!isShow)
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
@objc func didBecomeActive() {
|
|
|
BFLog(message: "进入活跃状态")
|
|
@@ -877,22 +891,25 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
// 字幕设置回调
|
|
|
subtitleSettingView.subtitleSettingCallBack = { [weak self] subtitileModel in
|
|
|
-
|
|
|
+
|
|
|
if let wself = self{
|
|
|
|
|
|
- //1,设置字幕样式
|
|
|
- wself.setSubtitleStyle(settingModel: subtitileModel.setting)
|
|
|
-
|
|
|
- //2,显示设置文字,不显示设置为空
|
|
|
- if(subtitileModel.setting.subtitleIsShow){
|
|
|
- wself.updateSubtitle(time: wself.currentAssetProgress)
|
|
|
- }else{
|
|
|
- wself.subtitleLabel.text = ""
|
|
|
- }
|
|
|
-
|
|
|
- // mdf by ak 这里是设置字幕开关回调
|
|
|
- if wself.subTitleBtnClickHandle != nil {
|
|
|
- wself.subTitleBtnClickHandle!(subtitileModel.setting.subtitleIsShow)
|
|
|
+ wself.showOptBtn(isShow: true)
|
|
|
+ if(subtitileModel != nil){
|
|
|
+ //1,设置字幕样式
|
|
|
+ wself.setSubtitleStyle(settingModel: subtitileModel!.setting)
|
|
|
+
|
|
|
+ //2,显示设置文字,不显示设置为空
|
|
|
+ if(subtitileModel!.setting.subtitleIsShow){
|
|
|
+ wself.updateSubtitle(time: wself.currentAssetProgress)
|
|
|
+ }else{
|
|
|
+ wself.subtitleLabel.text = ""
|
|
|
+ }
|
|
|
+
|
|
|
+ // mdf by ak 这里是设置字幕开关回调
|
|
|
+ if wself.subTitleBtnClickHandle != nil {
|
|
|
+ wself.subTitleBtnClickHandle!(subtitileModel!.setting.subtitleIsShow)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -969,7 +986,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
}
|
|
|
voiceSettingView.voiceSettingCallBack = {[weak self] actionType ,selectVoice ,isSame in
|
|
|
guard let wself = self else { return }
|
|
|
-
|
|
|
+ wself.showOptBtn(isShow: true)
|
|
|
if actionType == .VoiceSettingActionConfirm{//要生成真实音频文件
|
|
|
BFLog(2, message: "确认选择发音人操作")
|
|
|
if(wself.voiceBtnClickHandle != nil && selectVoice != nil){
|
|
@@ -1460,10 +1477,11 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
guard let wself = self else { return }
|
|
|
wself.musicCutView.isHidden = false
|
|
|
wself.musicCutView.bgmData = model
|
|
|
-// UIView.animate(withDuration: 0.2) {
|
|
|
-// // 显示裁剪视图
|
|
|
-// v.frame = CGRect(x: 0, y: cScreenHeigth - 220, width: cScreenWidth, height: 100)
|
|
|
-// }
|
|
|
+ wself.musicCutView.frame = CGRect(x: 0, y: cScreenHeigth + 220, width: cScreenWidth, height: cScreenHeigth)
|
|
|
+ UIView.animate(withDuration: 0.1) {
|
|
|
+ // 显示裁剪视图
|
|
|
+ wself.musicCutView.frame = CGRect(x: 0, y:0, width: cScreenWidth, height: cScreenHeigth)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1525,20 +1543,21 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
@objc func subTitleClick() {
|
|
|
BFLog(message: "subTitle Click ")
|
|
|
subtitleSettingView.isHidden = !subtitleSettingView.isHidden
|
|
|
-
|
|
|
+ showOptBtn(isShow: false)
|
|
|
updateSubtitle(time: currentAssetProgress)
|
|
|
}
|
|
|
|
|
|
// 声音设置
|
|
|
@objc func soundSetting() {
|
|
|
BFLog(message: "设置声音")
|
|
|
-
|
|
|
+ showOptBtn(isShow: false)
|
|
|
audioSettingView.isHidden = !audioSettingView.isHidden
|
|
|
}
|
|
|
|
|
|
//变声设置
|
|
|
@objc func voiceSetting() {
|
|
|
BFLog(message: "设置变音")
|
|
|
+ showOptBtn(isShow: false)
|
|
|
if(mSelectVoiced != nil){
|
|
|
voiceSettingView.selectVoice = mSelectVoiced
|
|
|
voiceSettingView.flushSelectVoiceStatus(voiceStatue: .isSelected)
|
|
@@ -2670,7 +2689,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
model.wavFilePath = musicUrl
|
|
|
wself.loadingView.removeLoading()
|
|
|
}else{
|
|
|
- cShowHUB(superView: wself.view, msg: "音乐下载失败")
|
|
|
+ cShowHUB(superView: wself.view, msg: "音乐下载失败,请重新尝试")
|
|
|
wself.bgmModel = nil
|
|
|
// wself.addMusicBtn.setTitle("选择音乐", for: .normal)
|
|
|
wself.addMusicBtn.config()
|