AMScheduler Class Reference

An A2ML scheduler implementation. More...

#import <AMScheduler.h>

List of all members.

Public Member Functions

(AMEventAction *) - registerEventAction:playable:action:delay:permanent:
 Registers a permanent or single-use scheduler action and link it to a particular event.
(AMTimeAction *) - registerTimeAction:playable:action:permanent:
 Registers a permanent or single-use scheduler action and link it to a particular time.
(void) - removeEventAction:
 Removes the specified AMEventAction object from the scheduler.
(void) - incrementTime
 Increments the scheduler time and performs all time-related scheduler actions.
(void) - start
 Starts the scheduler.
(void) - pause
 Pauses the scheduler.
(void) - resetTime
 Resets the current time of the scheduler, and pause it.
(void) - resetAll
 Completely resets the scheduler, including removing all time and event actions.

Protected Attributes

NSDate * initialTime
NSNumber * previousTimeIndex
NSMutableDictionary * animations
NSMutableSet * eventActions
NSMutableDictionary * timeActions
NSMutableSet * startedAnimations
NSMutableDictionary * managedObjects

Properties

double currentTime
 The Internal current time of the scheduler, in seconds.
BOOL paused
 Is the scheduler running or paused?


Detailed Description

An A2ML scheduler implementation.

Member Function Documentation

- (void) incrementTime  

Increments the scheduler time and performs all time-related scheduler actions.

The value of the increment will be automatically calculated, based on the last time this method was called. The initial time is initialized on the first call of this method, or on the first call after a time reset was requested. This method should be invoked on a regular time interval to allow the scheduler to work properly (usually done by the sound manager).

- (AMEventAction *) registerEventAction: (NSString *)  _event
playable: (id)  _playable
action: (AMActionType)  _action
delay: (AMTime *)  _delay
permanent: (BOOL)  _permanent 

Registers a permanent or single-use scheduler action and link it to a particular event.

If the action is not set as permanent, the scheduler will dismiss this action after the action has been performed.

Parameters:
event The event that will trigger the action.
playable The playable object on which the action will apply.
action The action type, as defined by the AMActionType enumeration.
delay The delay after which the action will be performed once the event has been triggered.
permanent Use YES to set the action as permanent or NO to set it as a single-use action.
Returns:
The new AMEventAction object created or nil if none was created.
See also:
AMEventAction

- (AMTimeAction *) registerTimeAction: (AMTime *)  _time
playable: (id)  _playable
action: (AMActionType)  _action
permanent: (BOOL)  _permanent 

Registers a permanent or single-use scheduler action and link it to a particular time.

If the action is not set as permanent, the scheduler will dismiss this action after the action has been performed.

Parameters:
time The time on which the action will be triggered.
playable The playable object on which the action will apply.
action The action type, as defined by the AMActionType enumeration.
permanent Use YES to set the action as permanent or NO to set it as a single-use action.
Returns:
The new AMTimeAction object created or nil if none was created.
See also:
AMTimeAction

- (void) removeEventAction: (AMEventAction *)  _eventAction  

Removes the specified AMEventAction object from the scheduler.

Parameters:
eventAction The AMEventAction object to remove.

- (void) resetAll  

Completely resets the scheduler, including removing all time and event actions.

The scheduler is stopped before the cleanup.

- (void) resetTime  

Resets the current time of the scheduler, and pause it.

Be careful as resetting the current scheduler time may introduce side effects on the behavior of scheduled objets like animations or fades, if they are currently running.


Property Documentation

- (double) currentTime [read, assign]

The Internal current time of the scheduler, in seconds.


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

Generated on Mon May 16 16:29:48 2011 for ARIA by  doxygen 1.5.9