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

LODimmerCurve.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: LODimmerCurve.h 41 2006-04-12 19:27:22Z ben.suffolk $
00033  *
00034  */
00035 
00036 #import <Cocoa/Cocoa.h>
00037 
00038 
00044 typedef enum  {
00045                LODimmerCurveTypeLinear = 0,  
00046                LODimmerCurveTypeQuadratic,   
00047                LODimmerCurveTypeCubic        
00048               } LODimmerCurveType;
00049 
00055 typedef enum  {
00056                LODimmerCurveCPTypeNone = 0, 
00057                LODimmerCurveCPTypeStart,    
00058                LODimmerCurveCPTypePoint1,   
00059                LODimmerCurveCPTypePoint2,   
00060                LODimmerCurveCPTypeEnd       
00061               } LODimmerCurveCPType;
00062 
00063 
00075 @interface LODimmerCurve : NSObject
00076 {
00077 
00078  NSPoint startControlPoint;   
00079  NSPoint controlPoint1;       
00080  NSPoint controlPoint2;       
00081  NSPoint endControlPoint;     
00082  
00083  LODimmerCurveType type;  
00084  
00085  unsigned char lookup[256]; 
00086  
00087  LODimmerCurve *linkedCurve;  
00088  
00089  BOOL editable;  
00090 }
00091 
00092 
00101 - (id)init;
00102 
00103 
00113 - (id)initWithType:(LODimmerCurveType)theDimmerCurveType;
00114 
00115 
00125 - (id)initWithXML:(NSXMLElement *)anXMLElement;
00126 
00127 
00152 - (void)XMLIntoElement:(NSXMLElement *)parentElement;
00153 
00154 
00164 - (LODimmerCurveType)type;
00165 
00166 
00176 - (void)setType:(LODimmerCurveType)theDimmerCurveType;
00177 
00178 
00188 - (NSPoint)startControlPoint;
00189 
00190 
00200 - (void)setStartControlPoint:(NSPoint)thePoint;
00201 
00202 
00212 - (NSPoint)controlPoint1;
00213 
00214 
00224 - (void)setControlPoint1:(NSPoint)thePoint;
00225 
00226 
00236 - (NSPoint)controlPoint2;
00237 
00238 
00248 - (void)setControlPoint2:(NSPoint)thePoint;
00249 
00250 
00260 - (NSPoint)endControlPoint;
00261 
00262 
00272 - (void)setEndControlPoint:(NSPoint)thePoint;
00273 
00274 
00284 - (BOOL)isEditable;
00285 
00286 
00296 - (void)setEditable:(BOOL)isEditable;
00297 
00298 
00310 - (LODimmerCurve *)linkedCurve;
00311 
00312 
00324 - (void)setLinkedCurve:(LODimmerCurve *)theCurve;
00325 
00326 
00337 - (void)addLinkedCurve:(LODimmerCurve *)theCurve;
00338 
00339 
00347 - (NSBezierPath *)path;;
00348 
00349 
00355 - (void)render;
00356 
00357 
00367 - (unsigned char)lookupFaderValue:(unsigned char)aFaderValue;
00368 
00369 
00370 @end
00371 
00372 
00373 
00374 
00375 
00376 
00377 
00378 
00379 
00380 
00381 
00382 
00383 
00384 
00385 
00386 
00387 
00388 
00389 
00390