usbdmx.com Home of the opto isolated, bus powered, DMX512 interface with both in and out universes. Cheap and simple to build. USBDMX logo

LOChase Class Reference

A chase is a timed sequence of scenes. More...

#import <LOChase.h>

Inheritance diagram for LOChase:

< LOChannelProvider >

Public Member Functions

(id) - initWithType:
 Initilise a chase with a given type.
(id) - initWithXML:
 Initilise with an XML Element.
(NSXMLElement *) - XML
 Get the Chase details as XML.
(LOChaseType) - type
 Get the type of the chase.
(void) - setType:
 Set the type of the chase.
(BOOL) - doesFade
 Checks if the chase fades between steps.
(void) - setDoesFade:
 Sets if the chase should fade between steps.
(BOOL) - doesSkipStepOne
 Check if the fade on the first step should be skipped.
(void) - setDoesSkipStepOne:
 If the chase is set to fade, then its possible for the fade on the first step to be skipped.
(NSString *) - name
 Get the name of the chase.
(void) - setName:
 Set the name of the chase.
(int) - number
 Get the chase number from the default chase manager.
(unsigned) - count
 Count how many scenes are included in the chase.
(void) - addScene:
 Add a scene to the chase.
(void) - insertScene:atIndex:
 Add a scene at a specific place within the chase.
(void) - removeSceneAtIndex:
 Remove a scene from the chase.
(void) - removeSceneAtIndexes:
 Remove scenes from the chase within the index set.
(void) - moveScenesAtIndexs:toIndex:
 Move all scenes within the specified index set to the new index.
(NSArray *) - scenes
 Get all the scenes in the chase, in the order they will play.
(LOScene *) - getSceneAtIndex:
 Get a scene from the chase at the given index.
(unsigned char) - intensity
 get the current intensity of the chase.
(void) - addProvider:
 Add a provider.
(void) - removeProvider:
 Remove a provider.
(void) - requestIntensityRefreshByProvider:
 Let the chase know when a provider has a new value for it.
(float) - stepTime
 Get the current step time.
(void) - setStepTime:
 Set the step time in seconds.
(float) - fadeTime
 Get the current fade time.
(void) - setFadeTime:
 Set the fade time in seconds.
(void) - setNextStep:
 Set the index of the scene to be used at the next step.
(void) - syncStep
 Sync the chase so that the step time in now.
(void) - step
 Step the case to the next scene.
(void) - start
 Start a chase running, this calls step immediatly, and then scehdules an NSTimer in the current thread to call step again after the correct time.
(void) - pause
 Pauses a scene, leaving the currently displayed scene on display.
(void) - stop
 Stops a chase from running, and stop displaying all scenes.
(void) - adjustTime
 Called when the time is changed to adjust the current timer till the next step.
(BOOL) - isRunning
 Returns the running status of the chase.
(BOOL) - isPaused
 Returns the paused status of the chase.
(void) - updateOutput
 Update the output for the channel provider.
(void) - setProviderID:
 Set the provider ID to be something other that the default.

Protected Attributes

NSString * name
 The name of the chase.
NSMutableArray * scenes
 The scenes in the chase.
LOChaseType type
 The type of chase.
float stepTime
 Seconds between steps when running.
float fadeTime
 Seconds for the fade to take place.
NSMutableArray * intensityyProviders
 Array of LOChaseIntensityProviders.
NSMutableArray * runningChases
 Array of all chases we have started running.
BOOL running
 Flag to show current running status.
BOOL paused
 Flag to show current paused status.
BOOL providerSet
 Are we set as a provider.
int prevIndex
 The index of the previous scene displayed, <0 for no scene being displayed.
int currIndex
 The index of the current scene being displayed, <0 for no scene being displayed.
int nextIndex
 The index of the next scene to be displayed.
BOOL forward
 The direction of the chase.
BOOL fade
 The chase fades between steps, as opposed to snaps.
BOOL instantStepOne
 Skips the fade on the first step if set.
unsigned char intensity
 The master intensity for this chase.
NSTimer * stepTimer
NSTimer * fadeTimer
NSDate * timerSet
LOScenecachedScene
 Scene to hold the current output values.
LOChannelManagerchannelManager
LODiplessCrossFadeProviderfadeProvider
 The provider that will handle the cross fade.
int fadeSteps
 Number of steps to complete the fade in the given time.
int currFadeStep
 Current fade step number.
int providerID
 The ID of this provider.
LOTimingThreadtimingThread
 The thread that the timing will happe in.

Detailed Description

A chase is a timed sequence of scenes.

Member Function Documentation

- (void) addProvider: (id<LOChaseIntensityProvider>)  aProvider  

Add a provider.

This allows the chase to query each registered provider in order to assertain the correct intensity level.

Parameters:
aProvider The provider being added
See also:
- removeProvider:

- (void) addScene: (LOScene *)  aScene  

- (void) adjustTime  

Called when the time is changed to adjust the current timer till the next step.

You should never need to call this method.

See also:
setStepTime

- (unsigned) count  

Count how many scenes are included in the chase.

- (BOOL) doesFade  

Checks if the chase fades between steps.

See also:
- setDoesFade:

- (BOOL) doesSkipStepOne  

Check if the fade on the first step should be skipped.

See also:
- setDoesSkipStepOne:

- doesFade

- (float) fadeTime  

Get the current fade time.

See also:
- setFadeTime:

- (LOScene *) getSceneAtIndex: (unsigned)  index  

Get a scene from the chase at the given index.

Parameters:
index The index of the scene, starts at 0
See also:
scenes

- (id) initWithType: (LOChaseType)  aType  

Initilise a chase with a given type.

- (id) initWithXML: (NSXMLElement *)  XMLElement  

Initilise with an XML Element.

If the XML contains scenes that do not exist, then will be ignored.

See also:
- XML:

- (void) insertScene: (LOScene *)  aScene
atIndex: (unsigned)  index 

Add a scene at a specific place within the chase.

Parameters:
aScene The scene to insert
index The index of the scene, starts at 0
See also:
- addScene:

- removeSceneAtIndex:

- removeSceneAtIndexes:

- (unsigned char) intensity  

get the current intensity of the chase.

This is the higest intensity of all the providers.

- (BOOL) isPaused  

Returns the paused status of the chase.

If a chase is not running and not paused, then it has either finished, or not yet started.

See also:
- isRunning

- (BOOL) isRunning  

Returns the running status of the chase.

See also:
- isPaused

- (NSString *) name  

Get the name of the chase.

See also:
- setName:

- (int) number  

Get the chase number from the default chase manager.

If the chase is not in the chase manager, then it will be added and the new number returned

- (void) pause  

Pauses a scene, leaving the currently displayed scene on display.

Use start to start running the chase from the point it was stopped

See also:
- start

- step

- stop

- (void) removeProvider: (id<LOChaseIntensityProvider>)  theProvider  

Remove a provider.

When a provider is no longer required it can be removed from the chase

Parameters:
theProvider The provider being removed
See also:
- addProvider:

- (void) removeSceneAtIndex: (unsigned)  index  

Remove a scene from the chase.

Parameters:
index The index of the scene, starts at 0
See also:
- removeSceneAtIndexes:

- insertScene:atIndex:

- addScene:

- (void) removeSceneAtIndexes: (NSIndexSet *)  indexes  

Remove scenes from the chase within the index set.

See also:
- removeSceneAtIndex:

- insertScene:atIndex:

- addScene:

- (NSArray *) scenes  

Get all the scenes in the chase, in the order they will play.

See also:
- getSceneAtIndex:

- (void) setDoesFade: (BOOL)  doesFade  

Sets if the chase should fade between steps.

See also:
- doesFade

- (void) setDoesSkipStepOne: (BOOL)  doesSkip  

If the chase is set to fade, then its possible for the fade on the first step to be skipped.

See also:
- doesSkipStepOne:

- doesFade

- (void) setFadeTime: (float)  seconds  

Set the fade time in seconds.

See also:
fadeTime

- (void) setName: (NSString *)  aName  

Set the name of the chase.

See also:
name

- (void) setNextStep: (unsigned)  index  

Set the index of the scene to be used at the next step.

- (void) setProviderID: (int)  theProviderID  

Set the provider ID to be something other that the default.

- (void) setStepTime: (float)  seconds  

Set the step time in seconds.

See also:
stepTime

- (void) setType: (LOChaseType)  theType  

Set the type of the chase.

See also:
type

- (void) start  

Start a chase running, this calls step immediatly, and then scehdules an NSTimer in the current thread to call step again after the correct time.

If the chase has been paused and you want to start running from the begining again you will need to use setNextStep: to set the next index to 0

See also:
- stop

- step

- (void) step  

Step the case to the next scene.

If the chase is not yet displaying any scenes, step to the first scene.

- (float) stepTime  

Get the current step time.

See also:
- setStepTime:

- (void) stop  

Stops a chase from running, and stop displaying all scenes.

See also:
- start

- pause

- (void) syncStep  

Sync the chase so that the step time in now.

This will either cause the next step to happen now or delay it a little so it happens now + step time.

- (LOChaseType) type  

Get the type of the chase.

See also:
- setType:

- (void) updateOutput  

Update the output for the channel provider.

Used to remove any channels from the last step and start to output channels from the current step.

This is an internal function, and there is no need to ever call this directly.

- (NSXMLElement *) XML  

Get the Chase details as XML.

 <chase name="" type="oneshot | repeat | bounce | random | repeatback | oneshotback">
  <step time="x.xxx"/>
  <scenes count="x"> 
   <scene index="x" number="x"/>
  </scenes>
 </chase>

Returns:
The XML Representation of the scene
 <chase name="" type="oneshot | repeat | bounce | random | repeatback | oneshotback">
  <step time="x.xxx"/>
  <scenes count="x"> 
   <scene index="x" number="x"/>
  </scenes>
 </cue>

Returns:
The XML Representation of the scene


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