31
31
namespace ClutterFlow.Captions
35
public class TrackCaption : Caption
38
protected string defaultValue = "";
39
public override string DefaultValue {
40
get { return defaultValue; }
42
if (value!=defaultValue) {
43
if (Value==defaultValue) Value = value;
50
public TrackCaption (CoverManager coverManager, string font_name, Color color) : base (coverManager, font_name, color)
56
public override void FadeIn ()
58
EventHandler hFadeIn = delegate (object sender, EventArgs e) {
59
this.Value = new_caption;
60
this.UpdatePosition ();
61
this.Animatev ((ulong) AnimationMode.Linear.value__, (uint) (CoverManager.MaxAnimationSpan*0.5f), new string[] { "opacity" }, new GLib.Value ((byte) 255));
64
if (aFade!=null && aFade.Timeline.IsPlaying)
65
aFade.Completed += hFadeIn;
67
hFadeIn (this, EventArgs.Empty);
71
public override void UpdatePosition ()
74
SetAnchorPoint (Width*0.5f, Height*0.5f);
75
SetPosition(CoverManager.Behaviour.CenterX, Math.Max(CoverManager.Behaviour.CenterY - CoverManager.Behaviour.CoverWidth + Height*3, Height*3.6f));
79
private string new_caption;
80
public void SetValueWithAnim (string caption) {
81
new_caption = caption;
82
if (Opacity>0) FadeOut ();
33
public class TrackCaption : Caption
36
protected string defaultValue = "";
37
public override string DefaultValue {
38
get { return defaultValue; }
40
if (value!=defaultValue) {
41
if (Value==defaultValue) Value = value;
48
public TrackCaption (CoverManager coverManager, string font_name, Color color) : base (coverManager, font_name, color)
54
public override void FadeIn ()
56
EventHandler hFadeIn = delegate (object sender, EventArgs e) {
57
this.Value = new_caption;
58
this.UpdatePosition ();
59
this.Animatev ((ulong) AnimationMode.Linear.value__, (uint) (CoverManager.MaxAnimationSpan*0.5f), new string[] { "opacity" }, new GLib.Value ((byte) 255));
62
if (aFade!=null && aFade.Timeline.IsPlaying) {
63
aFade.Completed += hFadeIn;
65
hFadeIn (this, EventArgs.Empty);
70
public override void UpdatePosition ()
73
SetAnchorPoint (Width*0.5f, Height*0.5f);
74
SetPosition(CoverManager.Behaviour.CenterX, Math.Max(CoverManager.Behaviour.CenterY - CoverManager.Behaviour.CoverWidth + Height*3, Height*3.6f));
78
private string new_caption;
79
public void SetValueWithAnim (string caption) {
80
new_caption = caption;