Pārlūkot izejas kodu

1,切换音乐时导致时长错误 2, 选择音乐后更新选择中的 UI

jsonwang 3 gadi atpakaļ
vecāks
revīzija
f95516a404

+ 14 - 10
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -472,6 +472,9 @@ class PQStuckPointEditerController: PQBaseViewController {
         } else {
             musicNameLab.text = " \(stuckPointMusicData?.musicName ?? "") "
         }
+        
+        //更新一下节奏的 UI
+        sustomSwitchView.selectOneBtn(Index: (stuckPointMusicData?.speed ?? 2) - 1)
     }
 
     // 点击搜索音乐
@@ -819,20 +822,21 @@ class PQStuckPointEditerController: PQBaseViewController {
     /// 通过传入的    selectedPhotoData 、 stuckPointMusicData 创建 projectModel 模型 后面都使用 projectModel 参数
     func createPorjectData() {
         // 1,添加选择的视觉素材
-        let section: PQEditSectionModel = PQEditSectionModel()
-        selectedPhotoData?.forEach { model in
+        if( projectModel.sData?.sections.count == 0){
+            let section: PQEditSectionModel = PQEditSectionModel()
+            selectedPhotoData?.forEach { model in
 
-            let json = model.toJSONString(prettyPrint: false)
-            if json == nil {
-                BFLog(message: "数据转换有问题 跳转")
-                return
+                let json = model.toJSONString(prettyPrint: false)
+                if json == nil {
+                    BFLog(message: "数据转换有问题 跳转")
+                    return
+                }
+                let tempModel: PQEditVisionTrackMaterialsModel = Mapper<PQEditVisionTrackMaterialsModel>().map(JSONString: json!)!
+                section.sectionTimeline?.visionTrack?.visionTrackMaterials.append(tempModel)
             }
-            let tempModel: PQEditVisionTrackMaterialsModel = Mapper<PQEditVisionTrackMaterialsModel>().map(JSONString: json!)!
-            section.sectionTimeline?.visionTrack?.visionTrackMaterials.append(tempModel)
+            projectModel.sData?.sections.append(section)
         }
 
-        projectModel.sData?.sections.append(section)
-
         // 2,添加背景音乐
         projectModel.sData?.addBGM(audioMix: stuckPointMusicData!)
     }