Exemplo n.º 1
0
 /// <summary>
 /// Called when a track on the current speaker loops.
 /// </summary>
 /// <param name="e"></param>
 private void OnTrackLoop(MusicPlayerEventArgs e)
 {
     if (TrackLoop != null)
     {
         TrackLoop(e);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Called when a track on the current speaker ends in finite play.
 /// </summary>
 /// <param name="e"></param>
 private void OnTrackEnd(MusicPlayerEventArgs e)
 {
     if (TrackEnd != null)
     {
         TrackEnd(e);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Called when a speaker completes a fade in.
 /// </summary>
 /// <param name="e">Event arguments</param>
 private void OnFadeInComplete(MusicPlayerEventArgs e)
 {
     if (FadeInComplete != null)
     {
         FadeInComplete(e);
     }
 }
Exemplo n.º 4
0
 private void TestHandler(MusicPlayerEventArgs e)
 {
     watch.Stop();
     testHandlerCalled = true;
     timesHandlerCalled++;
     lastWatchElapsedTime = watch.ElapsedMilliseconds / 1000f;
     watch.Reset();
 }
        private void Enso_ScrubAfterFinitePlayEndsShouldNotPlayAgainCallback(MusicPlayerEventArgs e)
        {
            // Act
            musicPlayer.ScrubAsPercentage(.5f);

            // Assert
            Assert.IsFalse(module.IsPlaying);
            Assert.IsFalse(module2.IsPlaying);
        }
Exemplo n.º 6
0
    private void ConsistencyTestHandler(MusicPlayerEventArgs e)
    {
        watch.Stop();
        timesHandlerCalled++;
        lastWatchElapsedTime = watch.ElapsedMilliseconds / 1000f;
        float lengthInSeconds = musicPlayer.GetTrackByName("QuickTest").LoopClip.length;

        Assert.IsTrue(IsWithinMargin(lastWatchElapsedTime, lengthInSeconds, .1f),
                      string.Format("Elapsed time: {0}, length in seconds: {1}, iteration: {2}", lastWatchElapsedTime, lengthInSeconds, timesHandlerCalled));

        watch.Reset();
        watch.Start();
    }
Exemplo n.º 7
0
 private void TestHandler2(MusicPlayerEventArgs e)
 {
     timesHandler2Called++;
 }
 private void PlayFinitely_TrackEndOrLoop(MusicPlayerEventArgs e)
 {
     timesPlayed++;
 }