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

LOChaseManager Class Reference

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

#import <LOChaseManager.h>


Public Member Functions

(NSXMLElement *) - XML
 Get the Chase details as XML.
(int) - addChase:
 Add a chase to manager.
(LOChase *) - chaseForNumber:
 Return the chase for the given chase number.
(int) - numberForChase:
 Search the chase manager to find what chase number this chase has.
(int) - moveChasesAtIndexs:toIndex:
 Move the Chases (and thus renumber them).
(void) - removeChasesAtIndexs:
 Remove the Chases (and thus renumber other chases).
(BOOL) - doesManageChase:
 Check to see if the chase is being managed.
(unsigned) - count
 Returns the current number of chases being managed.
(void) - reset
 Reset the chase manager, that is delete all the chases currently managed.
(BOOL) - loadConfigurationFromXML:
 Perfomrms a reset, then loads the configuration from the XML Element.

Static Public Member Functions

(LOChaseManager *) + defaultManager
 Get the default Chase manager for the applications.

Protected Attributes

NSMutableArray * chases
 Array to hold the LOChase objects.


Detailed Description

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

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


Member Function Documentation

- (int) addChase: (LOChase *)  theChase  

Add a chase to manager.

When added a notification LOChaseManagerDidAddChasee is posted so that all other objects may take apropriate action.

Returns:
The chase number just just created, or <0 on an error.

- (LOChase *) chaseForNumber: (int)  chaseNumber  

Return the chase for the given chase number.

Returns:
The Chase or nil

- (unsigned) count  

Returns the current number of chases being managed.

Returns:
The number of chases

+ (LOChaseManager *) defaultManager  

Get the default Chase manager for the applications.

This is the only way that a chase manager should be obtained.

Returns:
The current applications default chase manager

- (BOOL) doesManageChase: (LOChase *)  theChase  

Check to see if the chase is being managed.

- (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 the do not exist, they will be ignored

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

- (int) moveChasesAtIndexs: (NSIndexSet *)  indexes
toIndex: (unsigned)  index 

Move the Chases (and thus renumber them).

Returns:
the number of chases moved

- (int) numberForChase: (LOChase *)  theChase  

Search the chase manager to find what chase number this chase has.

In the even where the chase is not already in the chase manager it will be added and the new chase number returned.

Returns:
The chase number or <0 on an error.
See also:
- addChase:

- (void) removeChasesAtIndexs: (NSIndexSet *)  indexes  

Remove the Chases (and thus renumber other chases).

The chases to be removed are firt moved to the last positions (causing a LOChaseManagerDidReorderChases notification to be posted), and then the last chase is repeatedly removed until all desire chases have been removed.

For each chae that is removed a LOChaseManagerDidRemoveChase notification is posted. This will always be the last chase being managed at the time.

- (void) reset  

Reset the chase manager, that is delete all the chases currently managed.

On reset a notification LOChaseManagerDidReset is posted so that all other objects may take apropriate action.

- (NSXMLElement *) XML  

Get the Chase details as XML.

 <chases count="x">
  <chase ..>
   ..
  </chase>
 </chases>

Returns:
The XML Representation of all the Chases


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