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

LOScene.h

00001 /*
00002  *
00003  * Copyright (c) 2006, 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: LOScene.h 258 2010-06-07 09:35:39Z ben.suffolk $
00033  *
00034  */
00035 
00036 #import <Cocoa/Cocoa.h>
00037 #import "LOChannelProvider.h"
00038 #import "LOFixtureAttribute.h"
00039 
00040 @class LOChase;
00041 @class LOOffset;
00042 
00043 #define LOSceneChannelKey @"Channel"
00044 #define LOSceneValueKey @"Value"
00045 
00046 #define LOSceneDidUpdateName @"LOSceneDidUpdateName"
00047 #define LOSceneDidUpdateChannel @"LOSceneDidUpdateChannel"
00048 #define LOSceneDidRemoveChannel @"LOSceneDidRemoveChannel"
00049 
00050 
00060 @interface LOScene : NSObject <NSCoding, LOChannelProvider>
00061 {
00062  struct {
00063          int intensity;
00064          id *attributeValues;
00065          LOOffset *offset;
00066         } *channelData; 
00067 
00068  unsigned count; 
00069  NSString *name; 
00070  BOOL sceneShouldGrow; 
00071  
00072  NSMutableArray *chases;          
00073  NSMutableArray *chaseValues;     
00074  NSMutableArray *sceneProviders;  
00075 }
00076 
00077 
00091 + (LOScene *)sceneAfterMaster:(BOOL)afterMaster withZeroChannels:(BOOL)zeroChannels;
00092 
00093 
00108 + (LOScene *)capturedSceneAfterMaster:(BOOL)afterMaster withZeroChannels:(BOOL)zeroChannels;
00109 
00110 
00124 - (id)init;
00125 
00126 
00140 - (id)initWithLastChannel:(unsigned)aChannel;
00141 
00142 
00153 - (id)initWithXML:(NSXMLElement *)XMLElement;
00154 
00155 
00161 - (id)initWithScene:(LOScene *)aScene;
00162 
00163 
00181 - (NSXMLElement *)XML;
00182 
00183 
00195 - (BOOL)addChasesFromXML:(NSXMLElement *)XMLElement;
00196 
00197 
00205 - (unsigned)count;
00206 
00207 
00213 - (NSString *)name;
00214 
00215 
00223 - (void)setName:(NSString *)theName;
00224 
00225 
00233 - (BOOL)isManaged;
00234 
00235 
00241 - (BOOL)isHidden;
00242 
00243 
00250 - (void)hide;
00251 
00257 - (void)unhide;
00258 
00259 
00260 
00271 - (int)sceneNumber;
00272 
00273 
00283 - (BOOL)sceneShouldGrow;
00284 
00285 
00292 - (void)setSceneShouldGrow:(BOOL)boolValue;
00293 
00294 
00306 - (void)setChannel:(unsigned)aChannel toValue:(unsigned char)theValue;
00307 
00308 
00324 - (void)setChannel:(unsigned)aChannel attributeIndex:(LOFixtureAttributeIndex)index toObject:(id)anObject;
00325 
00326 
00339 - (void)setChannel:(unsigned)aChannel offset:(LOOffset *)theOffset;
00340 
00341 
00351 - (int)valueForChannel:(unsigned)aChannel;
00352 
00353 
00359 - (NSIndexSet *)channels;
00360 
00361 
00369 - (id)objectForAttributeIndex:(LOFixtureAttributeIndex)index onChannel:(unsigned)aChannel;
00370 
00371 
00381 - (id *)objectAttributeArrayForChannel:(unsigned)aChannel;
00382 
00383 
00393 - (LOOffset *)offsetForChannel:(unsigned)aChannel;
00394 
00395 
00401 - (void)releaseChannel:(unsigned)aChannel;
00402 
00403 
00409 - (unsigned)chaseCount;
00410 
00411 
00420 - (NSArray *)chases;
00421 
00422 
00431 - (void)addChase:(LOChase *)aChase;
00432 
00433 
00441 - (void)addChase:(LOChase *)aChase withValue:(unsigned char)value;
00442 
00443 
00452 - (LOChase *)chaseAtIndex:(unsigned)index;
00453 
00454 
00464 - (unsigned char)chaseValueAtIndex:(unsigned)index;
00465 
00466 
00475 - (unsigned char)valueForChase:(LOChase *)chase;
00476 
00477 
00487 - (void)setChaseValue:(unsigned char)value AtIndex:(unsigned)index;
00488 
00489 
00499 - (void)removeChase:(LOChase *)aChase;
00500 
00501 
00511 - (void)removeChaseAtIndex:(unsigned)index;
00512 
00513 
00522 - (void)removeChases:(NSArray *)chaseArray;
00523 
00524 
00532 - (void)removeAllChases;
00533 
00534 
00545 - (void)addProvider:(id<LOChannelProvider>)aProvider;
00546 
00547 
00556 - (void)removeProvider:(id<LOChannelProvider>)theProvider;
00557 
00558 
00565 - (NSArray *)providers;
00566 
00567 
00575 - (BOOL)isEqualtoScene:(LOScene *)aScene;
00576 
00577 @end
00578 
00579 
00580 
00581 
00582 
00583 
00584 
00585 
00586 
00587