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.h

00001 /*
00002  *
00003  * Copyright (c) 2006,2005,2004 Ben Suffolk <ben@usbdmx.com>
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without 
00007  * modification, are permitted provided that the following conditions are met:
00008  *
00009  * 1. Redistributions of source code must retain the above copyright notice,
00010  *    this list of conditions and the following disclaimer.
00011  *
00012  * 2. Redistributions in binary form must reproduce the above copyright notice,
00013  *    this list of conditions and the following disclaimer in the documentation
00014  *    and/or other materials provided with the distribution.
00015  *
00016  * 3. Neither the name of the usbdmx.com web site nor the names of its 
00017  *    contributors may be used to endorse or promote products derived from this
00018  *    software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
00022  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
00023  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
00024  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
00025  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
00026  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
00028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
00029  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00030  * POSSIBILITY OF SUCH DAMAGE.
00031  *
00032  * $Id: LOCueManager.h 242 2009-11-03 18:08:15Z ben.suffolk $
00033  *
00034  *******************************************************************************
00035  *
00036  * History :-
00037  *
00038  * <Name>  <Date>
00039  *
00040  * <Comment>
00041  * 
00042  *******************************************************************************
00043 */
00044 
00045 
00046 #import <Cocoa/Cocoa.h>
00047 
00048 @class LOLightCue;
00049 @class LOScene;
00050 @class LOTimedDiplessCrossFadeProvider;
00051 @class LOTimingThread;
00052 
00053 #define LOCueManagerGoDidBeginNotification @"LOCueManagerGoDidBeginNotification"
00054 #define LOCueManagerGoDidCompleteNotification @"LOCueManagerGoDidCompleteNotification"
00055 #define LOCueManagerDidAddCueNotification @"LOCueManagerDidAddCueNotification"
00056 #define LOCueManagerDidResetNotification @"LOCueManagerDidResetNotification"
00057 #define LOCueManagerDidAddManagerNotification @"LOCueManagerDidAddManagerNotification"
00058 #define LOCueManagerDidRenumberNotification @"LOCueManagerDidRenumberNotification"
00059 #define LOCueManagerDidRemoveCueNotification @"LOCueManagerDidRemoveCueNotification"
00060 #define LOCueManagerDidRemoveCueManager @"LOCueManagerDidRemoveCueManager"
00061 #define LOCueManagerDidRename @"LOCueManagerDidRename"
00062 
00063 // The cue number increment used when auto allocating cue numbers
00064 #define CUE_NUMBER_INCREMENT 10
00065 
00066 
00076 @interface LOCueManager : NSObject
00077 {
00078  NSString *name;            
00079  NSMutableDictionary *cues; 
00080  NSArray *sortedKeys;       
00081  float nextCueNumber;       
00082  BOOL isTracking;           
00083  
00084  LOScene *emptyScene;       
00085  LOTimedDiplessCrossFadeProvider *provider; 
00086  LOLightCue *currentCue;    
00087 
00088  NSTimer *followTimer;       
00089  LOTimingThread *timingThread; 
00090 }
00091 
00092 
00103 - (id)initWithName:(NSString *)aName;
00104 
00105 
00115 + (LOCueManager *)defaultManager;
00116 
00117 
00128 + (LOCueManager *)managerForName:(NSString *)theName;
00129 
00130 
00138 + (LOCueManager *)managerAtIndex:(unsigned)index;
00139 
00140 
00149 + (NSArray *)managers;
00150 
00151 
00157 + (unsigned)count;
00158 
00159 
00168 + (NSArray *)managerNames;
00169 
00170 
00177 + (unsigned)indexOfManager:(LOCueManager *)cueManager;
00178 
00179 
00187 + (void)removeManager:(LOCueManager *)cueManager;
00188 
00189 
00197 - (NSString *)name;
00198 
00199 
00209 - (void)setName:(NSString *)aName;
00210 
00211 
00222 - (unsigned)index;
00223 
00224 
00240 - (NSXMLElement *)XML;
00241 
00242 
00257 - (BOOL)addCue:(LOLightCue *)theCue;
00258 
00259 
00268 - (void)removeCue:(LOLightCue *)theCue;
00269 
00270 
00278 - (LOLightCue *)cueForNumber:(float)cueNumber;
00279 
00280 
00286 - (BOOL)cueExistsForNumber:(float)cueNumber;
00287 
00288 
00297 - (BOOL)updateCueNumber:(LOLightCue *)theCue;
00298 
00299 
00305 - (void)autoNumber;
00306 
00307 
00315 - (unsigned)count;
00316 
00317 
00323 - (NSArray *)cueList;
00324 
00325 
00336 - (LOLightCue *)cueAfterCue:(LOLightCue *)aCue;
00337 
00338 
00349 - (LOLightCue *)cueBeforeCue:(LOLightCue *)aCue;
00350 
00351 
00359 - (BOOL)isTracking;
00360 
00361 
00374 - (void)setTracking:(BOOL)tracking;
00375 
00376 
00387 - (LOScene *)sceneForCue:(LOLightCue *)aCue;
00388 
00389 
00399 - (unsigned char)master;
00400 
00401 
00411 - (void)setMaster:(unsigned char)level;
00412 
00413 
00424 - (LOLightCue *)currentCue;
00425 
00426 
00441 - (void)go:(LOLightCue *)nextCue;
00442 
00443 
00456 - (void)go;
00457 
00458 
00473 - (void)snap:(LOLightCue *)nextCue;
00474 
00475 
00488 - (void)snap;
00489 
00490 
00498 - (BOOL)isFading;
00499 
00500 
00510 - (void)reset;
00511 
00512 
00521 + (void)resetAll;
00522 
00523 
00537 - (BOOL)loadConfigurationFromXML:(NSXMLElement *)XMLElement;
00538 
00539 @end
00540 
00541 
00542 int floatSort(id num1, id num2, void *context);
00543 
00544 
00545 
00546 
00547 
00548 
00549 
00550