protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); dependencies.Cache(Session = new KaraokeSessionStatics(Config, Beatmap)); return(dependencies); }
private void load(OsuColour colours, KaraokeSessionStatics session) { columnFlow.Children.ForEach(x => x.Colour = x.IsSpecial ? colours.Gray9 : colours.Gray0); replaySaitenVisualization.LineColour = Color4.White; realTimeSaitenVisualization.LineColour = colours.Yellow; session.BindWith(KaraokeRulesetSession.SaitenPitch, saitenPitch); }
private void load(KaraokeRulesetConfigManager rulesetConfig, KaraokeSessionStatics session) { rulesetConfig?.BindWith(KaraokeRulesetSetting.ShowCursor, DisplayCursor); // Pitch session.BindWith(KaraokeRulesetSession.Pitch, bindablePitch); session.BindWith(KaraokeRulesetSession.VocalPitch, bindableVocalPitch); session.BindWith(KaraokeRulesetSession.PlaybackSpeed, bindablePlayback); }
private void load(RulesetConfigCache configCache) { // Cache ruleset config manager and session because karaoke input manager need it. var config = (KaraokeRulesetConfigManager)configCache.GetConfigFor(Ruleset.Value.CreateInstance()); var session = new KaraokeSessionStatics(config, null); Dependencies.Cache(config); Dependencies.Cache(session); }
private void load(OsuColour colours, KaraokeSessionStatics session) { columnFlow.Children.ForEach(x => x.Colour = x.IsSpecial ? colours.Gray9 : colours.Gray0); replaySaitenVisualization.LineColour = Color4.White; realTimeSaitenVisualization.LineColour = colours.Yellow; session.BindWith(KaraokeRulesetSession.SaitenPitch, saitenPitch); session.GetBindable <SaitenStatusMode>(KaraokeRulesetSession.SaitenStatus).BindValueChanged(e => { saitenStatus.SaitenStatusMode = e.NewValue; }); RegisterPool <Note, DrawableNote>(50); RegisterPool <BarLine, DrawableBarLine>(15); }
private void load(KaraokeRulesetConfigManager rulesetConfig, KaraokeSessionStatics session) { // Cursor rulesetConfig?.BindWith(KaraokeRulesetSetting.ShowCursor, DisplayCursor); // Alpha rulesetConfig?.BindWith(KaraokeRulesetSetting.NoteAlpha, notePlayfieldAlpha); rulesetConfig?.BindWith(KaraokeRulesetSetting.LyricAlpha, lyricPlayfieldAlpha); // Pitch session.BindWith(KaraokeRulesetSession.Pitch, bindablePitch); session.BindWith(KaraokeRulesetSession.VocalPitch, bindableVocalPitch); session.BindWith(KaraokeRulesetSession.PlaybackSpeed, bindablePlayback); }
private void load(KaraokeRulesetConfigManager rulesetConfig, KaraokeSessionStatics session) { // Translate session.BindWith(KaraokeRulesetSession.UseTranslate, translate); session.BindWith(KaraokeRulesetSession.PreferLanguage, translateLanguage); // Ruby/Romaji session.BindWith(KaraokeRulesetSession.DisplayRuby, displayRuby); session.BindWith(KaraokeRulesetSession.DisplayRomaji, displayRomaji); // Practice rulesetConfig.BindWith(KaraokeRulesetSetting.PracticePreemptTime, preemptTime); session.BindWith(KaraokeRulesetSession.NowLyric, nowLyric); }
private void load(KaraokeSessionStatics session) { // Translate translateCheckBox.Current = session.GetBindable <bool>(KaraokeRulesetSession.UseTranslate); translateDropDown.Current = session.GetBindable <CultureInfo>(KaraokeRulesetSession.PreferLanguage); // hidden dropdown if not translate translateCheckBox.Current.BindValueChanged(value => { if (value.NewValue) { translateText.Show(); translateDropDown.Show(); } else { translateText.Hide(); translateDropDown.Hide(); } }, true); }
private void load(KaraokeRulesetConfigManager config, KaraokeSessionStatics session) { preemptTimeSliderBar.Current = config.GetBindable <double>(KaraokeRulesetSetting.PracticePreemptTime); session.BindWith(KaraokeRulesetSession.NowLyric, lyricPreview.SelectedLyric); }
private void load(KaraokeSessionStatics session) { // Ruby/Romaji displayRubyCheckBox.Current = session.GetBindable <bool>(KaraokeRulesetSession.DisplayRuby); displayRomajiCheckBox.Current = session.GetBindable <bool>(KaraokeRulesetSession.DisplayRomaji); }
private void load(KaraokeSessionStatics session) { session.BindWith(KaraokeRulesetSession.Pitch, bindablePitch); session.BindWith(KaraokeRulesetSession.VocalPitch, bindableVocalPitch); session.BindWith(KaraokeRulesetSession.SaitenPitch, bindableSaitenPitch); }
private void load(OsuColour colours, [CanBeNull] KaraokeSessionStatics session) { session?.BindWith(KaraokeRulesetSession.SaitenPitch, saitenPitch); session?.GetBindable <SaitenStatusMode>(KaraokeRulesetSession.SaitenStatus).BindValueChanged(e => { saitenStatus.SaitenStatusMode = e.NewValue; }); }
private void load(KaraokeRulesetConfigManager config, IBindable <IReadOnlyList <Mod> > mods, IBindable <WorkingBeatmap> beatmap, KaraokeSessionStatics session, EditorBeatmap editorBeatmap) { if (editorBeatmap != null) { session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.Edit); return; } this.beatmap = beatmap.Value.Beatmap; var disableMicrophoneDeviceByMod = mods.Value.OfType <IApplicableToMicrophone>().Any(x => !x.MicrophoneEnabled); if (disableMicrophoneDeviceByMod) { session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.AutoPlay); return; } var beatmapSaitenable = beatmap.Value.Beatmap.IsScorable(); if (!beatmapSaitenable) { session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.NotSaitening); return; } try { var selectedDevice = config.Get <string>(KaraokeRulesetSetting.MicrophoneDevice); var microphoneList = new MicrophoneManager().MicrophoneDeviceNames.ToList(); // Find index by selection id var deviceIndex = microphoneList.IndexOf(selectedDevice); AddHandler(new OsuTKMicrophoneHandler(deviceIndex)); session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.Saitening); } catch (Exception ex) { Logger.Error(ex, "Microphone initialize error."); // todo : set real error by exception session.SetValue(KaraokeRulesetSession.SaitenStatus, SaitenStatusMode.WindowsMicrophonePermissionDeclined); } }
private void load(KaraokeSessionStatics session) { pitchSliderBar.Bindable = session.GetBindable <int>(KaraokeRulesetSession.Pitch); vocalPitchSliderBar.Bindable = session.GetBindable <int>(KaraokeRulesetSession.VocalPitch); saitenPitchSliderBar.Bindable = session.GetBindable <int>(KaraokeRulesetSession.SaitenPitch); }
private void load(KaraokeSessionStatics session) { playBackSliderBar.Bindable = session.GetBindable <int>(KaraokeRulesetSession.PlaybackSpeed); }
private void load(KaraokeSessionStatics session) { session.BindWith(KaraokeRulesetSession.NowLyric, selectedLyricLine); }