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

LOChannel.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: LOChannel.h 260 2010-11-11 18:58:13Z ben.suffolk $
00033  *
00034  */
00035 
00036 #import <Cocoa/Cocoa.h>
00037 #import "LOSoftPatch.h"
00038 #import "LOChannelProvider.h"
00039 #import "LODimmerCurve.h"
00040 
00041 @class LOChannelProvider;
00042 @class LOFixture;
00043 
00044 #define LOChannelWasReleasedNotification @"LOChannelWasReleasedNotification"
00045 
00046 
00052 typedef enum  {
00053                LOChannelTypeHTP = 0, 
00054                LOChannelTypeLTP      
00055               } LOChannelType;
00056 
00057 
00074 @interface LOChannel : NSObject
00075 { 
00076  unsigned char channelValue;          
00077  LOChannelType channelType;           
00078  BOOL isIntensity;                    
00079  LOSoftPatch *softPatch;              
00080  unsigned softPatchOffset;            
00081  id<LOChannelProvider> lastProvider;  
00082  NSString *name;                      
00083  
00084  LOFixture *fixture;                  
00085 
00086  id<LOChannelProvider> capturedProvider;  
00087  NSMutableArray *capturedProviders;   
00088  
00089  LODimmerCurve *dimmerCurve;          
00090 }
00091 
00092 
00104 - (id)initWithSoftPatch:(LOSoftPatch *)theSoftPatch andSoftPatchOffset:(unsigned)theSoftPatchOffset;
00105 
00106 
00116 - (id)initWithFixture:(LOFixture *)theFixture;
00117 
00118 
00145 - (NSXMLElement *)XML;
00146 
00147 
00156 - (unsigned)channelNumber;
00157 
00158 
00168 - (unsigned char)channelValue;
00169 
00170 
00182 - (void)setChannelValue:(unsigned char)theValue byProvider:(id<LOChannelProvider>)theProvider;
00183 
00184 
00190 - (NSString *)name;
00191 
00192 
00198 - (void)setName:(NSString *)theName;
00199 
00200 
00208 - (id<LOChannelProvider>)lastProvider;
00209 
00210 
00230 - (void)captureChannelForProvider:(id<LOChannelProvider>)theProvider;
00231 
00232 
00245 - (void)releaseChannelForProvider:(id<LOChannelProvider>)theProvider;
00246 
00247 
00260 - (void)releaseChannel;
00261 
00262 
00268 - (BOOL)isCaptured;
00269 
00270 
00278 - (id<LOChannelProvider>)caputredBy;
00279 
00280 
00290 - (LOChannelType)channelType;
00291 
00292 
00302 - (void)setChannelType:(LOChannelType)theChannelType;
00303 
00304 
00314 - (BOOL)isIntensity;
00315 
00316 
00326 - (void)setIntensity:(BOOL)intensity;
00327 
00328 
00338 - (BOOL)isFixture;
00339 
00340 
00346 - (LOFixture *)fixture;
00347 
00348 
00354 - (void)setFixture:(LOFixture *)aFixture;
00355 
00356 
00364 - (LOSoftPatch *)softPatch;
00365 
00366 
00374 - (unsigned)softPatchOffset;
00375 
00376 
00382 - (LOHWChannelProxy *)channelProxy;
00383 
00384 
00390 - (void)patchWithSoftPatch:(LOSoftPatch *)aSoftPatch withOffset:(unsigned)offset;
00391 
00392 
00400  - (void)unpatch;
00401 
00402 
00410 - (BOOL)isPatched;
00411 
00412 
00423 - (LODimmerCurve *)dimmerCurve;
00424 
00425 
00436 - (void)setDimmerCurve:(LODimmerCurve *)aDimmerCurve;
00437 
00438 
00450 - (void)addDimmerCurve:(LODimmerCurve *)aDimmerCurve;
00451 
00452 
00453 
00454 @end
00455 
00456 
00457 
00458 
00459 
00460 
00461 
00462 
00463 
00464 
00465 
00466 
00467 
00468 
00469 
00470 
00471 
00472 
00473 
00474