|
@@ -28,12 +28,11 @@ public class BFRecordItemModel: NSObject {
|
|
|
var coverPath: String?
|
|
|
var materialDuraion: CMTime = .zero
|
|
|
var fetchCoverImgCallBack: ((UIImage) -> Void)?
|
|
|
-// var fetchAVUrlAssetCallBack: (() -> Void)?
|
|
|
var fetchPlayItemCallBack: ((BFRecordItemModel?) -> Void)?
|
|
|
var dealedDurationRanges = [SplitRecordRange]() // 录音切割的时间区间,合成导出时计算
|
|
|
public var voiceStickers = [PQVoiceModel]() //
|
|
|
public var videoStickers = [PQEditVisionTrackMaterialsModel]() // 合成导出时计算
|
|
|
- public var imageStickers = [PQEditVisionTrackMaterialsModel]() //
|
|
|
+// public var imageStickers = [PQEditVisionTrackMaterialsModel]() //
|
|
|
public var titleStickers = [PQEditSubTitleModel]() // 字幕贴纸
|
|
|
|
|
|
var events = [WithDrawModel]() // 行为记录,方便撤销
|
|
@@ -49,6 +48,40 @@ public class BFRecordItemModel: NSObject {
|
|
|
public var height = 0 // 素材高
|
|
|
public var videoDegress: UInt = 0 // 视频拍摄角度 90,270为横屏,180,0为竖屏
|
|
|
|
|
|
+ public override func mutableCopy() -> Any {
|
|
|
+ let new = BFRecordItemModel()
|
|
|
+ new.localPath = self.localPath
|
|
|
+ new.coverPath = self.coverPath
|
|
|
+ new.materialDuraion = self.materialDuraion
|
|
|
+ new.fetchCoverImgCallBack = self.fetchCoverImgCallBack
|
|
|
+ new.fetchPlayItemCallBack = self.fetchPlayItemCallBack
|
|
|
+
|
|
|
+
|
|
|
+ self.voiceStickers.forEach { mod in
|
|
|
+ new.voiceStickers.append(mod.mutableCopy() as! PQVoiceModel)
|
|
|
+ }
|
|
|
+ self.videoStickers.forEach { mod in
|
|
|
+ new.videoStickers.append(mod.mutableCopy() as! PQEditVisionTrackMaterialsModel)
|
|
|
+ }
|
|
|
+ self.titleStickers.forEach { mod in
|
|
|
+ new.titleStickers.append(mod.mutableCopy() as! PQEditSubTitleModel)
|
|
|
+ }
|
|
|
+ new.thumbImgs.append(contentsOf: self.thumbImgs)
|
|
|
+
|
|
|
+ new.events = self.events
|
|
|
+ new.coverImg = self.coverImg
|
|
|
+ new.playItem = self.playItem
|
|
|
+ new.videoAsset = self.videoAsset
|
|
|
+ new.mediaType = self.mediaType
|
|
|
+ new.progress = self.progress
|
|
|
+ new.index = self.index
|
|
|
+ new.width = self.width
|
|
|
+ new.height = self.height
|
|
|
+ new.videoDegress = self.videoDegress
|
|
|
+
|
|
|
+ return new
|
|
|
+ }
|
|
|
+
|
|
|
func initOriginData(phasset: PHAsset) {
|
|
|
width = phasset.pixelWidth
|
|
|
height = phasset.pixelHeight
|