public bool IsWithinBpmRange(PlaybackSpeed first, PlaybackSpeed second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); return first.IsWithinBpmRange(second); }
public override bool IsCompatible(PlaybackSpeed first, PlaybackSpeed second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); return bpmRangeChecker.IsWithinBpmRange(first, second) && IsCompatible(first.ActualKey, second.ActualKey); }
void BoxWasChanged(PlaybackSpeed givenSpeed) { if (gesturePassed && !boxChangedSuccessfully) { changeBoxText.SetActive(false); boxChangedSuccessfully = true; StartCoroutine(HaveFun()); } }
public override double CalculateSuggestedIncrease(PlaybackSpeed track, double targetBpm) { double increase = base.CalculateSuggestedIncrease(track, targetBpm); if (Math.Abs(increase) > MaxPermittedDifference) return 0; return increase; }
public virtual double CalculateSuggestedIncrease(PlaybackSpeed track, double targetBpm) { if (Double.IsNaN(targetBpm) || track.IsUnknownBpm) return 0; double increaseRequired = track.CalculateExactIncreaseRequiredToMatch(targetBpm); double nearestInterval = increaseRequired.FloorToNearest(PitchFaderStep.Value); return nearestInterval; }
public double CalculateSuggestedIncrease(PlaybackSpeed first, PlaybackSpeed second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (first.IsUnknownBpm || second.IsUnknownBpm) return 0; return CalculateSuggestedIncrease(second, first.ActualBpm); }
public PlaybackSpeed AutoAdjust(PlaybackSpeed first, PlaybackSpeed second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (first.IsUnknownBpm || second.IsUnknownBpm) return second; return AutoAdjust(second, targetBpm: first.ActualBpm); }
void AddToCount(PlaybackSpeed pSpeed) { count++; if (count == requiredSpeedChanges) { foreach (GameObject text in textToTurnOff) { text.SetActive(false); } } }
void CheckToStartMoving(PlaybackSpeed givenSpeed) { if (givenSpeed == movingPlaybackSpeed) { animator.SetBool("MovingPlaybackSpeed", true); } else { animator.SetBool("MovingPlaybackSpeed", false); } }
public virtual PlaybackSpeed AutoAdjust(PlaybackSpeed track, double targetBpm) { if (track == null) throw new ArgumentNullException("track"); if (track.IsUnknownBpm || Double.IsNaN(targetBpm)) return track; double increase = CalculateSuggestedIncrease(track, targetBpm); return track.AsIncreasedBy(increase); }
void EvaluateRenderer(PlaybackSpeed givenSpeed) { if (givenSpeed == whichSpeed) { rend.enabled = true; } else { rend.enabled = false; } }
void EvaluateCageToggle(PlaybackSpeed givenSpeed) { if (givenSpeed == cageSpeed) { cage.SetActive(true); } else { cage.SetActive(false); } }
void EvaluateLight(PlaybackSpeed givenSpeed) { if (givenSpeed == darkSpeed) { StopAllCoroutines(); StartCoroutine(FadeToDark()); } else { StopAllCoroutines(); StartCoroutine(FadeToLight()); } }
void SwitchBetweenWalls(PlaybackSpeed givenSpeed) { if (givenSpeed == transparentSpeed) { opaqueWall.SetActive(false); transparentWall.SetActive(true); } else { opaqueWall.SetActive(true); transparentWall.SetActive(false); } }
void EvaluateIceBlend(PlaybackSpeed speed) { if (speed == iceSpeed) { StopAllCoroutines(); StartCoroutine(FadeInIce()); } else { StopAllCoroutines(); StartCoroutine(FadeOutIce()); } }
void TriggerEvents(PlaybackSpeed givenSpeed) { if (givenSpeed == PlaybackSpeed.Slow) { OnSlow?.Invoke(); } else if (givenSpeed == PlaybackSpeed.Medium) { OnMedium?.Invoke(); } else if (givenSpeed == PlaybackSpeed.Fast) { OnFast?.Invoke(); } }
public Transition GetTransitionBetween(PlaybackSpeed first, PlaybackSpeed second) { if (first == null && second == null) throw new ArgumentException("Cannot detect transition between two null tracks."); if (first == null) return Transition.Intro(second.ActualKey); if (second == null) return Transition.Outro(first.ActualKey); var strategy = strategies.First(s => s.IsCompatible(first, second)); return new Transition(first.ActualKey, second.ActualKey, strategy); }
/// <summary> /// Adhoc code /// </summary> public void Reset() { Location.X.SetValueDirectly(0.0f); Location.Y.SetValueDirectly(0.0f); Location.Z.SetValueDirectly(0.0f); Rotation.X.SetValueDirectly(0.0f); Rotation.Y.SetValueDirectly(0.0f); Rotation.Z.SetValueDirectly(0.0f); Scale.X.SetValueDirectly(1.0f); Scale.Y.SetValueDirectly(1.0f); Scale.Z.SetValueDirectly(1.0f); LocationVelocity.X.SetValueDirectly(0.0f); LocationVelocity.Y.SetValueDirectly(0.0f); LocationVelocity.Z.SetValueDirectly(0.0f); RotationVelocity.X.SetValueDirectly(0.0f); RotationVelocity.Y.SetValueDirectly(0.0f); RotationVelocity.Z.SetValueDirectly(0.0f); ScaleVelocity.X.SetValueDirectly(0.0f); ScaleVelocity.Y.SetValueDirectly(0.0f); ScaleVelocity.Z.SetValueDirectly(0.0f); RemovedTime.Infinite.SetValueDirectly(true); RemovedTime.Value.SetValueDirectly(0); CountX.SetValueDirectly(1); CountY.SetValueDirectly(1); CountZ.SetValueDirectly(1); Distance.SetValueDirectly(5); TimeSpan.SetValueDirectly(0); ColorAll.R.SetValueDirectly(255); ColorAll.G.SetValueDirectly(255); ColorAll.B.SetValueDirectly(255); ColorAll.A.SetValueDirectly(255); PlaybackSpeed.SetValueDirectly(1); TargetLocation.X.SetValueDirectly(0.0f); TargetLocation.Y.SetValueDirectly(0.0f); TargetLocation.Z.SetValueDirectly(0.0f); }
void EvaluateRaindrops(PlaybackSpeed speed) { if (gameObject.activeInHierarchy) { if (speed == rainSpeed) { StopAllCoroutines(); StartCoroutine(FadeInRaindrops()); } else { StopAllCoroutines(); StartCoroutine(FadeOutRaindrops()); } } }
void DecideFade(PlaybackSpeed givenSpeed) { if (gameObject.activeInHierarchy) { if (givenSpeed == fadeInPlaybackSpeed) { StopAllCoroutines(); StartCoroutine(FadeMaterialIn()); } else { StopAllCoroutines(); StartCoroutine(FadeMaterialOut()); } } }
void ChangeMaterialWithSpeed(PlaybackSpeed givenSpeed) { switch (givenSpeed) { case PlaybackSpeed.Slow: rend.material = slowMat; break; case PlaybackSpeed.Medium: rend.material = medMat; break; case PlaybackSpeed.Fast: rend.material = fastMat; break; } }
void TurnOnOrOff(PlaybackSpeed givenSpeed) { if (givenSpeed == onDuring) { foreach (GameObject ob in objects) { ob.SetActive(true); } } else { foreach (GameObject ob in objects) { ob.SetActive(false); } } }
void EvaluateFadeNecessity(PlaybackSpeed givenSpeed) { if (gameObject.activeInHierarchy) { if (givenSpeed == shiftingSpeed) { currentlyShifting = true; StopAllCoroutines(); StartCoroutine(FadeToGradientValueOverTime()); } else { StopAllCoroutines(); StartCoroutine(ReturnToOriginalColor()); } } }
void TurnOnOrOff(PlaybackSpeed givenSpeed) { if (gameObject.activeInHierarchy) { StopAllCoroutines(); if (givenSpeed == onDuring) { foreach (GameObject ob in objects) { ob.SetActive(true); } } else { StartCoroutine(DelayTurnOff()); } } }
void EvaluateClouds(PlaybackSpeed givenSpeed) { switch (givenSpeed) { case PlaybackSpeed.Fast: pSystem.Play(); Debug.Log("Playing clouds!"); break; case PlaybackSpeed.Medium: pSystem.Stop(); break; case PlaybackSpeed.Slow: pSystem.Play(); Debug.Log("Playing clouds!"); break; } }
public Transition GetTransitionBetween(PlaybackSpeed first, PlaybackSpeed second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); // Adjust playback speed to match var suggestedSpeedIncrease = playbackSpeedAdjuster.CalculateSuggestedIncrease(first, second); var secondAdjusted = second.AsIncreasedBy(suggestedSpeedIncrease); var strategy = preferredStrategies.FirstOrDefault(s => s.IsCompatible(first, secondAdjusted)); if (strategy == null) return null; return new Transition( first.ActualKey, secondAdjusted.ActualKey, strategy, suggestedSpeedIncrease); }
// Should be replaced by override with enum bellow. Is bound in handmenu object public void set_playback_speed(int a) { switch (a) { case 1: playbackSpeed = PlaybackSpeed.s1_00; break; case 2: playbackSpeed = PlaybackSpeed.s0_50; break; case 4: playbackSpeed = PlaybackSpeed.s0_25; break; default: Debug.Log("Assigned invalid playback speed"); break; } }
void ChangeWalls(PlaybackSpeed speed) { switch (speed) { case PlaybackSpeed.Slow: medWalls.SetActive(false); fastWalls.SetActive(false); slowWalls.SetActive(true); break; case PlaybackSpeed.Medium: slowWalls.SetActive(false); fastWalls.SetActive(false); medWalls.SetActive(true); break; case PlaybackSpeed.Fast: slowWalls.SetActive(false); medWalls.SetActive(false); fastWalls.SetActive(true); break; } }
public override bool IsCompatible(PlaybackSpeed first, PlaybackSpeed second) { return first.IsUnknownBpm || second.IsUnknownBpm || IsCompatible(first.ActualKey, second.ActualKey); }
public void set_playback_speed(PlaybackSpeed s) { playbackSpeed = s; }
public double CalculateSuggestedIncrease(PlaybackSpeed track, double targetBpm) { return 0; }
public bool IsWithinBpmRange(PlaybackSpeed first, PlaybackSpeed second) { var config = configProvider.Config; return !config.RestrictBpmCompatibility || impl.IsWithinBpmRange(first, second); }
public override double CalculateSuggestedIncrease(PlaybackSpeed first, double targetBpm) { var config = configProvider.Config; return config.ShouldSuggestBpmAdjustments() ? base.CalculateSuggestedIncrease(first, targetBpm) : 0; }
private void PlaybackSpeedButton_Click(object sender, RoutedEventArgs e) { playbackSpeed = (PlaybackSpeed)(((int)playbackSpeed + 1) % Enum.GetNames(typeof(PlaybackSpeed)).Length); SetPlaybackSpeed(playbackSpeedLookup[playbackSpeed]); }
public override bool IsCompatible(PlaybackSpeed first, PlaybackSpeed second) { return !bpmRangeChecker.IsWithinBpmRange(first, second); }
void ForceLoweringOfPanels(PlaybackSpeed pSpeed) { LowerPanels(); StartCoroutine(WaitBeforeRaisingPanels()); }
private void MediaPlayer_MediaOpened(object sender, RoutedEventArgs e) { TimelineSlider.Maximum = MediaPlayer.NaturalDuration.TimeSpan.TotalMilliseconds; playbackSpeed = PlaybackSpeed.Normal; SetPlaybackSpeed(playbackSpeedLookup[playbackSpeed]); }
public PlaybackSpeed AutoAdjust(PlaybackSpeed track, double targetBpm) { throw new System.NotImplementedException(); }
// Start is called before the first frame update void Start() { songPlaying = false; visualsEnabled = true; currentPlaybackSpeed = PlaybackSpeed.Medium; }
public double CalculateSuggestedIncrease(PlaybackSpeed first, PlaybackSpeed second) { return 0; }
public PlaybackSpeed AutoAdjust(PlaybackSpeed first, PlaybackSpeed second) { return second; }
public bool IsWithinBpmRange(PlaybackSpeed first, PlaybackSpeed second) { return true; }
void ChangeSpeed(PlaybackSpeed givenSpeed) { currentSpeed = givenSpeed; ChangeColor(currentLayer); }
public override PlaybackSpeed AutoAdjust(PlaybackSpeed track, double targetBpm) { var config = configProvider.Config; return config.ShouldAutoAdjustBpms() ? base.AutoAdjust(track, targetBpm) : track; }
public void PlaybackSpeedChangeEvent(PlaybackSpeed givenSpeed) { PlaybackSpeedChange?.Invoke(givenSpeed); Debug.Log("Changing speed to " + givenSpeed); currentPlaybackSpeed = givenSpeed; }