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

LOCueManager Class Reference

The cue manager is a place where cues can be created and stored. More...

#import <LOCueManager.h>


Public Member Functions

(id) - initWithName:
 Initilise a manager with a specific name.
(NSString *) - name
 Get the name of the manager.
(void) - setName:
 Set the name of the manager.
(unsigned) - index
 Get the index number for this manager in the array of all managers.
(NSXMLElement *) - XML
 Get the cue details as XML.
(BOOL) - addCue:
 Add a cue to the manager.
(void) - removeCue:
 Remove a cue from the cue manager.
(LOLightCue *) - cueForNumber:
 Return the cue for the given cue number.
(BOOL) - cueExistsForNumber:
 Check to see if the scene is being managed.
(BOOL) - updateCueNumber:
 Let the manager know the cue has changed its number.
(void) - autoNumber
 Re number all the cues evenly.
(unsigned) - count
 Returns the current number of cue being managed.
(NSArray *) - cueList
 Get a sorted list of cues numbers (held in NSNumber objects).
(LOLightCue *) - cueAfterCue:
 Return the cue that follows the currentCue in the cue list.
(LOLightCue *) - cueBeforeCue:
 Return the cue that preceeds the currentCue in the cue list.
(BOOL) - isTracking
 Check to see what the default trackign mode is for new cues.
(void) - setTracking:
 Set the default tracking mode for all new cues created in this manager.
(LOScene *) - sceneForCue:
 Get a scene represenation of the cue scene.
(unsigned char) - master
 Get the current master level for this cue manager.
(void) - setMaster:
 Set the master level for this cue manager.
(LOLightCue *) - currentCue
 Get the current cue (either the one that is currently fading or the one that has finished fading if no cue is fading).
(void) - go:
 Fade to the nextCue.
(void) - go
 Fade the next cue up.
(void) - snap:
 Snap to the nextCue.
(void) - snap
 Snap the next cue up.
(BOOL) - isFading
 Check to see if a cue is currently fading.
(void) - reset
 Reset the cue manager, that is delete all the cues currently managed, and set default tracking back to YES.
(BOOL) - loadConfigurationFromXML:
 Perfomrms a reset, then loads the configuration from the XML Element.

Static Public Member Functions

(LOCueManager *) + defaultManager
 Get the default cue manager for the applications.
(LOCueManager *) + managerForName:
 Get the cue manager for the given name.
(LOCueManager *) + managerAtIndex:
 Get a specific cue manager by index.
(NSArray *) + managers
 Get an array of all managers.
(unsigned) + count
 Return the number of cue managers.
(NSArray *) + managerNames
 Get an array of all manager names.
(unsigned) + indexOfManager:
 Get the index of a cue manager, adding the cue manaeger if not already in the index.
(void) + removeManager:
 Remove the cue manager, and all cues within the cue manager.
(void) + resetAll
 Reset the defualt manager, and remove all other managers.

Protected Attributes

NSString * name
 The name for the manager.
NSMutableDictionary * cues
 Dictionary to hold the LOLightCue objects.
NSArray * sortedKeys
 An array of sorted keys to make some functions faster.
float nextCueNumber
 The next cue number to be used when allocating numbers.
BOOL isTracking
 The default trackign state for new cues.
LOSceneemptyScene
 An empty scene to be used int he provider when we have no cue.
LOTimedDiplessCrossFadeProviderprovider
 The provider this cue manager will use show cues.
LOLightCuecurrentCue
 The current cue (or nil if not yet running).
NSTimer * followTimer
 The timer for fading down.
LOTimingThreadtimingThread
 The thread that the timing will happe in.


Detailed Description

The cue manager is a place where cues can be created and stored.

Each cue managed by the cue manager is given a cue number, which can be used from the command line etc.

You may also assign your own cue numbers, but they must be unique. A cue number is a floating point number so that you may logicaly group multiple cues together if desired.


Member Function Documentation

- (BOOL) addCue: (LOLightCue *)  theCue  

Add a cue to the manager.

When the add has occurd a notification LOCueManagerDidAddCue is posted so that all other objects may take apropriate action.

If a cue already has a number, it is added with that number (assuming no other cue is already being managed with the same number). Otehrwise a new number is allocaed by the cue manager, and the cue updated accordingly.

Returns:
success if the cue was added.

- (void) autoNumber  

Re number all the cues evenly.

- (unsigned) count  

Returns the current number of cue being managed.

Returns:
The number of cues

+ (unsigned) count  

Return the number of cue managers.

- (LOLightCue *) cueAfterCue: (LOLightCue *)  aCue  

Return the cue that follows the currentCue in the cue list.

If the currentCue has a linkCue set, which exists, it will be returned as opposed to the next cue by cueNumber.

Parameters:
aCue the cue or if nil then the first cue will be returned

- (LOLightCue *) cueBeforeCue: (LOLightCue *)  aCue  

Return the cue that preceeds the currentCue in the cue list.

If a previous cue has a linkCue set to the current cue, then that cue will be returned as opposed to the previous cue by number.

Parameters:
aCue the cue or if nil then the last cue will be returned

- (BOOL) cueExistsForNumber: (float)  cueNumber  

Check to see if the scene is being managed.

- (LOLightCue *) cueForNumber: (float)  cueNumber  

Return the cue for the given cue number.

Returns:
The cue or nil

- (NSArray *) cueList  

Get a sorted list of cues numbers (held in NSNumber objects).

Get the current cue (either the one that is currently fading or the one that has finished fading if no cue is fading).

Returns:
The cue or nil if no current cue
See also:
- isFading

+ (LOCueManager *) defaultManager  

Get the default cue manager for the applications.

Returns:
The current applications default cue manager
See also:
+ managerForName:

- (void) go  

Fade the next cue up.

If no cue is currently faded up then this wil fade in the first cue. In the event that we are on the last cue, this will snap out the last cue.

Once the step has completed a LOCueManagerGoDidCompleteNotification is posted

See also:
- go:

- (void) go: (LOLightCue *)  nextCue  

Fade to the nextCue.

If this is not the actual next cue in the stack it will work out exactly what should be displayed if its a trackign cue.

If nextCue is nil, then it will snap out of the current cue.

Once the step has completed a LOCueManagerGoDidCompleteNotification is posted

Parameters:
nextCue The next cue to fade to, or nil to snap out

- (unsigned) index  

Get the index number for this manager in the array of all managers.

If this manager is not yet in the array, it will be added to the end of the array.

See also:
+ indexOfManager:

+ managers

+ (unsigned) indexOfManager: (LOCueManager *)  cueManager  

Get the index of a cue manager, adding the cue manaeger if not already in the index.

- (id) initWithName: (NSString *)  aName  

Initilise a manager with a specific name.

Don't alloc and init a manager yourself.

See also:
+ defaultManager

+ managerForName:

- (BOOL) isFading  

Check to see if a cue is currently fading.

Returns:
YES if a cue is fading

- (BOOL) isTracking  

Check to see what the default trackign mode is for new cues.

See also:
- setTracking:

- (BOOL) loadConfigurationFromXML: (NSXMLElement *)  XMLElement  

Perfomrms a reset, then loads the configuration from the XML Element.

The XML is the same format as generated by the XML method

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

Returns:
YES if the configuratino was loaded.
See also:
- XML

+ (LOCueManager *) managerAtIndex: (unsigned)  index  

Get a specific cue manager by index.

0 is always the default manager

See also:
+ defaultManager

+ (LOCueManager *) managerForName: (NSString *)  theName  

Get the cue manager for the given name.

If theName is nil then the default manager will be returned.

Returns:
The current applications default cue manager
See also:
+ defaultManager

+ (NSArray *) managerNames  

Get an array of all manager names.

This exclueds the default manager.

See also:
+ managers

+ defaultManager

+ (NSArray *) managers  

Get an array of all managers.

This includes the default manager

See also:
+ managerNames

+ defaultManager

- (unsigned char) master  

Get the current master level for this cue manager.

Returns:
The master level
See also:
- setMaster:

- (NSString *) name  

Get the name of the manager.

See also:
- setName:

- (void) removeCue: (LOLightCue *)  theCue  

Remove a cue from the cue manager.

If another cue is linked to this cue the link will be removed.

Posts a LOCueManagerDidRemoveCueNotification

+ (void) removeManager: (LOCueManager *)  cueManager  

Remove the cue manager, and all cues within the cue manager.

Posts notification LOCueManagerDidRemoveCueManager

- (void) reset  

Reset the cue manager, that is delete all the cues currently managed, and set default tracking back to YES.

When the rest has occurd a notification LOCueManagerDidReset is posted so that all other objects may take apropriate action.

+ (void) resetAll  

Reset the defualt manager, and remove all other managers.

See also:
- reset

+ managerForName:

- (LOScene *) sceneForCue: (LOLightCue *)  aCue  

Get a scene represenation of the cue scene.

The scene include any previous scene states in the cue list if this scene is in tracking mode.

In the event that the a number of cues are skipped because a cue uses the cueLink function, then the skipped cues will still be used to calculate the new scene when in tracking mode.

- (void) setMaster: (unsigned char)  level  

Set the master level for this cue manager.

Parameters:
level The master level 0 - 255
See also:
- master

- (void) setName: (NSString *)  aName  

Set the name of the manager.

Parameters:
aName The new name for the manager
See also:
name

- (void) setTracking: (BOOL)  tracking  

Set the default tracking mode for all new cues created in this manager.

This does not update any existing cues.

The default mode on reset is to enable tracking

Parameters:
tracking YES if the default should be traacking cues.
See also:
isTracking

- (void) snap  

Snap the next cue up.

If no cue is currently up then this wil snap in the first cue. In the event that we are on the last cue, this will snap out the last cue.

Once the step has completed a LOCueManagerGoDidCompleteNotification is posted

See also:
- go:

- (void) snap: (LOLightCue *)  nextCue  

Snap to the nextCue.

If this is not the actual next cue in the stack it will work out exactly what should be displayed if its a trackign cue.

If nextCue is nil, then it will snap out of the current cue.

Once the step has completed a LOCueManagerGoDidCompleteNotification is posted

Parameters:
nextCue The next cue to snap to, or nil to snap out

- (BOOL) updateCueNumber: (LOLightCue *)  theCue  

Let the manager know the cue has changed its number.

In the event where the cue is renumbered to an existing cue number the cue is removed from the cue manager instaed of renumbered.

- (NSXMLElement *) XML  

Get the cue details as XML.

 <cues name="x" count="x">
  <cue...>
   ...
  </cue>
 </cues>

Returns:
The XML Representation of all the cues


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