internal void UpdateCurrentRythmPosition(double currentPositionInClip) { var tick = ticks.First(t => t.TickStartsAt <= currentPositionInClip && t.TickEndsAt >= currentPositionInClip); if (tick.Id == currentPosition.Tick.Id) { return; } currentPosition = new RythmPosition(tick, currentPositionInClip); MessageHub.PublishNews <RythmPosition> (MessageTopics.NewRythmPosition, currentPosition); // Debug.Log ( $"[{currentPosition.Tick.Measure}][{currentPosition.Tick.Beat}][{currentPosition.Tick.Index}]" ); // if ( currentPosition.Tick.Id == ticks.Length && tick.Id == 0 ) if (tick.Id == 0) { // new loop. Reset. MessageHub.PublishNews <string> (MessageTopics.TrackStartsFromZero_string, "Track start from zero"); } }