コード例 #1
0
        private void load(IBindable <WorkingBeatmap> beatmap, OsuColour colours)
        {
            Add(waveform = new WaveformGraph
            {
                RelativeSizeAxes = Axes.Both,
                Colour           = colours.Blue.Opacity(0.2f),
                LowColour        = colours.BlueLighter,
                MidColour        = colours.BlueDark,
                HighColour       = colours.BlueDarker,
                Depth            = float.MaxValue
            });

            // We don't want the centre marker to scroll
            AddInternal(new CentreMarker {
                Depth = float.MaxValue
            });

            WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);

            Beatmap.BindTo(beatmap);
            Beatmap.BindValueChanged(b =>
            {
                waveform.Waveform = b.NewValue.Waveform;
                track             = b.NewValue.Track;

                if (track.Length > 0)
                {
                    MaxZoom = getZoomLevelForVisibleMilliseconds(500);
                    MinZoom = getZoomLevelForVisibleMilliseconds(10000);
                    Zoom    = getZoomLevelForVisibleMilliseconds(2000);
                }
            }, true);
        }
コード例 #2
0
        private void load(IBindable <WorkingBeatmap> beatmap, IAdjustableClock adjustableClock, OsuColour colours)
        {
            this.adjustableClock = adjustableClock;

            Child = waveform = new WaveformGraph
            {
                RelativeSizeAxes = Axes.Both,
                Colour           = colours.Blue.Opacity(0.2f),
                LowColour        = colours.BlueLighter,
                MidColour        = colours.BlueDark,
                HighColour       = colours.BlueDarker,
                Depth            = float.MaxValue
            };

            // We don't want the centre marker to scroll
            AddInternal(new CentreMarker());

            WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint);

            Beatmap.BindTo(beatmap);
            Beatmap.BindValueChanged(b =>
            {
                waveform.Waveform = b.Waveform;
                track             = b.Track;
            }, true);
        }
コード例 #3
0
        private void load(IBindableBeatmap beatmap)
        {
            Child = waveform = new WaveformGraph
            {
                RelativeSizeAxes = Axes.Both,
                Colour           = OsuColour.FromHex("222"),
                Depth            = float.MaxValue
            };

            WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint);

            Beatmap.BindTo(beatmap);
        }
コード例 #4
0
        private void load(IBindable <WorkingBeatmap> beatmap, OsuColour colours)
        {
            AddRange(new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Depth            = float.MaxValue,
                    Children         = new Drawable[]
                    {
                        waveform = new WaveformGraph
                        {
                            RelativeSizeAxes = Axes.Both,
                            BaseColour       = colours.Blue.Opacity(0.2f),
                            LowColour        = colours.BlueLighter,
                            MidColour        = colours.BlueDark,
                            HighColour       = colours.BlueDarker,
                        },
                        ticks         = new TimelineTickDisplay(),
                        controlPoints = new TimelineControlPointDisplay(),
                    }
                },
            });

            // We don't want the centre marker to scroll
            AddInternal(new CentreMarker {
                Depth = float.MaxValue
            });

            WaveformVisible.ValueChanged      += visible => waveform.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
            ControlPointsVisible.ValueChanged += visible => controlPoints.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
            TicksVisible.ValueChanged         += visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);

            Beatmap.BindTo(beatmap);
            Beatmap.BindValueChanged(b =>
            {
                waveform.Waveform = b.NewValue.Waveform;
                track             = b.NewValue.Track;

                // todo: i don't think this is safe, the track may not be loaded yet.
                if (track.Length > 0)
                {
                    MaxZoom = getZoomLevelForVisibleMilliseconds(500);
                    MinZoom = getZoomLevelForVisibleMilliseconds(10000);
                    Zoom    = getZoomLevelForVisibleMilliseconds(2000);
                }
            }, true);
        }
コード例 #5
0
ファイル: Timeline.cs プロジェクト: FulgurentKille/OsuPredict
 private void updateWaveformOpacity() =>
 waveform.FadeTo(WaveformVisible.Value ? waveformOpacity.Value : 0, 200, Easing.OutQuint);