|
@@ -114,7 +114,10 @@ class PQStuckPointEditerController: PQBaseViewController {
|
|
|
// 开始播放
|
|
|
self?.settingPlayerView()
|
|
|
// 点击上报:选择节奏
|
|
|
- PQEventTrackViewModel.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_click_selectRhythm, pageSource: .sp_stuck_previewSyncedUp, extParams: ["rhythmNumber": sender.tag], remindmsg: "点击上报:选择节奏")
|
|
|
+ if(self?.currentCreateStickersModel == .createStickersModelPoint){
|
|
|
+ PQEventTrackViewModel.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_shanyinApp_musicVideoPreview_selectMusicVideoRhythm, pageSource: .sp_stuck_previewSyncedUp, extParams: nil, remindmsg: "点击上报:选择节奏")
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
return sustomSwitchView
|
|
|
}()
|
|
@@ -327,7 +330,7 @@ class PQStuckPointEditerController: PQBaseViewController {
|
|
|
self?.maxSpeed = maxSpeed
|
|
|
self?.minSpeed = minSpeed
|
|
|
if maxSpeed == -1.0 && minSpeed == -1.0 {
|
|
|
- self?.customSpeedSettingView.isHidden = true
|
|
|
+ self?.customSpeedSettingView.isHidden = false
|
|
|
self?.customSpeedSettingView.isJumpSpeedModel = speedSettingView.viewType == 2
|
|
|
}
|
|
|
if isSettingPlayer {
|
|
@@ -477,8 +480,13 @@ class PQStuckPointEditerController: PQBaseViewController {
|
|
|
@objc func editModelClick(sender: UIButton) {
|
|
|
// if sender.isSelected {
|
|
|
// BFLog(message: "已经是选中状态")
|
|
|
-// return
|
|
|
+// return “”
|
|
|
// }
|
|
|
+
|
|
|
+ if(sender == jumpPointBtn && selectedTotalDuration < 6){
|
|
|
+ cShowHUB(superView: self.view, msg: "素材时长需要大于6秒才\n可选择“跳跃卡点”模式")
|
|
|
+ return
|
|
|
+ }
|
|
|
lastEditModelBtn?.isSelected = false
|
|
|
sender.isSelected = !sender.isSelected
|
|
|
lastEditModelBtn = sender
|
|
@@ -524,7 +532,8 @@ class PQStuckPointEditerController: PQBaseViewController {
|
|
|
|
|
|
} else {
|
|
|
if sender.tag == 1 { // 快慢速
|
|
|
- speedSettingView.setSelectItem(index: lastSpeedSelectIndex, isSettingPlayer: false)
|
|
|
+
|
|
|
+ speedSettingView.setSelectItem(index: lastSpeedSelectIndex, isSettingPlayer: false,setDisable: selectedTotalDuration < 6 ? true : false)
|
|
|
} else if sender.tag == 2 { // 跳跃卡点
|
|
|
speedSettingView.setSelectItem(index: lastJumpSpeedSelectIndex, isSettingPlayer: false)
|
|
|
} else if sender.tag == 3 { // 仅音乐
|
|
@@ -583,6 +592,9 @@ class PQStuckPointEditerController: PQBaseViewController {
|
|
|
exportPhotoData()
|
|
|
// 同步音乐数据
|
|
|
synchroMusicInfoData()
|
|
|
+
|
|
|
+ //插入选择的音乐信息
|
|
|
+ musicEditBGView.insertSearchMusic(model: stuckPointMusicData!)
|
|
|
// 曝光上报:预览页面曝光上报
|
|
|
PQEventTrackViewModel.baseReportUpload(businessType: .bt_windowView, objectType: .ot_view_previewSyncedUp, pageSource: .sp_stuck_previewSyncedUp, extParams: nil, remindmsg: "卡点视频数据上报-(曝光上报:预览页面曝光上报)")
|
|
|
}
|
|
@@ -1247,7 +1259,14 @@ extension PQStuckPointEditerController {
|
|
|
var tempMaxSpeed: Float = 1
|
|
|
var tempMinSpeed: Float = 1
|
|
|
if model == .createStickersModelSpeed {
|
|
|
- stuckPointsTemp = getUsedStuckPoint(seed: (stuckPointMusicData?.speed ?? 0) + 1)
|
|
|
+
|
|
|
+ // 改变速率,.只有快慢速且非只有图片素材时自动+1处理
|
|
|
+ if model == .createStickersModelSpeed && selectedDataCount != selectedImageDataCount {
|
|
|
+ stuckPointsTemp = getUsedStuckPoint(seed: (stuckPointMusicData?.speed ?? 0) + 1)
|
|
|
+ } else {
|
|
|
+ stuckPointsTemp = getUsedStuckPoint(seed: (stuckPointMusicData?.speed ?? 0))
|
|
|
+ }
|
|
|
+
|
|
|
tempMaxSpeed = maxSpeed
|
|
|
tempMinSpeed = minSpeed
|
|
|
} else {
|
|
@@ -1264,7 +1283,7 @@ extension PQStuckPointEditerController {
|
|
|
- y-视频在B片段的播放倍速
|
|
|
*/
|
|
|
// LA=x*n*d,LB=y*n*d (n=1/3/5) 注:视频经过快慢速处理后的总时长约=L*2/(x+y)
|
|
|
- BFLog(message: "Ax快速为:\(maxSpeed) By慢速为:\(minSpeed) 档位 N为:\(stuckPointMusicData?.speed ?? 0) 使用的卡点总数:\(stuckPointsTemp.count)")
|
|
|
+ BFLog(message: "Ax快速为:\(tempMaxSpeed) By慢速为:\(tempMinSpeed) 档位 N为:\(stuckPointMusicData?.speed ?? 0) 使用的卡点总数:\(stuckPointsTemp.count)")
|
|
|
// 使用新方法取使用的卡点数据
|
|
|
for section in projectModel.sData?.sections ?? List() {
|
|
|
if section.sectionType == "normal" {
|
|
@@ -1306,26 +1325,41 @@ extension PQStuckPointEditerController {
|
|
|
break
|
|
|
}
|
|
|
LBCount = LBCount + 1
|
|
|
- BFLog(message: "慢速段段段段段段后LACount:\(LACount) realUsedMusicDuration:\(useAssestDurationTemp)")
|
|
|
+ BFLog(message: "慢速段段段段段段后LACount:\(LBCount) realUsedMusicDuration:\(useAssestDurationTemp)")
|
|
|
i = i + 1
|
|
|
}
|
|
|
// 2拼接要使用的卡点信息
|
|
|
- sticker.clipCount = LACount + LBCount
|
|
|
-
|
|
|
+// if(model == .createStickersModelOnlyMusic){
|
|
|
+// sticker.clipCount = LACount
|
|
|
+// }else{
|
|
|
+ sticker.clipCount = LACount + LBCount
|
|
|
+// }
|
|
|
+
|
|
|
+ // LACount + LBCount = 0 ? 11s视频x6倍速
|
|
|
+ if(sticker.clipCount == 0){sticker.clipCount = 1}
|
|
|
for i in 0 ... sticker.clipCount {
|
|
|
- let a = stuckPointsTemp[(i + Int(lastPointIndex ?? 0)) % stuckPointsTemp.count]
|
|
|
- let b = Float((i + Int(lastPointIndex ?? 0)) / stuckPointsTemp.count) * (stuckPointsTemp.first ?? 0)
|
|
|
- finallyStuckPoints.append(a + b)
|
|
|
+
|
|
|
+ let index = (i + Int(lastPointIndex ?? 0)) % stuckPointsTemp.count
|
|
|
+ var a = stuckPointsTemp[index]
|
|
|
+
|
|
|
+// var b = Float((i + Int(lastPointIndex ?? 0) - 1) / stuckPointsTemp.count) * (stuckPointsTemp.first ?? 0)
|
|
|
+ //和下位的差值
|
|
|
+// var b:Float = 0.0
|
|
|
+ if(i >= stuckPointsTemp.count && (index + 1) < stuckPointsTemp.count){
|
|
|
+ BFLog(message:"差值为:\(stuckPointsTemp[index + 1] - a) 最后一位为:\(finallyStuckPoints.last ?? 0.0)")
|
|
|
+
|
|
|
+ a = (stuckPointsTemp[index + 1] - a) + (finallyStuckPoints.last ?? 0.0)
|
|
|
+
|
|
|
+ }
|
|
|
+ finallyStuckPoints.append(a)
|
|
|
}
|
|
|
|
|
|
// 3,多补一个卡点 做 C级 速处理
|
|
|
if useAssestDurationTemp < assetDuration {
|
|
|
- lastPointIndex = stuckPointsTemp.firstIndex(where: { (point) -> Bool in
|
|
|
- (point == (finallyStuckPoints.last ?? 0).truncatingRemainder(dividingBy: (stuckPointsTemp.last ?? 0)))
|
|
|
- })
|
|
|
- let a = stuckPointsTemp[(1 + Int(lastPointIndex ?? 0)) % stuckPointsTemp.count]
|
|
|
- let b = Float((1 + Int(lastPointIndex ?? 0)) / stuckPointsTemp.count) * (stuckPointsTemp.first ?? 0)
|
|
|
- finallyStuckPoints.append(a + b)
|
|
|
+ lastPointIndex = sticker.clipCount % stuckPointsTemp.count
|
|
|
+ let a = stuckPointsTemp[lastPointIndex ?? 0]
|
|
|
+ let b = stuckPointsTemp[(lastPointIndex ?? 0) + 1]
|
|
|
+ finallyStuckPoints.append((finallyStuckPoints.last ?? 0.0) + (b - a))
|
|
|
|
|
|
sticker.clipCount = sticker.clipCount + 1
|
|
|
}
|
|
@@ -1359,7 +1393,7 @@ extension PQStuckPointEditerController {
|
|
|
|
|
|
// lastCyclesSelectIndex 应该是手动设置的值
|
|
|
if lastCyclesSelectIndex != 0 {
|
|
|
- for i in 0 ... lastCyclesSelectIndex {
|
|
|
+ for i in 0 ... lastCyclesSelectIndex - 1{
|
|
|
var pointIndex = stuckPointsTemp.firstIndex(where: { (point) -> Bool in
|
|
|
(point == (finallyStuckPoints.last ?? 0).truncatingRemainder(dividingBy: (stuckPointsTemp.last ?? 0)))
|
|
|
})
|
|
@@ -1456,8 +1490,7 @@ extension PQStuckPointEditerController {
|
|
|
self?.dealWithDataSuccess()
|
|
|
}
|
|
|
// 添加子视图
|
|
|
-// if(playerView )
|
|
|
-// self?.addSubViews()
|
|
|
+ self?.addSubViews()
|
|
|
} else {
|
|
|
if self?.synchroMarskView.superview != nil {
|
|
|
self?.synchroMarskView.removeMarskView()
|
|
@@ -1649,6 +1682,14 @@ extension PQStuckPointEditerController {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ //跳跃卡点不可用
|
|
|
+ if(selectedTotalDuration < 6){
|
|
|
+
|
|
|
+ jumpPointBtn.setImage(UIImage().BF_Image(named: "jumpPoint_disable"), for: .normal)
|
|
|
+ jumpPointBtn.setImage(UIImage().BF_Image(named: "jumpPoint_disable"), for: .selected)
|
|
|
+ jumpPointBtnGif.isHidden = true
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
|
文档规则 https://w42nne6hzg.feishu.cn/docs/doccnQZm1uCfkU4QtJb5fLxYk4d#
|