at.wisch.joystick
Interface AdvancedFFController

All Superinterfaces:
AdvancedController, Controller
All Known Implementing Classes:
FFJoystick

public interface AdvancedFFController
extends AdvancedController

The interface AdvancedFFController. It extends AdvancedController to contain all the necessary methods for Force Feedback (FF) controllers.

Author:
Martin Wischenbart

Method Summary
 boolean destroyAll()
          Destroy all effects: remove all effects, that are currently stored on the device.
 boolean destroyEffect(Effect effect)
          Destroy effect: remove an effect from the device.
 int getAutoCenter()
          Gets the currently set autocenter value.
 int getGain()
          Gets the currently set gain value.
 int getNumOfFFAxes()
          Gets the number of FF axes a device has.
 int getPlayableNumOfEffects()
          Gets the number of effects a device can play simultaneously.
 int getStorableNumOfEffects()
          Gets the number of effects a device can store.
 java.util.HashSet<java.lang.Class<? extends Effect>> getSupportedEffects()
          Gets a HashSet of supported effects by this controller.
 boolean isAutocenterSupported()
          Checks if auto centering is supported by the device.
 boolean isEffectSupported(java.lang.Class<? extends Effect> effectClass)
          Checks if an effect is supported.
 boolean isEffectSupported(Effect effect)
          Checks if an effect is supported.
 boolean isGainSupported()
          Checks if a device supports setting gain.
 boolean isPaused()
          Checks if the device is currently paused.
 boolean isPauseSupported()
          Checks if the device supports pause/unpause for played effects.
 boolean isPlaying(Effect effect)
          Checks if an effect is currently playing.
 boolean isQueryingEffectStatusSupported()
          Checks if is querying the effect status is supported.
 boolean newEffect(Effect effect)
          Upload a new effect to the device.
 boolean pause()
          Pause all effects that are currently playing.
 boolean playEffect(Effect effect, int iterations)
          Playback an effect on the device.
 boolean setAutoCenter(int autocenterValue)
          Sets the auto center value in %.
 boolean setGain(int gainValue)
          Sets the gain value in %.
 boolean stopAll()
          Stop all effects that are currently stored on the device.
 boolean stopEffect(Effect effect)
          Stop an effect which is currently on the device.
 boolean unpause()
          Resume all effects that were playing before pause() was called.
 boolean updateEffect(Effect effect)
          Update an effect which was already uploaded to the device.
 
Methods inherited from interface at.wisch.joystick.AdvancedController
getBall1Delta, getBall2Delta, getBall3Delta, getBall4Delta, getBallCount, getBallDelta, getBallName, getPov1X, getPov1Y, getPov2X, getPov2Y, getPov3X, getPov3Y, getPov4X, getPov4Y, getPovCount, getPovDirection, getPovName, getPovX, getPovY, getUAxisDeadZone, getUAxisValue, getVAxisDeadZone, getVAxisValue, isFFJoystick, setUAxisDeadZone, setVAxisDeadZone
 
Methods inherited from interface org.lwjgl.input.Controller
getAxisCount, getAxisName, getAxisValue, getButtonCount, getButtonName, getDeadZone, getIndex, getName, getPovX, getPovY, getRXAxisDeadZone, getRXAxisValue, getRYAxisDeadZone, getRYAxisValue, getRZAxisDeadZone, getRZAxisValue, getXAxisDeadZone, getXAxisValue, getYAxisDeadZone, getYAxisValue, getZAxisDeadZone, getZAxisValue, isButtonPressed, poll, setDeadZone, setRXAxisDeadZone, setRYAxisDeadZone, setRZAxisDeadZone, setXAxisDeadZone, setYAxisDeadZone, setZAxisDeadZone
 

Method Detail

getSupportedEffects

java.util.HashSet<java.lang.Class<? extends Effect>> getSupportedEffects()
Gets a HashSet of supported effects by this controller.

Returns:
a HashSet containing the classes of supported effects
See Also:
HashSet, Effect

isEffectSupported

boolean isEffectSupported(Effect effect)
Checks if an effect is supported.

Parameters:
effect - an Effect instance
Returns:
true, if the Effect is supported by this controller. false, otherwise.
See Also:
Effect

isEffectSupported

boolean isEffectSupported(java.lang.Class<? extends Effect> effectClass)
Checks if an effect is supported.

Parameters:
effectClass - an Effect class
Returns:
true, if the Effect is supported by this controller. false, otherwise.
See Also:
Effect

isQueryingEffectStatusSupported

boolean isQueryingEffectStatusSupported()
Checks if is querying the effect status is supported.

Returns:
true, if is querying effect status supported. false, otherwise.
See Also:
Effect

getNumOfFFAxes

int getNumOfFFAxes()
Gets the number of FF axes a device has. For most controllers that is two. For a flight simulator joystick the axes usually correspond to the X and Y axes of the stick. For a gamepad the axes correspond to rumble motors.

Returns:
the number of FF axes the device has
See Also:
Direction

getStorableNumOfEffects

int getStorableNumOfEffects()
Gets the number of effects a device can store.

Returns:
the number of storable effects
See Also:
getPlayableNumOfEffects()

getPlayableNumOfEffects

int getPlayableNumOfEffects()
Gets the number of effects a device can play simultaneously.

Returns:
the number of effects playable at once
See Also:
getStorableNumOfEffects()

isGainSupported

boolean isGainSupported()
Checks if a device supports setting gain. Gain is a factor to scale the strength of all FF effects on a device. By default the gain is set to 100 (%), which is the maximum (DEFAULT_GAIN_VALUE).

Returns:
true, if is gain supported. false, otherwise.
See Also:
setGain(int), getGain()

getGain

int getGain()
Gets the currently set gain value.

Returns:
the currently set gain (value from 0 to 100)
See Also:
setGain(int), isGainSupported()

setGain

boolean setGain(int gainValue)
Sets the gain value in %. Change the gain to scale the strength of all FF effects on this device.

Parameters:
gainValue - the % gain value: any value from 0 to 100
Returns:
true, if successful. false, if not successful or if setting gain is not supported.
See Also:
isGainSupported(), getGain()

isAutocenterSupported

boolean isAutocenterSupported()
Checks if auto centering is supported by the device. Auto centering means that a force towards the center of the stick is active at all times. By default autocenter is disabled, i.e. set to 0 (%), which is the minimum (DEFAULT_AUTOCENTER_VALUE).

Returns:
true, if autocenter is supported. false, otherwise.
See Also:
getAutoCenter(), setAutoCenter(int)

getAutoCenter

int getAutoCenter()
Gets the currently set autocenter value.

Returns:
the currently set autocenter value (value from 0 to 100)
See Also:
isAutocenterSupported(), setAutoCenter(int)

setAutoCenter

boolean setAutoCenter(int autocenterValue)
Sets the auto center value in %. Set auto centering to enable a force towards the center of the stick on this device.

Parameters:
autocenterValue - the % autocenter strength: a value from 0 to 100
Returns:
true, if successful. false, if not successful or if setting autocenter is not supported.
See Also:
isAutocenterSupported(), getAutoCenter()

isPauseSupported

boolean isPauseSupported()
Checks if the device supports pause/unpause for played effects.

Returns:
true, if is pause/unpause supported. false, otherwise.
See Also:
pause(), unpause(), isPaused()

pause

boolean pause()
Pause all effects that are currently playing.

Returns:
true, if successful. false, if not successful or if pause/unpause is not supported.
See Also:
isPauseSupported(), unpause(), isPaused()

unpause

boolean unpause()
Resume all effects that were playing before pause() was called.

Returns:
true, if successful. false, if not successful or if pause/unpause is not supported.
See Also:
isPauseSupported(), pause(), isPaused()

isPaused

boolean isPaused()
Checks if the device is currently paused.

Returns:
true, if the device is paused. false if the device is not paused or if pause/unpause is not supported.
See Also:
isPauseSupported(), pause(), unpause()

newEffect

boolean newEffect(Effect effect)
Upload a new effect to the device.

Parameters:
effect - the Effect
Returns:
true, if successful. false, if not successful or if the effect is not supported by this device.
See Also:
isEffectSupported(Effect), playEffect(Effect, int), stopEffect(Effect), destroyEffect(Effect)

playEffect

boolean playEffect(Effect effect,
                   int iterations)
Playback an effect on the device. If the Effect was not uploaded before, it will be uploaded and played immediately.

Parameters:
effect - the Effect to be played
iterations - the number of iterations (i.e. how often to play the effect): any positive integer, or INFINITE_TIMES
Returns:
true, if successful. false, if not successful or if the effect is not supported by this device.
See Also:
newEffect(Effect), updateEffect(Effect), stopEffect(Effect), pause(), unpause()

isPlaying

boolean isPlaying(Effect effect)
Checks if an effect is currently playing.

Parameters:
effect - the Effect to check
Returns:
true, if the effect is playing at the moment. false, if the effect was not uploaded before or if it is not supported.
See Also:
playEffect(Effect, int), stopEffect(Effect), pause(), unpause()

updateEffect

boolean updateEffect(Effect effect)
Update an effect which was already uploaded to the device. If the Effect was not uploaded before, it will be uploaded. If you change the properties of an effect, you always have to call updateEffect so the changes will be stored on the device. You can update an effect while it is playing, but be aware that sometimes it causes the effect to restart (i.e. play from the beginning).

Parameters:
effect - the Effect to be updated
Returns:
true, if successful. false, if not successful or if the effect is not supported by this device.
See Also:
newEffect(Effect), playEffect(Effect, int)

stopEffect

boolean stopEffect(Effect effect)
Stop an effect which is currently on the device. It does not matter if it is actually played at the moment or not.

Parameters:
effect - the Effect to be stopped
Returns:
true, if the Effect was stopped (no matter if it was actually being played). false, if the Effect was not on the device or stopping was not successful.
See Also:
stopAll(), destroyEffect(Effect)

destroyEffect

boolean destroyEffect(Effect effect)
Destroy effect: remove an effect from the device. It does not matter if it is being played or not. The Effect object will remain intact and can be uploaded again later or onto other devices. If effects are being played during destruction, they will stop.

Parameters:
effect - the Effect to be removed from the device
Returns:
true, if successful. false, if the Effect was not on the device or destroying was not successful.
See Also:
destroyAll(), stopEffect(Effect)

stopAll

boolean stopAll()
Stop all effects that are currently stored on the device. It does not matter how many effects that are and no matter if any of them are being played or not.

Returns:
true, if successful. false, if not successful.
See Also:
stopEffect(Effect), destroyAll()

destroyAll

boolean destroyAll()
Destroy all effects: remove all effects, that are currently stored on the device. It does not matter if they are being played or not. If effects are being played during destruction, they will stop.

Returns:
true, if successful. false, if not successful.
See Also:
destroyEffect(Effect), stopAll()