protected override void OnEntering(GameMode last) { base.OnEntering(last); Scheduler.Add(delegate { welcome.Play(); Scheduler.AddDelayed(delegate { bgm.Start(); mainMenu = new MainMenu(); mainMenu.Preload(Game); Scheduler.AddDelayed(delegate { DidLoadMenu = true; Push(mainMenu); }, 2300); }, 600); }); logo.ScaleTo(0.4f); logo.FadeOut(); logo.ScaleTo(1, 4400, EasingTypes.OutQuint); logo.FadeIn(20000, EasingTypes.OutQuint); }
private void playSample() { if (Clock == null || Clock.CurrentTime - lastSampleTime <= 50) { return; } lastSampleTime = Clock.CurrentTime; sample.Frequency.Value = 1 + NormalizedValue * 0.2f; sample.Play(); }
protected override void OnUnchecked() { sampleUnchecked?.Play(); nub.State = CheckBoxState.Unchecked; if (bindable != null) { bindable.Value = false; } }
protected override void OnChecked() { sampleChecked?.Play(); nub.State = CheckBoxState.Checked; if (bindable != null) { bindable.Value = true; } }
protected override void OnResuming(GameMode last) { //we also handle the exit transition. seeya.Play(); double fadeOutTime = (last.LifetimeEnd - Time.Current) + 100; Scheduler.AddDelayed(Exit, fadeOutTime); //don't want to fade out completely else we will stop running updates and shit will hit the fan. Game.FadeTo(0.01f, fadeOutTime); base.OnResuming(last); }
protected override bool OnClick(Framework.Input.InputState state) { didClick = true; colourContainer.ResizeTo(new Vector2(1.5f, 1f), click_duration, EasingTypes.In); flash(); SampleClick?.Play(); Action?.Invoke(); Delay(click_duration); Schedule(delegate { colourContainer.ResizeTo(new Vector2(0.8f, 1f), 0, EasingTypes.None); spriteText.Spacing = Vector2.Zero; glowContainer.FadeOut(); }); return(true); }
/// <summary> /// selection has been changed as the result of interaction with the carousel. /// </summary> private void selectionChanged(BeatmapGroup group, BeatmapInfo beatmap) { if (!beatmap.Equals(Beatmap?.BeatmapInfo)) { if (beatmap.BeatmapSetID == Beatmap?.BeatmapInfo.BeatmapSetID) { sampleChangeDifficulty.Play(); } else { sampleChangeBeatmap.Play(); } Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); } ensurePlayingSelected(); }
protected override bool OnClick(InputState state) { var flash = new Box { RelativeSizeAxes = Axes.Both, Shear = new Vector2(shear, 0), Colour = Color4.White.Opacity(0.5f), }; Add(flash); flash.Alpha = 1; flash.FadeOut(500, EasingTypes.OutQuint); flash.Expire(); ActivationSound.Play(); return(base.OnClick(state)); }
//private AudioTrack bgm; public override void Load() { base.Load(); OsuGame osu = (OsuGame)Game; AudioSample welcome = Game.Audio.Sample.Get(@"welcome"); welcome.Play(); //bgm = Game.Audio.Track.Get(@"circles"); //bgm.Start(); Children = new Drawable[] { new ParallaxContainer { ParallaxAmount = 0.01f, Children = new Drawable[] { buttons = new ButtonSystem() { OnChart = delegate { Push(new ChartListing()); }, OnDirect = delegate { Push(new OnlineListing()); }, OnEdit = delegate { Push(new SongSelectEdit()); }, OnSolo = delegate { Push(new SongSelectPlay()); }, OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, OnExit = delegate { Game.Scheduler.AddDelayed(delegate { Game.Host.Exit(); }, ButtonSystem.EXIT_DELAY); }, OnSettings = delegate { osu.Options.PoppedOut = !osu.Options.PoppedOut; }, } } } }; }
public void TriggerEvent(Project project, double currentTime) { if (EventTime + 1 < currentTime) { return; } var fullPath = Path.Combine(project.MapsetPath, audioPath); AudioSample sample = null; try { sample = project.AudioContainer.Get(fullPath); } catch (IOException) { // Happens when another process is writing to the file, will try again later. return; } sample.Play((float)Volume * 0.01f); }
public void c8CHIP8_onPlaySound(object sender, EventArgs e) { _sampleDing.Play(); }
static void c8CHIP8_onPlaySound(object sender, EventArgs e) { sample.Play(); }
public override void Update() { if (!AudioEngine.BeatSyncing) { return; } double beatTotal = AudioEngine.SyncTime / AudioEngine.BeatLength; int timeSignature = (int)AudioEngine.TimeSignature; //Metronome sounds in timing mode CurrentBeatTotal = (int)Math.Floor(beatTotal); CurrentBeat = (int)beatTotal % timeSignature; CurrentStanza = CurrentBeatTotal / timeSignature; int currBeat2x = (int)(2.0f * beatTotal); int currBeat3x = (int)(3.0f * beatTotal); bool extraBleep = (editor.BeatSnapDivisor % 3 == 0) ? (currBeat3x > lastMetronomeBeat3x) : (currBeat2x > lastMetronomeBeat2x); if (AudioEngine.SyncTime < 0) { CurrentBeat += 3; CurrentStanza -= 1; } if (Enabled && AudioEngine.AudioState == AudioStates.Playing) { if (lastMetronomeBeat == CurrentBeatTotal - 1 || lastMetronomeBeat > CurrentBeatTotal) { if (DisableCount == 0) { switch (AudioEngine.TimeSignature) { case TimeSignatures.SimpleQuadruple: switch (CurrentBeat) { case 0: s_metronomeHigh.Play(true, true); break; case 1: case 3: s_metronomeLow.Play(true, true); s_metronomeLow.Volume = 0.8f; break; case 2: s_metronomeLow.Play(true, true); s_metronomeLow.Volume = 0.6f; break; } break; default: switch (CurrentBeat) { case 0: s_metronomeHigh.Play(true, true); break; default: s_metronomeLow.Play(true, true); s_metronomeLow.Volume = 0.8f; break; } break; } } else { DisableCount--; } } // 2x metronome bleeps when Ctrl is held down. else if (extraBleep && KeyboardHandler.ControlPressed) { s_metronomeLow.Play(true, true); s_metronomeLow.Volume = 0.8f; } } lastMetronomeBeat = CurrentBeatTotal; lastMetronomeBeat2x = currBeat2x; lastMetronomeBeat3x = currBeat3x; }
private void TriggerSlam(Laser laser, ObjectReference obj) { laserSlamSample.Play(true); }