Exemplo n.º 1
0
        private void load(OsuGameBase game, OsuColour colours, LocalisationEngine localisation)
        {
            this.localisation = localisation;

            Children = new Drawable[]
            {
                dragContainer = new Container
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Children         = new Drawable[]
                    {
                        playlist = new PlaylistOverlay
                        {
                            RelativeSizeAxes = Axes.X,
                            Y = player_height + 10,
                        },
                        playerContainer = new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = player_height,
                            Masking          = true,
                            CornerRadius     = 5,
                            EdgeEffect       = new EdgeEffectParameters
                            {
                                Type   = EdgeEffectType.Shadow,
                                Colour = Color4.Black.Opacity(40),
                                Radius = 5,
                            },
                            Children = new[]
                            {
                                currentBackground = new Background(),
                                title             = new OsuSpriteText
                                {
                                    Origin   = Anchor.BottomCentre,
                                    Anchor   = Anchor.TopCentre,
                                    Position = new Vector2(0, 40),
                                    TextSize = 25,
                                    Colour   = Color4.White,
                                    Text     = @"Nothing to play",
                                    Font     = @"Exo2.0-MediumItalic"
                                },
                                artist = new OsuSpriteText
                                {
                                    Origin   = Anchor.TopCentre,
                                    Anchor   = Anchor.TopCentre,
                                    Position = new Vector2(0, 45),
                                    TextSize = 15,
                                    Colour   = Color4.White,
                                    Text     = @"Nothing to play",
                                    Font     = @"Exo2.0-BoldItalic"
                                },
                                new Container
                                {
                                    Padding = new MarginPadding {
                                        Bottom = progress_height
                                    },
                                    Height           = bottom_black_area_height,
                                    RelativeSizeAxes = Axes.X,
                                    Origin           = Anchor.BottomCentre,
                                    Anchor           = Anchor.BottomCentre,
                                    Children         = new Drawable[]
                                    {
                                        new FillFlowContainer <IconButton>
                                        {
                                            AutoSizeAxes = Axes.Both,
                                            Direction    = FillDirection.Horizontal,
                                            Spacing      = new Vector2(5),
                                            Origin       = Anchor.Centre,
                                            Anchor       = Anchor.Centre,
                                            Children     = new[]
                                            {
                                                new IconButton
                                                {
                                                    Action = prev,
                                                    Icon   = FontAwesome.fa_step_backward,
                                                },
                                                playButton = new IconButton
                                                {
                                                    Scale     = new Vector2(1.4f),
                                                    IconScale = new Vector2(1.4f),
                                                    Action    = play,
                                                    Icon      = FontAwesome.fa_play_circle_o,
                                                },
                                                new IconButton
                                                {
                                                    Action = next,
                                                    Icon   = FontAwesome.fa_step_forward,
                                                },
                                            }
                                        },
                                        playlistButton = new IconButton
                                        {
                                            Origin   = Anchor.Centre,
                                            Anchor   = Anchor.CentreRight,
                                            Position = new Vector2(-bottom_black_area_height / 2, 0),
                                            Icon     = FontAwesome.fa_bars,
                                            Action   = () => playlist.ToggleVisibility(),
                                        },
                                    }
                                },
                                progressBar = new DragBar
                                {
                                    Origin        = Anchor.BottomCentre,
                                    Anchor        = Anchor.BottomCentre,
                                    Height        = progress_height,
                                    Colour        = colours.Yellow,
                                    SeekRequested = seek
                                }
                            },
                        },
                    }
                }
            };

            beatmapBacking.BindTo(game.Beatmap);

            playlist.StateChanged += (c, s) => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, EasingTypes.OutQuint);
        }
Exemplo n.º 2
0
        private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
        {
            game = osuGame;

            unicodeString = config.GetUnicodeString;

            Children = new Drawable[]
            {
                dragContainer = new Container
                {
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    Masking      = true,
                    CornerRadius = 5,
                    EdgeEffect   = new EdgeEffect
                    {
                        Type   = EdgeEffectType.Shadow,
                        Colour = Color4.Black.Opacity(40),
                        Radius = 5,
                    },
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        title = new OsuSpriteText
                        {
                            Origin   = Anchor.BottomCentre,
                            Anchor   = Anchor.TopCentre,
                            Position = new Vector2(0, 40),
                            TextSize = 25,
                            Colour   = Color4.White,
                            Text     = @"Nothing to play",
                            Font     = @"Exo2.0-MediumItalic"
                        },
                        artist = new OsuSpriteText
                        {
                            Origin   = Anchor.TopCentre,
                            Anchor   = Anchor.TopCentre,
                            Position = new Vector2(0, 45),
                            TextSize = 15,
                            Colour   = Color4.White,
                            Text     = @"Nothing to play",
                            Font     = @"Exo2.0-BoldItalic"
                        },
                        new ClickableContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Origin       = Anchor.Centre,
                            Anchor       = Anchor.BottomCentre,
                            Position     = new Vector2(0, -30),
                            Action       = () =>
                            {
                                if (current?.Track == null)
                                {
                                    return;
                                }
                                if (current.Track.IsRunning)
                                {
                                    current.Track.Stop();
                                }
                                else
                                {
                                    current.Track.Start();
                                }
                            },
                            Children = new Drawable[]
                            {
                                playButton = new TextAwesome
                                {
                                    TextSize = 30,
                                    Icon     = FontAwesome.fa_play_circle_o,
                                    Origin   = Anchor.Centre,
                                    Anchor   = Anchor.Centre
                                }
                            }
                        },
                        new ClickableContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Origin       = Anchor.Centre,
                            Anchor       = Anchor.BottomCentre,
                            Position     = new Vector2(-30, -30),
                            Action       = prev,
                            Children     = new Drawable[]
                            {
                                new TextAwesome
                                {
                                    TextSize = 15,
                                    Icon     = FontAwesome.fa_step_backward,
                                    Origin   = Anchor.Centre,
                                    Anchor   = Anchor.Centre
                                }
                            }
                        },
                        new ClickableContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Origin       = Anchor.Centre,
                            Anchor       = Anchor.BottomCentre,
                            Position     = new Vector2(30, -30),
                            Action       = next,
                            Children     = new Drawable[]
                            {
                                new TextAwesome
                                {
                                    TextSize = 15,
                                    Icon     = FontAwesome.fa_step_forward,
                                    Origin   = Anchor.Centre,
                                    Anchor   = Anchor.Centre
                                }
                            }
                        },
                        new ClickableContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Origin       = Anchor.Centre,
                            Anchor       = Anchor.BottomRight,
                            Position     = new Vector2(20, -30),
                            Children     = new Drawable[]
                            {
                                new TextAwesome
                                {
                                    TextSize = 15,
                                    Icon     = FontAwesome.fa_bars,
                                    Origin   = Anchor.Centre,
                                    Anchor   = Anchor.Centre
                                }
                            }
                        },
                        progress = new DragBar
                        {
                            Origin        = Anchor.BottomCentre,
                            Anchor        = Anchor.BottomCentre,
                            Height        = 10,
                            Colour        = colours.Yellow,
                            SeekRequested = seek
                        }
                    }
                }
            };

            this.beatmaps = beatmaps;
            trackManager  = osuGame.Audio.Track;
            preferUnicode = config.GetBindable <bool>(OsuConfig.ShowUnicode);
            preferUnicode.ValueChanged += preferUnicode_changed;

            beatmapSource = osuGame.Beatmap ?? new Bindable <WorkingBeatmap>();
            playList      = beatmaps.GetAllWithChildren <BeatmapSetInfo>();

            backgroundSprite = new MusicControllerBackground();
            dragContainer.Add(backgroundSprite);
        }
Exemplo n.º 3
0
        private void load(OsuGameBase osuGame, BeatmapDatabase beatmaps, AudioManager audio,
            TextureStore textures, OsuColour colours)
        {
            Children = new Drawable[]
            {
                title = new SpriteText
                {
                    Origin = Anchor.BottomCentre,
                    Anchor = Anchor.TopCentre,
                    Position = new Vector2(0, 40),
                    TextSize = 25,
                    Colour = Color4.White,
                    Text = @"Nothing to play",
                    Font = @"Exo2.0-MediumItalic"
                },
                artist = new SpriteText
                {
                    Origin = Anchor.TopCentre,
                    Anchor = Anchor.TopCentre,
                    Position = new Vector2(0, 45),
                    TextSize = 15,
                    Colour = Color4.White,
                    Text = @"Nothing to play",
                    Font = @"Exo2.0-BoldItalic"
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin = Anchor.Centre,
                    Anchor = Anchor.BottomCentre,
                    Position = new Vector2(0, -30),
                    Action = () =>
                    {
                        if (current?.Track == null) return;
                        if (current.Track.IsRunning)
                            current.Track.Stop();
                        else
                            current.Track.Start();
                    },
                    Children = new Drawable[]
                    {
                        playButton = new TextAwesome
                        {
                            TextSize = 30,
                            Icon = FontAwesome.fa_play_circle_o,
                            Origin = Anchor.Centre,
                            Anchor = Anchor.Centre
                        }
                    }
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin = Anchor.Centre,
                    Anchor = Anchor.BottomCentre,
                    Position = new Vector2(-30, -30),
                    Action = prev,
                    Children = new Drawable[]
                    {
                        new TextAwesome
                        {
                            TextSize = 15,
                            Icon = FontAwesome.fa_step_backward,
                            Origin = Anchor.Centre,
                            Anchor = Anchor.Centre
                        }
                    }
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin = Anchor.Centre,
                    Anchor = Anchor.BottomCentre,
                    Position = new Vector2(30, -30),
                    Action = next,
                    Children = new Drawable[]
                    {
                        new TextAwesome
                        {
                            TextSize = 15,
                            Icon = FontAwesome.fa_step_forward,
                            Origin = Anchor.Centre,
                            Anchor = Anchor.Centre
                        }
                    }
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin = Anchor.Centre,
                    Anchor = Anchor.BottomRight,
                    Position = new Vector2(20, -30),
                    Children = new Drawable[]
                    {
                        listButton = new TextAwesome
                        {
                            TextSize = 15,
                            Icon = FontAwesome.fa_bars,
                            Origin = Anchor.Centre,
                            Anchor = Anchor.Centre
                        }
                    }
                },
                progress = new DragBar
                {
                    Origin = Anchor.BottomCentre,
                    Anchor = Anchor.BottomCentre,
                    Height = 10,
                    Colour = colours.Yellow,
                    SeekRequested = seek
                }
            };
        
            this.beatmaps = beatmaps;
            trackManager = osuGame.Audio.Track;
            config = osuGame.Config;
            preferUnicode = osuGame.Config.GetBindable<bool>(OsuConfig.ShowUnicode);
            preferUnicode.ValueChanged += preferUnicode_changed;

            beatmapSource = osuGame.Beatmap ?? new Bindable<WorkingBeatmap>();
            playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>();

            backgroundSprite = new MusicControllerBackground();
            AddInternal(backgroundSprite);
        }
Exemplo n.º 4
0
        private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
        {
            Children = new Drawable[]
            {
                dragContainer = new Container
                {
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    Masking      = true,
                    CornerRadius = 5,
                    EdgeEffect   = new EdgeEffect
                    {
                        Type   = EdgeEffectType.Shadow,
                        Colour = Color4.Black.Opacity(40),
                        Radius = 5,
                    },
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        title = new OsuSpriteText
                        {
                            Origin   = Anchor.BottomCentre,
                            Anchor   = Anchor.TopCentre,
                            Position = new Vector2(0, 40),
                            TextSize = 25,
                            Colour   = Color4.White,
                            Text     = @"Nothing to play",
                            Font     = @"Exo2.0-MediumItalic"
                        },
                        artist = new OsuSpriteText
                        {
                            Origin   = Anchor.TopCentre,
                            Anchor   = Anchor.TopCentre,
                            Position = new Vector2(0, 45),
                            TextSize = 15,
                            Colour   = Color4.White,
                            Text     = @"Nothing to play",
                            Font     = @"Exo2.0-BoldItalic"
                        },
                        new Container
                        {
                            Padding = new MarginPadding {
                                Bottom = progress_height
                            },
                            Height           = bottom_black_area_height,
                            RelativeSizeAxes = Axes.X,
                            Origin           = Anchor.BottomCentre,
                            Anchor           = Anchor.BottomCentre,
                            Children         = new Drawable[]
                            {
                                new FillFlowContainer <Button>
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(5),
                                    Origin       = Anchor.Centre,
                                    Anchor       = Anchor.Centre,
                                    Children     = new[]
                                    {
                                        new Button
                                        {
                                            Action = prev,
                                            Icon   = FontAwesome.fa_step_backward,
                                        },
                                        playButton = new Button
                                        {
                                            Scale     = new Vector2(1.4f),
                                            IconScale = new Vector2(1.4f),
                                            Action    = () =>
                                            {
                                                if (current?.Track == null)
                                                {
                                                    return;
                                                }
                                                if (current.Track.IsRunning)
                                                {
                                                    current.Track.Stop();
                                                }
                                                else
                                                {
                                                    current.Track.Start();
                                                }
                                            },
                                            Icon = FontAwesome.fa_play_circle_o,
                                        },
                                        new Button
                                        {
                                            Action = next,
                                            Icon   = FontAwesome.fa_step_forward,
                                        },
                                    }
                                },
                                new Button
                                {
                                    Origin   = Anchor.Centre,
                                    Anchor   = Anchor.CentreRight,
                                    Position = new Vector2(-bottom_black_area_height / 2, 0),
                                    Icon     = FontAwesome.fa_bars,
                                },
                            }
                        },
                        progress = new DragBar
                        {
                            Origin        = Anchor.BottomCentre,
                            Anchor        = Anchor.BottomCentre,
                            Height        = progress_height,
                            Colour        = colours.Yellow,
                            SeekRequested = seek
                        }
                    }
                }
            };

            this.beatmaps = beatmaps;
            trackManager  = game.Audio.Track;
            preferUnicode = config.GetBindable <bool>(OsuConfig.ShowUnicode);
            preferUnicode.ValueChanged += unicode => updateDisplay(current, TransformDirection.None);

            beatmapSource = game.Beatmap ?? new Bindable <WorkingBeatmap>();
            playList      = beatmaps.GetAllWithChildren <BeatmapSetInfo>();

            currentBackground = new MusicControllerBackground();
            dragContainer.Add(currentBackground);
        }
Exemplo n.º 5
0
 public MusicController(BeatmapDatabase db = null)
 {
     database     = db;
     Width        = 400;
     Height       = 130;
     CornerRadius = 5;
     Masking      = true;
     Anchor       = Anchor.TopRight;//placeholder
     Origin       = Anchor.TopRight;
     Position     = new Vector2(10, 60);
     Children     = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = new Color4(0, 0, 0, 127)
         },
         title = new SpriteText
         {
             Origin   = Anchor.BottomCentre,
             Anchor   = Anchor.TopCentre,
             Position = new Vector2(0, 40),
             TextSize = 25,
             Colour   = Color4.White,
             Text     = @"Nothing to play",
             Font     = @"Exo2.0-MediumItalic"
         },
         artist = new SpriteText
         {
             Origin   = Anchor.TopCentre,
             Anchor   = Anchor.TopCentre,
             Position = new Vector2(0, 45),
             TextSize = 15,
             Colour   = Color4.White,
             Text     = @"Nothing to play",
             Font     = @"Exo2.0-BoldItalic"
         },
         new Box
         {
             RelativeSizeAxes = Axes.X,
             Height           = 50,
             Origin           = Anchor.BottomCentre,
             Anchor           = Anchor.BottomCentre,
             Colour           = new Color4(0, 0, 0, 127)
         },
         new ClickableContainer
         {
             AutoSizeAxes = Axes.Both,
             Origin       = Anchor.Centre,
             Anchor       = Anchor.BottomCentre,
             Position     = new Vector2(0, 30),
             Action       = () =>
             {
                 if (current?.Track == null)
                 {
                     return;
                 }
                 if (current.Track.IsRunning)
                 {
                     current.Track.Stop();
                 }
                 else
                 {
                     current.Track.Start();
                 }
             },
             Children = new Drawable[]
             {
                 playButton = new TextAwesome
                 {
                     TextSize = 30,
                     Icon     = FontAwesome.fa_play_circle_o,
                     Origin   = Anchor.Centre,
                     Anchor   = Anchor.Centre
                 }
             }
         },
         new ClickableContainer
         {
             AutoSizeAxes = Axes.Both,
             Origin       = Anchor.Centre,
             Anchor       = Anchor.BottomCentre,
             Position     = new Vector2(-30, 30),
             Action       = prev,
             Children     = new Drawable[]
             {
                 new TextAwesome
                 {
                     TextSize = 15,
                     Icon     = FontAwesome.fa_step_backward,
                     Origin   = Anchor.Centre,
                     Anchor   = Anchor.Centre
                 }
             }
         },
         new ClickableContainer
         {
             AutoSizeAxes = Axes.Both,
             Origin       = Anchor.Centre,
             Anchor       = Anchor.BottomCentre,
             Position     = new Vector2(30, 30),
             Action       = next,
             Children     = new Drawable[]
             {
                 new TextAwesome
                 {
                     TextSize = 15,
                     Icon     = FontAwesome.fa_step_forward,
                     Origin   = Anchor.Centre,
                     Anchor   = Anchor.Centre
                 }
             }
         },
         new ClickableContainer
         {
             AutoSizeAxes = Axes.Both,
             Origin       = Anchor.Centre,
             Anchor       = Anchor.BottomRight,
             Position     = new Vector2(20, 30),
             Children     = new Drawable[]
             {
                 listButton = new TextAwesome
                 {
                     TextSize = 15,
                     Icon     = FontAwesome.fa_bars,
                     Origin   = Anchor.Centre,
                     Anchor   = Anchor.Centre
                 }
             }
         },
         progress = new DragBar
         {
             Origin        = Anchor.BottomCentre,
             Anchor        = Anchor.BottomCentre,
             Height        = 10,
             Colour        = Color4.Orange,
             SeekRequested = seek
         }
     };
 }
Exemplo n.º 6
0
        public MusicController()
        {
            Width        = 400;
            Height       = 130;
            CornerRadius = 5;
            EdgeEffect   = new EdgeEffect
            {
                Type   = EdgeEffectType.Shadow,
                Colour = new Color4(0, 0, 0, 40),
                Radius = 5,
            };

            Masking  = true;
            Anchor   = Anchor.TopRight;//placeholder
            Origin   = Anchor.TopRight;
            Position = start_position;
            Margin   = new MarginPadding(10);

            Children = new Drawable[]
            {
                title = new SpriteText
                {
                    Origin   = Anchor.BottomCentre,
                    Anchor   = Anchor.TopCentre,
                    Position = new Vector2(0, 40),
                    TextSize = 25,
                    Colour   = Color4.White,
                    Text     = @"Nothing to play",
                    Font     = @"Exo2.0-MediumItalic"
                },
                artist = new SpriteText
                {
                    Origin   = Anchor.TopCentre,
                    Anchor   = Anchor.TopCentre,
                    Position = new Vector2(0, 45),
                    TextSize = 15,
                    Colour   = Color4.White,
                    Text     = @"Nothing to play",
                    Font     = @"Exo2.0-BoldItalic"
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin       = Anchor.Centre,
                    Anchor       = Anchor.BottomCentre,
                    Position     = new Vector2(0, -30),
                    Action       = () =>
                    {
                        if (current?.Track == null)
                        {
                            return;
                        }
                        if (current.Track.IsRunning)
                        {
                            current.Track.Stop();
                        }
                        else
                        {
                            current.Track.Start();
                        }
                    },
                    Children = new Drawable[]
                    {
                        playButton = new TextAwesome
                        {
                            TextSize = 30,
                            Icon     = FontAwesome.fa_play_circle_o,
                            Origin   = Anchor.Centre,
                            Anchor   = Anchor.Centre
                        }
                    }
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin       = Anchor.Centre,
                    Anchor       = Anchor.BottomCentre,
                    Position     = new Vector2(-30, -30),
                    Action       = prev,
                    Children     = new Drawable[]
                    {
                        new TextAwesome
                        {
                            TextSize = 15,
                            Icon     = FontAwesome.fa_step_backward,
                            Origin   = Anchor.Centre,
                            Anchor   = Anchor.Centre
                        }
                    }
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin       = Anchor.Centre,
                    Anchor       = Anchor.BottomCentre,
                    Position     = new Vector2(30, -30),
                    Action       = next,
                    Children     = new Drawable[]
                    {
                        new TextAwesome
                        {
                            TextSize = 15,
                            Icon     = FontAwesome.fa_step_forward,
                            Origin   = Anchor.Centre,
                            Anchor   = Anchor.Centre
                        }
                    }
                },
                new ClickableContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Origin       = Anchor.Centre,
                    Anchor       = Anchor.BottomRight,
                    Position     = new Vector2(20, -30),
                    Children     = new Drawable[]
                    {
                        listButton = new TextAwesome
                        {
                            TextSize = 15,
                            Icon     = FontAwesome.fa_bars,
                            Origin   = Anchor.Centre,
                            Anchor   = Anchor.Centre
                        }
                    }
                },
                progress = new DragBar
                {
                    Origin        = Anchor.BottomCentre,
                    Anchor        = Anchor.BottomCentre,
                    Height        = 10,
                    Colour        = new Color4(255, 204, 34, 255),
                    SeekRequested = seek
                }
            };
        }