IsRumbleSet() public method

public IsRumbleSet ( ) : bool
return bool
コード例 #1
0
ファイル: DS4Device.cs プロジェクト: danemadsen/DS4Windows
        // Use the "most recently set" haptic state for each of light bar/motor.
        private void setHapticState()
        {
            DS4Color lightBarColor = LightBarColor;
            byte     lightBarFlashDurationOn = LightBarOnDuration, lightBarFlashDurationOff = LightBarOffDuration;
            byte     rumbleMotorStrengthLeftHeavySlow = LeftHeavySlowRumble, rumbleMotorStrengthRightLightFast = rightLightFastRumble;
            int      hapticLen = hapticState.Length;

            for (int i = 0; i < hapticLen; i++)
            {
                DS4HapticState haptic = hapticState[i];
                if (i == hapticStackIndex)
                {
                    break; // rest haven't been used this time
                }
                if (haptic.IsLightBarSet())
                {
                    lightBarColor            = haptic.LightBarColor;
                    lightBarFlashDurationOn  = haptic.LightBarFlashDurationOn;
                    lightBarFlashDurationOff = haptic.LightBarFlashDurationOff;
                }

                if (haptic.IsRumbleSet())
                {
                    rumbleMotorStrengthLeftHeavySlow  = haptic.RumbleMotorStrengthLeftHeavySlow;
                    rumbleMotorStrengthRightLightFast = haptic.RumbleMotorStrengthRightLightFast;
                }
            }

            LightBarColor        = lightBarColor;
            LightBarOnDuration   = lightBarFlashDurationOn;
            LightBarOffDuration  = lightBarFlashDurationOff;
            LeftHeavySlowRumble  = rumbleMotorStrengthLeftHeavySlow;
            RightLightFastRumble = rumbleMotorStrengthRightLightFast;
        }
コード例 #2
0
ファイル: DS4Device.cs プロジェクト: danemadsen/DS4Windows
 private void setTestRumble()
 {
     if (testRumble.IsRumbleSet())
     {
         pushHapticState(testRumble);
         if (testRumble.RumbleMotorsExplicitlyOff)
         {
             testRumble.RumbleMotorsExplicitlyOff = false;
         }
     }
 }