Exemplo n.º 1
0
        protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
        {
            var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));

            dependencies.Cache(Session = new KaraokeSessionStatics(Config, Beatmap));
            return(dependencies);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
 private void load(KaraokeRulesetConfigManager config, KaraokeSessionStatics session)
 {
     preemptTimeSliderBar.Current = config.GetBindable <double>(KaraokeRulesetSetting.PracticePreemptTime);
     session.BindWith(KaraokeRulesetSession.NowLyric, lyricPreview.SelectedLyric);
 }
Exemplo n.º 10
0
 private void load(KaraokeSessionStatics session)
 {
     // Ruby/Romaji
     displayRubyCheckBox.Current   = session.GetBindable <bool>(KaraokeRulesetSession.DisplayRuby);
     displayRomajiCheckBox.Current = session.GetBindable <bool>(KaraokeRulesetSession.DisplayRomaji);
 }
Exemplo n.º 11
0
 private void load(KaraokeSessionStatics session)
 {
     session.BindWith(KaraokeRulesetSession.Pitch, bindablePitch);
     session.BindWith(KaraokeRulesetSession.VocalPitch, bindableVocalPitch);
     session.BindWith(KaraokeRulesetSession.SaitenPitch, bindableSaitenPitch);
 }
Exemplo n.º 12
0
        private void load(OsuColour colours, [CanBeNull] KaraokeSessionStatics session)
        {
            session?.BindWith(KaraokeRulesetSession.SaitenPitch, saitenPitch);

            session?.GetBindable <SaitenStatusMode>(KaraokeRulesetSession.SaitenStatus).BindValueChanged(e => { saitenStatus.SaitenStatusMode = e.NewValue; });
        }
Exemplo n.º 13
0
        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);
            }
        }
Exemplo n.º 14
0
 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);
 }
Exemplo n.º 15
0
 private void load(KaraokeSessionStatics session)
 {
     playBackSliderBar.Bindable = session.GetBindable <int>(KaraokeRulesetSession.PlaybackSpeed);
 }
Exemplo n.º 16
0
 private void load(KaraokeSessionStatics session)
 {
     session.BindWith(KaraokeRulesetSession.NowLyric, selectedLyricLine);
 }