public PathPreviewVisual(Path newPath, Path actualPath, NoneHandler hideCompletedCallback)
 {
     NewPath = newPath;
     ActualPath = actualPath;
     HideCompletedCallback = hideCompletedCallback;
     EffectsController = new EffectsController<IVisual>();
     State = PPVState.HidingEnded;
 }
Esempio n. 2
0
 public Music()
     : base()
 {
     Volume = Audio.AudioController.MusicVolume;
     
     CurrentPlayTime = 0;
     Callback = null;
     TimeToCallCallback = 0;
 }
Esempio n. 3
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (Instances.Count > 1)
                throw new Exception("Two same musics are loaded in memory.");

            if (Fade == null && Instances.Count != 0 && !Instances[Id].IsDisposed)
                State = Instances[Id].State;

            TimeToCallCallback -= gameTime.ElapsedGameTime.TotalMilliseconds;

            if (Callback != null && TimeToCallCallback <= 0)
            {
                Callback();
                Callback = null;
            }
        }
Esempio n. 4
0
        public override void Stop(bool progressive, int fadeTime)
        {
            Callback = null;

            base.Stop(progressive, fadeTime);
        }
Esempio n. 5
0
 public void Play(bool progressive, int fadeTime, NoneHandler callback, double timeBeforeEnd)
 {
     Play(progressive, fadeTime, false);
     Callback = callback;
     TimeToCallCallback = Sound.Duration.TotalMilliseconds - timeBeforeEnd;
 }
Esempio n. 6
0
 public static void AddTransitionListener(NoneHandler handlerStarted, NoneHandler handlerStopped)
 {
     TransitionsController.TransitionStarted += handlerStarted;
     TransitionsController.TransitionTerminated += handlerStopped;
 }
Esempio n. 7
0
 public static void PlayMusic(string musicName, bool progressive, int fadeTime, NoneHandler callback, double timeBeforeEnd)
 {
     AudioController.GetMusic(musicName).Play(progressive, fadeTime, callback, timeBeforeEnd);
 }
 public void Add(NoneHandler job, double timeMs)
 {
     Jobs.Add(new KeyValuePair<NoneHandler, double>(job, CurrentTime + timeMs));
 }