-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathEffectSegment.cs
More file actions
51 lines (47 loc) · 1.63 KB
/
EffectSegment.cs
File metadata and controls
51 lines (47 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using JyDraft.meta;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static JyDraft.TimeUtil;
namespace JyDraft
{
/// <summary>
/// 放置在独立特效轨道上的特效片段
/// </summary>
public class EffectSegment : BaseSegment
{
/// <summary>相应的特效素材,在放入轨道时自动添加到素材列表中</summary>
public VideoEffect EffectInstance { get; private set; }
public EffectSegment(
EffectMeta effectType, // 联合类型的接口(见下方解释)
Timerange targetTimerange,
List<float?> parameters = null)
: base(null, targetTimerange) // 会在后面设置 globalId
{
EffectInstance = new VideoEffect(effectType, parameters, applyTargetType: 2); // 2 表示全局作用域
this.MaterialId = EffectInstance.GlobalId; // 调用父类属性
}
}
/// <summary>
/// 放置在独立滤镜轨道上的滤镜片段
/// </summary>
public class FilterSegment : BaseSegment
{
/// <summary>
/// 相应的滤镜素材
/// 在放入轨道时自动添加到素材列表中
/// </summary>
public Filter Material { get; private set; }
public FilterSegment(
EffectMeta meta,
Timerange targetTimerange,
float intensity
) : base(null, targetTimerange)
{
Material = new Filter(meta, intensity);
this.MaterialId = Material.GlobalId;
}
}
}