private void load(NowPlayingOverlay music) { StateContainer = music; Flow.Padding = new MarginPadding { Horizontal = Toolbar.HEIGHT / 4 }; Flow.Add(volumeDisplay = new Container { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Width = 3f, Height = IconContainer.Height, Margin = new MarginPadding { Horizontal = 2.5f }, Masking = true, Children = new[] { new Circle { RelativeSizeAxes = Axes.Both, Colour = Color4.White.Opacity(0.25f), }, volumeBar = new Circle { RelativeSizeAxes = Axes.Both, Height = 0f, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Colour = Color4.White, } } }); }
public TestManageFontPreview() { Clock = new FramedClock(); Clock.ProcessFrame(); Add(np = new NowPlayingOverlay { Origin = Anchor.TopRight, Anchor = Anchor.TopRight, }); }
private void load() { Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo); nowPlayingOverlay = new NowPlayingOverlay { Origin = Anchor.Centre, Anchor = Anchor.Centre }; Add(musicController); Add(nowPlayingOverlay); }
private void load(AudioManager audio, GameHost host) { Dependencies.Cache(rulesets = new RulesetStore(ContextFactory)); Dependencies.Cache(manager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, host, Beatmap.Default)); Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo); nowPlayingOverlay = new NowPlayingOverlay { Origin = Anchor.Centre, Anchor = Anchor.Centre }; Add(musicController); Add(nowPlayingOverlay); }
public TestSceneNowPlayingOverlay() { Clock = new FramedClock(); var np = new NowPlayingOverlay { Origin = Anchor.Centre, Anchor = Anchor.Centre }; Add(musicController); Add(np); AddStep(@"show", () => np.Show()); AddToggleStep(@"toggle beatmap lock", state => Beatmap.Disabled = state); AddStep(@"show", () => np.Hide()); }
public TestSceneBeatSyncedContainer() { Clock = new FramedClock(); Clock.ProcessFrame(); AddRange(new Drawable[] { new BeatContainer { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, }, np = new NowPlayingOverlay { Origin = Anchor.TopRight, Anchor = Anchor.TopRight, } }); }
public TestSceneScanLine() { Clock = new FramedClock(); Clock.ProcessFrame(); AddRange(new Drawable[] { musicController, new ScanLine { RelativeSizeAxes = Axes.Both }, np = new NowPlayingOverlay { Origin = Anchor.TopRight, Anchor = Anchor.TopRight, } }); }
public void TestOverlayClosing() { // use now playing overlay for "overlay -> background" drag case // since most overlays use a scroll container that absorbs on mouse down NowPlayingOverlay nowPlayingOverlay = null; AddUntilStep("Wait for now playing load", () => (nowPlayingOverlay = Game.ChildrenOfType <NowPlayingOverlay>().FirstOrDefault()) != null); AddStep("enter menu", () => InputManager.Key(Key.Enter)); AddUntilStep("toolbar displayed", () => Game.Toolbar.State.Value == Visibility.Visible); AddStep("open now playing", () => InputManager.Key(Key.F6)); AddUntilStep("now playing is visible", () => nowPlayingOverlay.State.Value == Visibility.Visible); // drag tests // background -> toolbar AddStep("move cursor to background", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.BottomRight)); AddStep("press left mouse button", () => InputManager.PressButton(MouseButton.Left)); AddStep("move cursor to toolbar", () => InputManager.MoveMouseTo(Game.Toolbar.ScreenSpaceDrawQuad.Centre)); AddStep("release left mouse button", () => InputManager.ReleaseButton(MouseButton.Left)); AddAssert("now playing is hidden", () => nowPlayingOverlay.State.Value == Visibility.Hidden); AddStep("press now playing hotkey", () => InputManager.Key(Key.F6)); // toolbar -> background AddStep("press left mouse button", () => InputManager.PressButton(MouseButton.Left)); AddStep("move cursor to background", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.BottomRight)); AddStep("release left mouse button", () => InputManager.ReleaseButton(MouseButton.Left)); AddAssert("now playing is still visible", () => nowPlayingOverlay.State.Value == Visibility.Visible); // background -> overlay AddStep("press left mouse button", () => InputManager.PressButton(MouseButton.Left)); AddStep("move cursor to now playing overlay", () => InputManager.MoveMouseTo(nowPlayingOverlay.ScreenSpaceDrawQuad.Centre)); AddStep("release left mouse button", () => InputManager.ReleaseButton(MouseButton.Left)); AddAssert("now playing is still visible", () => nowPlayingOverlay.State.Value == Visibility.Visible); // overlay -> background AddStep("press left mouse button", () => InputManager.PressButton(MouseButton.Left)); AddStep("move cursor to background", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.BottomRight)); AddStep("release left mouse button", () => InputManager.ReleaseButton(MouseButton.Left)); AddAssert("now playing is still visible", () => nowPlayingOverlay.State.Value == Visibility.Visible); // background -> background AddStep("press left mouse button", () => InputManager.PressButton(MouseButton.Left)); AddStep("move cursor to left", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.BottomLeft)); AddStep("release left mouse button", () => InputManager.ReleaseButton(MouseButton.Left)); AddAssert("now playing is hidden", () => nowPlayingOverlay.State.Value == Visibility.Hidden); AddStep("press now playing hotkey", () => InputManager.Key(Key.F6)); // click tests // toolbar AddStep("move cursor to toolbar", () => InputManager.MoveMouseTo(Game.Toolbar.ScreenSpaceDrawQuad.Centre)); AddStep("click left mouse button", () => InputManager.Click(MouseButton.Left)); AddAssert("now playing is still visible", () => nowPlayingOverlay.State.Value == Visibility.Visible); // background AddStep("move cursor to background", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.BottomRight)); AddStep("click left mouse button", () => InputManager.Click(MouseButton.Left)); AddAssert("now playing is hidden", () => nowPlayingOverlay.State.Value == Visibility.Hidden); }
private void load(NowPlayingOverlay music) { StateContainer = music; }