示例#1
0
        /// <summary>
        ///     Handles when the user wants to increase/decrease the rate of the song.
        /// </summary>
        private static void HandleKeyPressControlRateChange()
        {
            if (!KeyboardManager.CurrentState.IsKeyDown(Keys.LeftControl) &&
                !KeyboardManager.CurrentState.IsKeyDown(Keys.RightControl))
            {
                return;
            }

            // Increase rate.
            if (KeyboardManager.IsUniqueKeyPress(Keys.OemPlus))
            {
                ModManager.AddSpeedMods(GetNextRate(true));
            }

            // Decrease Rate
            if (KeyboardManager.IsUniqueKeyPress(Keys.OemMinus))
            {
                ModManager.AddSpeedMods(GetNextRate(false));
            }

            // Change from pitched to non-pitched
            if (KeyboardManager.IsUniqueKeyPress(Keys.D0))
            {
                ConfigManager.Pitched.Value = !ConfigManager.Pitched.Value;
                Logger.Debug($"Audio Rate Pitching is {(ConfigManager.Pitched.Value ? "Enabled" : "Disabled")}",
                             LogType.Runtime);
            }
        }