-
Notifications
You must be signed in to change notification settings - Fork 0
/
PictureInPicture.cs
68 lines (59 loc) · 1.83 KB
/
PictureInPicture.cs
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Linq;
using ScriptPortal.Vegas;
using System.Windows.Forms;
namespace ScreenShake
{
public class PictureInPicture
{
public VideoEvent VideoEvent;
public Effect Effect;
public OFXDouble2DParameter location;
public OFXDoubleParameter angle;
public PictureInPicture(VideoEvent videoEvent)
{
VideoEvent = videoEvent;
VideoEvent.Effects.AddEffect(VegasH.vegas.VideoFX.GetChildByName("VEGAS Picture In Picture"));
Effect = videoEvent.Effects[videoEvent.Effects.Count - 1];
location = (OFXDouble2DParameter)OFXEffect.FindParameterByName("Location");
angle = (OFXDoubleParameter)OFXEffect.FindParameterByName("Angle");
OFXDoubleParameter scale = (OFXDoubleParameter)OFXEffect.FindParameterByName("Scale");
scale.Value = 1;
scale.ParameterChanged();
}
public OFXEffect OFXEffect
{
get
{
return Effect.OFXEffect;
}
}
public void MakeLocationKeyframe (double x, double y, Timecode time)
{
OFXDouble2D newLocation = new OFXDouble2D();
if (VegasH.gui.shakeX)
{
newLocation.X = x;
}
else
{
newLocation.X = 0.5;
}
if (VegasH.gui.shakeY)
{
newLocation.Y = y;
}
else
{
newLocation.Y = 0.5;
}
location.SetValueAtTime(time, newLocation);
location.ParameterChanged();
}
public void MakeAngleKeyframe(double rotation, Timecode time)
{
angle.SetValueAtTime(time, rotation);
angle.ParameterChanged();
}
}
}