Beispiel #1
0
        void Instance_BeatChanged(object sender, EventArgs e)
        {
            // update the beat length
            BeatLength = Metronome.Instance.GetQuartersForCompleteCycle();

            ((GraphLayerDelegate)AnimationLayer.Delegate).BeatLength = BeatLength;

            GraphingHelper.ResetElapsedBpm();

            var newRings = GraphingHelper.BuildGraph(Layer, BeatLength);

            // need to fast forward the new rings
            if (Metronome.Instance.PlayState != Metronome.PlayStates.Stopped)
            {
                foreach (Ring ring in newRings)
                {
                    ring.Progress();
                }
            }

            lock (_ringLock)
            {
                // replace old rings
                foreach (Ring ring in Rings)
                {
                    ring.Dispose();
                }

                Rings = newRings;
            }

            // display new rings
            foreach (Ring ring in Rings)
            {
                ring.SizeToSuperLayer();
                ring.DrawStaticElements();
            }
        }
Beispiel #2
0
 protected override void CreateAssets()
 {
     // build the graph, get rings
     Rings = GraphingHelper.BuildGraph(Layer, BeatLength);
 }