XFcVibrate class Reference

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcVibrate Class Reference

Static interface to vibrator hardware. More...

List of all members.

## Static Public Member Functions

INT32 | isSupported ()
| Determines if vibrator hardware is available.
void | playBasic (INT32 aVibrateTime, INT32 aPauseTime, INT32 aCycles)
| Plays basic rumbler effect.
void | playNote (UINT8 aDuration, UINT8 aMagnitude)
| Plays a single vibration note.
void | playSong (UINT8 *aSong, INT32 aNotes, INT aLoop)
| Plays a vibrator 'song'.
void | stop ()
| Attempts to stop the current vibration effect.

## Detailed Description

Static interface to vibrator hardware.

## Member Function Documentation

INT32 XFcVibrate::isSupported | ( |  | ) | `[static]`

Determines if vibrator hardware is available.

Returns:
  0 if no vibrator functionality is available

  1 if basic vibrator support is available.

  2 if rumbler 'songs' are supported.

  3 if rumbler can be set to loop the song.

void XFcVibrate::playBasic | ( | INT32 | aVibrateTime,
|  | INT32 | aPauseTime,
|  | INT32 | aCycles
| ) | `[static]`

| Plays basic rumbler effect. Basic vibrator support doesn't define the magnitude of the vibration at all. Vibration is run in cycles of vibrator on, vibrator off, and these cycles can be repeated. The vibration time is in units of approximately 100ms.

void XFcVibrate::playNote | ( | UINT8 | aDuration,
|  | UINT8 | aMagnitude
| ) | `[static]`

Plays a single vibration note.

This is a convenience function and only works if rumbler 'songs' are supported.

Parameters:

  aDuration | duration of vibration in 10ms units
  aMagnitude | strength of vibration, 0..255

void XFcVibrate::playSong | ( | UINT8 * | aSong,
|  | INT32 | aNotes,
|  | INT | aLoop
| ) | `[static]`

Plays a vibrator 'song'.

Song is an array of 2-byte 'notes', with first byte of the pair noting the 'magniture' of the vibration (0 being silent, 255 being max), and the second byte is the duration, in approximately 10ms intervals. If the hardware supports it, the song can be set to loop until the next play() command.

Note:
  Be sure to keep the 'songs' relatively short - 100 notes is plenty.

void XFcVibrate::stop | ( |  | ) | `[static]`

| Attempts to stop the current vibration effect.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch