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); } }
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()); }
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(); } }
protected void SetFinalFade(Player Player, int Length, FadeType Type) { new FinalFade(Player, Length, Type); }
protected void SetFade(Player Player, int TargetVolume, int Length, FadeType FadeType) { new Fade(Player, TargetVolume, Length, FadeType); }
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()); }
void Track_PlayPaused(object sender, Player.PauseEventArgs e) { this.StateChanged(this, new EventArgs()); }