/// <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); } }
/// <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); } }
/// <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); } }
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); }
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(); }
private void TestHandler2(MusicPlayerEventArgs e) { timesHandler2Called++; }
private void PlayFinitely_TrackEndOrLoop(MusicPlayerEventArgs e) { timesPlayed++; }