<commit_before>﻿// Copyright (c) 2007-2017 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;

namespace osu.Game.Screens.Edit.Components
{
    public class PlaybackContainer : BottomBarContainer
    {
        private readonly IconButton playButton;

        public PlaybackContainer()
        {
            PlaybackTabControl tabs;

            Children = new Drawable[]
            {
                playButton = new IconButton
                {
                    Anchor = Anchor.CentreLeft,
                    Origin = Anchor.Centre,
                    Scale = new Vector2(1.4f),
                    IconScale = new Vector2(1.4f),
                    Icon = FontAwesome.fa_play_circle_o,
                    Action = playPause,
                    Padding = new MarginPadding { Left = 20 }
                },
                new OsuSpriteText
                {
                    Origin = Anchor.BottomLeft,
                    Text = "Playback Speed",
                    RelativePositionAxes = Axes.Y,
                    Y = 0.5f,
                    Padding = new MarginPadding { Left = 45 }
                },
                new Container
                {
                    Anchor = Anchor.BottomLeft,
                    Origin = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.Both,
                    Height = 0.5f,
                    Padding = new MarginPadding { Left = 45 },
                    Child = tabs = new PlaybackTabControl(),
                }
            };

            tabs.AddItem(0.25);
            tabs.AddItem(0.75);
            tabs.AddItem(1);

            tabs.Current.ValueChanged += newValue => Track.Tempo.Value = newValue;
        }

        private void playPause()
        {
            if (Track.IsRunning)
                Track.Stop();
            else
                Track.Start();
        }

        protected override void Update()
        {
            base.Update();

            playButton.Icon = Track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o;
        }

        private class PlaybackTabControl : OsuTabControl<double>
        {
            protected override TabItem<double> CreateTabItem(double value) => new PlaybackTabItem(value);

            protected override Dropdown<double> CreateDropdown() => null;

            public PlaybackTabControl()
            {
                RelativeSizeAxes = Axes.Both;
                TabContainer.Spacing = new Vector2(20, 0);
            }
<commit_msg>Rename weird method<commit_after>﻿// Copyright (c) 2007-2017 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;

namespace osu.Game.Screens.Edit.Components
{
    public class PlaybackContainer : BottomBarContainer
    {
        private readonly IconButton playButton;

        public PlaybackContainer()
        {
            PlaybackTabControl tabs;

            Children = new Drawable[]
            {
                playButton = new IconButton
                {
                    Anchor = Anchor.CentreLeft,
                    Origin = Anchor.Centre,
                    Scale = new Vector2(1.4f),
                    IconScale = new Vector2(1.4f),
                    Icon = FontAwesome.fa_play_circle_o,
                    Action = togglePause,
                    Padding = new MarginPadding { Left = 20 }
                },
                new OsuSpriteText
                {
                    Origin = Anchor.BottomLeft,
                    Text = "Playback Speed",
                    RelativePositionAxes = Axes.Y,
                    Y = 0.5f,
                    Padding = new MarginPadding { Left = 45 }
                },
                new Container
                {
                    Anchor = Anchor.BottomLeft,
                    Origin = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.Both,
                    Height = 0.5f,
                    Padding = new MarginPadding { Left = 45 },
                    Child = tabs = new PlaybackTabControl(),
                }
            };

            tabs.AddItem(0.25);
            tabs.AddItem(0.75);
            tabs.AddItem(1);

            tabs.Current.ValueChanged += newValue => Track.Tempo.Value = newValue;
        }

        private void togglePause()
        {
            if (Track.IsRunning)
                Track.Stop();
            else
                Track.Start();
        }

        protected override void Update()
        {
            base.Update();

            playButton.Icon = Track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o;
        }

        private class PlaybackTabControl : OsuTabControl<double>
        {
            protected override TabItem<double> CreateTabItem(double value) => new PlaybackTabItem(value);

            protected override Dropdown<double> CreateDropdown() => null;

            public PlaybackTabControl()
            {
                RelativeSizeAxes = Axes.Both;
                TabContainer.Spacing = new Vector2(20, 0);
            }

{'fraction_non_alphanumeric': 0.08213911219853198, 'fraction_numerical': 0.01223348479552604, 'mean_word_length': 1.4322141946451339, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6738895', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1427, 'n_words': 310}