async void MainPage_Loaded(object sender, RoutedEventArgs e) { this.systemControls = SystemMediaTransportControls.GetForCurrentView(); this.systemControls.ButtonPressed += systemControls_ButtonPressed; this.systemControls.IsPlayEnabled = true; this.systemControls.IsPauseEnabled = true; this.renderer = await AudioRenderer.CreateAsync(); var rootPath = Windows.ApplicationModel.Package.Current.InstalledLocation.Path + "\\Sounds\\"; this.drumPad = new DrumPad(); this.drumPad.SetDrumSound(DrumKind.Bass, rootPath + "Drum-Bass.wav"); this.drumPad.SetDrumSound(DrumKind.Snare, rootPath + "Drum-Snare.wav"); this.drumPad.SetDrumSound(DrumKind.Shaker, rootPath + "Drum-Shaker.wav"); this.drumPad.SetDrumSound(DrumKind.ClosedHiHat, rootPath + "Drum-Closed-Hi-Hat.wav"); this.drumPad.SetDrumSound(DrumKind.Cowbell, rootPath + "Cowbell.wav"); this.drumPad.SetDrumSound(DrumKind.OpenHiHat, rootPath + "Drum-Open-Hi-Hat.wav"); this.drumPad.SetDrumSound(DrumKind.RideCymbal, rootPath + "Drum-Ride-Cymbal.wav"); this.drumPad.SetDrumSound(DrumKind.FloorTom, rootPath + "developer_loud.wav"); this.drumPad.SetDrumSound(DrumKind.HighTom, rootPath + "satya_fantastic.wav"); this.oscillator = new Oscillator(); this.looper = new Looper(); this.demultiplexer = new AudioDemultiplexer(); this.looper.ListenTo(this.drumPad); this.demultiplexer.ListenTo(this.looper); this.demultiplexer.ListenTo(this.oscillator); this.renderer.ListenTo(this.demultiplexer); Play(); }
public override void OnOpen() { base.OnOpen(); mChipDrawingList = new ChipDrawingList(this); var grade = MainScript.Instance.CurrentGrade = new Grade(); grade.ApplyScoreAndSetting(MainScript.Instance.PlayingScore, UserManager.Instance.LoggedOnUser); mDrumPad = AddChild(new DrumPad(this, FindChild("CenterPanel/DrumPad").gameObject)); mChipLight = AddChild(new ChipLight(this, FindChild("ChipLight").gameObject)); mResultTextColumn = AddChild(new ResultTextColumn(FindChild("CenterPanel/ResultTextColumn").gameObject)); mPlayingSpeed = AddChild(new PlayingSpeed(FindChild("PlayingSpeed").gameObject)); AddChild(new ChipsPanel(this, FindChild("CenterPanel/ChipsPanel").gameObject)); AddChild(new PerformanceDispaly(grade, FindChild("LeftPanel/PerformanceDispaly").gameObject)); AddChild(new ComboDisplay(grade, FindChild("RightPanel/ComboDisplay").gameObject)); AddChild(new ScoreDisplay(grade, FindChild("LeftPanel/ScoreDisplay").gameObject)); AddChild(new SongInfo(FindChild("SongInfo").gameObject)); foreach (var chip in MainScript.Instance.PlayingScore.ChipList) { mChipPlayingState.Add(chip, new ChipPlayingState(chip)); } // enable the drum key checking... InputManager.Instance.EnableDrumKeyChecking = true; InitPlayingState(); }
async void MainPage_Loaded(object sender, RoutedEventArgs e) { this.renderer = await AudioRenderer.CreateAsync(); this.renderer.Start(); var rootPath = Windows.ApplicationModel.Package.Current.InstalledLocation.Path + "\\Sounds\\"; this.drumPad = new DrumPad(); this.drumPad.SetDrumSound(DrumKind.Bass, rootPath + "Drum-Bass.wav"); this.drumPad.SetDrumSound(DrumKind.Snare, rootPath + "Drum-Snare.wav"); this.drumPad.SetDrumSound(DrumKind.Shaker, rootPath + "Drum-Shaker.wav"); this.drumPad.SetDrumSound(DrumKind.ClosedHiHat, rootPath + "Drum-Closed-Hi-Hat.wav"); this.drumPad.SetDrumSound(DrumKind.Cowbell, rootPath + "Cowbell.wav"); this.drumPad.SetDrumSound(DrumKind.OpenHiHat, rootPath + "Drum-Open-Hi-Hat.wav"); this.drumPad.SetDrumSound(DrumKind.RideCymbal, rootPath + "Drum-Ride-Cymbal.wav"); this.drumPad.SetDrumSound(DrumKind.FloorTom, rootPath + "Drum-Floor-Tom.wav"); this.drumPad.SetDrumSound(DrumKind.HighTom, rootPath + "Drum-High-Tom.wav"); this.renderer.ListenTo(this.drumPad); }