private void load(KaraokeRulesetConfigManager config, IBindable <IReadOnlyList <Mod> > mods, IBindable <WorkingBeatmap> beatmap, EditorBeatmap editorBeatmap) { if (editorBeatmap != null) { return; } this.beatmap = beatmap.Value.Beatmap; var disableMicrophoneDeviceByMod = mods.Value.OfType <IApplicableToMicrophone>().Any(x => !x.MicrophoneEnabled); if (disableMicrophoneDeviceByMod) { return; } var beatmapSaitenable = beatmap.Value.Beatmap.IsScorable(); if (!beatmapSaitenable) { return; } var selectedDevice = config.GetBindable <string>(KaraokeRulesetSetting.MicrophoneDevice).Value; var microphoneList = new MicrophoneManager().MicrophoneDeviceNames.ToList(); // Find index by selection id var deviceIndex = microphoneList.IndexOf(selectedDevice); AddHandler(new OsuTKMicrophoneHandler(deviceIndex)); }
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(KaraokeRulesetConfigManager config) { // ruby and romaji config.BindWith(KaraokeRulesetSetting.DisplayRuby, displayRuby); config.BindWith(KaraokeRulesetSetting.DisplayRomaji, displayRomaji); // translate config.BindWith(KaraokeRulesetSetting.UseTranslate, useTranslate); config.BindWith(KaraokeRulesetSetting.PreferLanguage, translateLanguage); }
private void load(KaraokeRulesetConfigManager config) { config.BindWith(KaraokeRulesetSetting.ScrollDirection, configDirection); configDirection.BindValueChanged(direction => { if (scrollingInfo.Direction is Bindable <ScrollingDirection> bindableScrollingDirection) { bindableScrollingDirection.Value = (ScrollingDirection)direction.NewValue; } }, true); config.BindWith(KaraokeRulesetSetting.ScrollTime, scrollingInfo.TimeRange as BindableDouble); }
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(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(GameHost host, KaraokeRulesetConfigManager manager) { var storage = host.Storage; if (!storage.ExistsDirectory(base_path)) { return; } // get all font usage which wants to import. var targetImportFonts = new[] { manager.Get <FontUsage>(KaraokeRulesetSetting.MainFont), manager.Get <FontUsage>(KaraokeRulesetSetting.RubyFont), manager.Get <FontUsage>(KaraokeRulesetSetting.RomajiFont), manager.Get <FontUsage>(KaraokeRulesetSetting.TranslateFont), manager.Get <FontUsage>(KaraokeRulesetSetting.NoteFont), }; // convert to file path then import var targetImportFontPaths = targetImportFonts.Select(x => { var path = Path.Combine(base_path, x.FontName); var pathWithExtension = Path.ChangeExtension(path, "cached"); return(pathWithExtension); }).Where(p => storage.Exists(p)).Distinct().ToArray(); if (!targetImportFontPaths.Any()) { return; } // create font store if wants to import. localFontStore = new FontStore(scaleAdjust: 200, minFilterMode: All.Linear); fontStore.AddStore(localFontStore); foreach (var path in targetImportFontPaths) { var fontName = Path.GetFileNameWithoutExtension(path); var resources = new CachedFontArchiveReader(storage.GetStream(path), fontName); var store = new GlyphStore(new ResourceStore <byte[]>(resources), $"{fontName}", host.CreateTextureLoaderStore(resources)); localFontStore.AddStore(store); } }
private void load(KaraokeRulesetConfigManager config) { config.BindWith(KaraokeRulesetSetting.MicrophoneDevice, bindableMicrophoneDeviceName); }
private void load(KaraokeRulesetConfigManager config, KaraokeSessionStatics session) { preemptTimeSliderBar.Current = config.GetBindable <double>(KaraokeRulesetSetting.PracticePreemptTime); session.BindWith(KaraokeRulesetSession.NowLyric, lyricPreview.SelectedLyric); }
private void load(KaraokeRulesetConfigManager config) { config.BindWith(KaraokeRulesetSetting.ShowCursor, bindableShowCursor); }
private void load(KaraokeRulesetConfigManager config) { preemptTimeSliderBar.Bindable = config.GetBindable <double>(KaraokeRulesetSetting.PracticePreemptTime); }