예제 #1
0
        /// <summary>
        /// Add a beat to the timeline.
        /// </summary>
        /// <param name="beatNum">The beat number to place it at.</param>
        public void AddBeat(int beatNum)
        {
            BeatmapBeat beat = new BeatmapBeat(this, innerHeight, beatNum);

            beats.Add(beat);
            canvas.Children.Add(beat);
            beat.RefreshPosition();
        }
        /// <summary>
        /// Sets the selection state of the beat.
        /// </summary>
        /// <param name="state">State to set the beat as</param>
        private void SetBeatState(BeatState state)
        {
            switch (state)
            {
            case BeatState.None:
                hovered = hovered == this ? null : hovered;
                outerRectangle.Opacity = 0.3;
                break;

            case BeatState.Hovering:
                hovered = this;
                outerRectangle.Opacity = 0.5;
                break;

            case BeatState.Grab:
                outerRectangle.Opacity = 0.6;
                break;
            }
        }