Beispiel #1
0
 public static void SpawnCheck(Player Player)
 {
     if (!Player.CanFade || !Fade.Enabled) { return; }
     int Position = Player.Position;
     int Length = Player.Length;
     if (!Player.FinalFading && Position >= Length - FinalFade.DefaultEndLength && Length > FinalFade.DefaultEndLength * 4)
     {
         Player.SetFinalFade(Player, FinalFade.DefaultEndLength, FadeType.End);
     }
 }
Beispiel #2
0
 public FinalFade(Player Player, int Length, FadeType Type)
     : base(Player, 0, Length, Type)
 {
     if (!Player.CanFade) { return; }
     if (Player.Paused) { this.Finish(); }
     Player.FadeStarted(Player, new EventArgs());
 }
Beispiel #3
0
 public Fade(Player Player, int TargetVolume, int Length, FadeType Type)
 {
     if (!Player.CanFade) { return; }
     if (Type == FadeType.VolumeChange && Player._Fade != null && Player._Fade.Type != FadeType.VolumeChange)
     {
         return;
     }
     this._Player = Player;
     int Position = Player.Position;
     this._StartPosition = Position;
     this._EndPosition = Position + (int)Length;
     this._StartVolume = Player.RealVolume;
     this._EndVolume = TargetVolume;
     this._Type = Type;
     Player._Fade = this;
     if (!Fade.Enabled) { this.Finish(); }
 }
Beispiel #4
0
 protected void SetFinalFade(Player Player, int Length, FadeType Type)
 {
     new FinalFade(Player, Length, Type);
 }
Beispiel #5
0
 protected void SetFade(Player Player, int TargetVolume, int Length, FadeType FadeType)
 {
     new Fade(Player, TargetVolume, Length, FadeType);
 }
Beispiel #6
0
 void Track_PlayStopped(object sender, Player.StopEventArgs e)
 {
     switch (e.Reason)
     {
         case StopReason.Finished: this._Result = TrackResult.Success; break;
         case StopReason.Aborted: this._Result = TrackResult.Aborted; break;
         default: this._Result = TrackResult.Error; break;
     }
     this.StateChanged(this, new EventArgs());
 }
Beispiel #7
0
 void Track_PlayPaused(object sender, Player.PauseEventArgs e)
 {
     this.StateChanged(this, new EventArgs());
 }