Exemplo n.º 1
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            waveformOpacity.BindValueChanged(_ => updateWaveformOpacity(), true);

            WaveformVisible.ValueChanged += _ => updateWaveformOpacity();
            TicksVisible.ValueChanged    += visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
            ControlPointsVisible.BindValueChanged(visible =>
            {
                if (visible.NewValue)
                {
                    this.ResizeHeightTo(timeline_expanded_height, 200, Easing.OutQuint);
                    mainContent.MoveToY(36, 200, Easing.OutQuint);

                    // delay the fade in else masking looks weird.
                    controlPoints.Delay(180).FadeIn(400, Easing.OutQuint);
                }
                else
                {
                    controlPoints.FadeOut(200, Easing.OutQuint);

                    // likewise, delay the resize until the fade is complete.
                    this.Delay(180).ResizeHeightTo(timeline_height, 200, Easing.OutQuint);
                    mainContent.Delay(180).MoveToY(0, 200, Easing.OutQuint);
                }
            }, true);
        }
Exemplo n.º 2
0
        private void load(IBindable <WorkingBeatmap> beatmap, OsuColour colours, OsuConfigManager config)
        {
            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(),
                        new Box
                        {
                            Name             = "zero marker",
                            RelativeSizeAxes = Axes.Y,
                            Width            = 2,
                            Origin           = Anchor.TopCentre,
                            Colour           = colours.YellowDarker,
                        },
                    }
                },
            });

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

            waveformOpacity = config.GetBindable <float>(OsuSetting.EditorWaveformOpacity);
            waveformOpacity.BindValueChanged(_ => updateWaveformOpacity(), true);

            WaveformVisible.ValueChanged      += _ => updateWaveformOpacity();
            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);
        }