RumbleManager Class Reference

#include <RumbleManager.h>

Inheritance diagram for RumbleManager:
ListenerObject

# Public Types

typedef const RumbleEffectSpec RumbleEffectROMSpec

# Public Member Functions

override bool onEvent (ListenerObject eventFirer, uint16 eventCode)
void reset ()
 Reset the manager's state.

# Static Public Member Functions

static void startEffect (const RumbleEffectSpec *rumbleEffectSpec)
static void stopEffect (const RumbleEffectSpec *rumbleEffectSpec)
static void setAsync (bool async)
static void setOverridePreviousEffect (bool overridePreviousEffect)

# Protected Attributes

uint8 rumbleCommands [10]
 Queue of commands to broadcast.
bool async
bool overridePreviousEffect
uint8 rumbleCommandIndex
 Index of the command in the queue to broadcast next.
const RumbleEffectSpecrumbleEffectSpec
 Rumble effect spec being broadcasted.
RumbleEffectSpec cachedRumbleEffect
 Cached rumble effect to prevent broadcasting again previous send commands.

# Additional Inherited Members

- Private Member Functions inherited from ListenerObject
void constructor ()
 Class' constructor.
void destructor ()
 Class' destructor.
void addEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListeners (uint16 eventCode)
void removeAllEventListeners ()
 Remove all listener objects.
bool hasActiveEventListeners ()
void fireEvent (uint16 eventCode)
void sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay)
void sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay)
void discardAllMessages ()
 Discard all messages, both to be sent and to be received.
void discardMessages (uint32 message)
virtual bool handleMessage (Telegram telegram)
- Private Attributes inherited from ListenerObject
VirtualList events
 List of registered events.
int8 eventFirings
 Counter that keeps track of the number of fired events to prevent race conditions in nested firings.

# Detailed Description

Class RumbleManager

Inherits from Object

Manages rumble effects.

Definition at line 108 of file RumbleManager.h.

# Member Typedef Documentation

# RumbleEffectROMSpec

A RumbleEffect spec that is stored in ROM

Definition at line 97 of file RumbleManager.h.

# Member Function Documentation

# onEvent()

bool RumbleManager::onEvent ( ListenerObject eventFirer,
uint16 eventCode )
virtual

Process an event that the instance is listen for.

Parameters
eventFirerListenerObject that signals the event
eventCodeCode of the firing event
Returns
False if the listener has to be removed; true to keep it

Reimplemented from ListenerObject.

Definition at line 113 of file RumbleManager.c.

# reset()

secure void RumbleManager::reset ( )

Reset the manager's state.

Definition at line 130 of file RumbleManager.c.

# setAsync()

static void RumbleManager::setAsync ( bool async)
static

Set the async flag.

Parameters
asyncIf true, rumble commands are broadcasted asynchronously

Definition at line 88 of file RumbleManager.c.

# setOverridePreviousEffect()

static void RumbleManager::setOverridePreviousEffect ( bool overridePreviousEffect)
static

Set the flag to broadcast new effects regardless of if there is a previous queue effect pending broadcasted

Parameters
overridePreviousEffectIf true, new effects are broadcasted regardless of if there is a queued effect pending broadcasting

Definition at line 98 of file RumbleManager.c.

# startEffect()

static void RumbleManager::startEffect ( const RumbleEffectSpec * rumbleEffectSpec)
static

Start a rumble effect configured with the provided spec.

Parameters
rumbleEffectSpecSpecification of the rumble effect to play

Definition at line 29 of file RumbleManager.c.

# stopEffect()

static void RumbleManager::stopEffect ( const RumbleEffectSpec * rumbleEffectSpec)
static

Stop a rumble effect configured with the provided spec.

Parameters
rumbleEffectSpecSpecification of the rumble effect to stop; if NULL, any playing effect is stoped

Definition at line 75 of file RumbleManager.c.

# Member Data Documentation

# async

bool RumbleManager::async
protected

Determines if the commands are broadcasted asynchronously, defaults to true

Definition at line 117 of file RumbleManager.h.

# cachedRumbleEffect

RumbleEffectSpec RumbleManager::cachedRumbleEffect
protected

Cached rumble effect to prevent broadcasting again previous send commands.

Definition at line 130 of file RumbleManager.h.

# overridePreviousEffect

bool RumbleManager::overridePreviousEffect
protected

Determines if the broadcast of new effects should wait or not for a previous queue effect being completedly broadcasted

Definition at line 121 of file RumbleManager.h.

# rumbleCommandIndex

uint8 RumbleManager::rumbleCommandIndex
protected

Index of the command in the queue to broadcast next.

Definition at line 124 of file RumbleManager.h.

# rumbleCommands

uint8 RumbleManager::rumbleCommands[10]
protected

Queue of commands to broadcast.

Definition at line 113 of file RumbleManager.h.

# rumbleEffectSpec

const RumbleEffectSpec* RumbleManager::rumbleEffectSpec
protected

Rumble effect spec being broadcasted.

Definition at line 127 of file RumbleManager.h.


The documentation for this class was generated from the following files: