private void SetScrollPointerPreciseFrameIndex(AudioComponent.PlaySession playSession, FrameManagerComponent frameManager, SubdivisionComponent subdivision) { SetScrollPointerPreciseFrameIndex( playSession.CurrentIndexesAndProgress.PreciseFrameIndex, frameManager.GetCurrentFrameWidth(), subdivision.CurrentSubdivision.QuantityPerBeat); }
public void Scroll(AudioComponent.PlaySession playSession) { //Game.Log(Logging.Category.BEATMAP, "Beginning piano roll scroll.", Logging.Level.LOG); if (IsScrolling) { StopCoroutine(_scrollCoroutine); } _scrollCoroutine = StartCoroutine(ScrollCoroutine(playSession)); }
private IEnumerator ScrollCoroutine(AudioComponent.PlaySession playSession) { // Maybe a 'do while' would be cleaner var frameManager = Editor.FrameManagerComponent; var subdivisionComponent = Editor.SubdivisionComponent; while (!playSession.Complete) { SetScrollPointerPreciseFrameIndex(playSession, frameManager, subdivisionComponent); yield return(null); //come back next frame } SetScrollPointer(GetScrollPositionForFrameIndex(playSession.EndFrameIndex + 1, frameManager.GetCurrentFrameWidth(), subdivisionComponent.CurrentSubdivision.QuantityPerBeat)); }