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 Class Reference

A scene is a collection of channel values to define a lighting state. More...

#import <LOScene.h>

Inheritance diagram for LOScene:

< LOChannelProvider > LODirectProvider

Public Member Functions

(id) - init
 Initilise the scene ready to be used.
(id) - initWithLastChannel:
 Initilise the scene ready to be used.
(id) - initWithXML:
 Initilise with an XML Element.
(id) - initWithScene:
 Initilise a scene by copying the contents of an existing scene.
(NSXMLElement *) - XML
 Get the Scene details as XML.
(BOOL) - addChasesFromXML:
 Add any chases to the scene from the XML.
(unsigned) - count
 Return the number of channels that this scene can hold data for.
(NSString *) - name
 The name of the scene if set, or nil.
(void) - setName:
 Set the name of the scene.
(BOOL) - isManaged
 Check to see if this scene is managed by the scene manager.
(BOOL) - isHidden
 Check to see if this scene is hidden by the scene manager.
(void) - hide
 Hide the scene, if not already managed by the scene manager, this will manage and hide the scene.
(void) - unhide
 Un-hide the scene, if not already managed by the scene manager, this will manage the scene.
(int) - sceneNumber
 Get the number of this scene from the scene manager.
(BOOL) - sceneShouldGrow
 Tests to see if the scene size will automatically grow as new channels are added to the channel manager.
(void) - setSceneShouldGrow:
 Set if a scene should automatically grow in size as new channels are added to the channel manager.
(void) - setChannel:toValue:
 Set the value of the channel.
(void) - setChannel:attributeIndex:toObject:
 Set the channels fixture attribute to a given object.
(void) - setChannel:offset:
 Set the fade profile for the channel.
(int) - valueForChannel:
 Get the channel value.
(NSIndexSet *) - channels
 Get all the channels referenced in this scene.
(id) - objectForAttributeIndex:onChannel:
 Get the object for a fixture attribute.
(id *) - objectAttributeArrayForChannel:
 Returns a C array of objects.
(LOOffset *) - offsetForChannel:
 Get the channel offset.
(void) - releaseChannel:
 Remove the channel value for a given channel.
(unsigned) - chaseCount
 Return the number of chases contained in this scene.
(NSArray *) - chases
 Get an array of chases contained in this scene.
(void) - addChase:
 Add a chase to the scene at full value.
(void) - addChase:withValue:
 Add a chase to the scene with a specific value.
(LOChase *) - chaseAtIndex:
 Get the chase at a specific index.
(unsigned char) - chaseValueAtIndex:
 Get the chase value at a specific index.
(unsigned char) - valueForChase:
 Get the value of the chase.
(void) - setChaseValue:AtIndex:
 Get the chase value at a specific index.
(void) - removeChase:
 Remove a chase from the scene.
(void) - removeChaseAtIndex:
 Remove a chase at a specific index.
(void) - removeChases:
 Remove several chases from the scene.
(void) - removeAllChases
 Remove all the chases from this scene.
(void) - addProvider:
 Let the scene know the there is a provider providing data to the channel manager for it.
(void) - removeProvider:
 Let the scene know that this provider is nolonger providing data for it.
(NSArray *) - providers
 Get an array of providers that are currently providing data for this scene.
(BOOL) - isEqualtoScene:
 Test is a scene is equal to another scene.

Static Public Member Functions

(LOScene *) + sceneAfterMaster:withZeroChannels:
 Create a new scene based on the output of all non fixture channels.
(LOScene *) + capturedSceneAfterMaster:withZeroChannels:
 Create a new scene based on the output of just currently captured channels.

Protected Attributes

struct {
   int   intensity
   id *   attributeValues
   LOOffset *   offset
channelData
 Channel data array.
unsigned count
 The number of channels (the last channel) that data can be provided for.
NSString * name
 The scene name.
BOOL sceneShouldGrow
 Flag to say if the scene size should automatically grow when new channels are added.
NSMutableArray * chases
 Array of chases this scene uses.
NSMutableArray * chaseValues
 Array of chase values for the scene.
NSMutableArray * sceneProviders
 Array of providers currently.

Detailed Description

A scene is a collection of channel values to define a lighting state.

It may be that multiple scenes are displayed together, or that scenes replace each other. This will be realted to either the Cue Stack, or the other Channel Providers currently in play.


Member Function Documentation

- (void) addChase: (LOChase *)  aChase  

Add a chase to the scene at full value.

See also:
- addChase:withValue:

chases

- (void) addChase: (LOChase *)  aChase
withValue: (unsigned char)  value 

Add a chase to the scene with a specific value.

See also:
chases

- (BOOL) addChasesFromXML: (NSXMLElement *)  XMLElement  

Add any chases to the scene from the XML.

This can't be done with initWithXML because during a show file load the scenes must be loaded before chases are laoded, so no chases exist at that point.

Returns:
NO on error, otherwise return YES
See also:
- initWithXML:

- (void) addProvider: (id<LOChannelProvider>)  aProvider  

Let the scene know the there is a provider providing data to the channel manager for it.

This should only be called by the provider when it starts providing data, and removeProvider should be called by the provider when it stops providing data.

See also:
- removeProvider:

+ (LOScene *) capturedSceneAfterMaster: (BOOL)  afterMaster
withZeroChannels: (BOOL)  zeroChannels 

Create a new scene based on the output of just currently captured channels.

The newley created scene is not automatically added to the scene manager.

Convienence function for the same named function from LOChannleManager.

Parameters:
afterMaster If True take the channel values after the master fader is applied
zeroChannels If False don't include any channels at level zero (before master fader)
See also:
sceneFromOutput:

- (LOChase *) chaseAtIndex: (unsigned)  index  

Get the chase at a specific index.

See also:
- chaseValueAtIndex:

chases

- (unsigned) chaseCount  

Return the number of chases contained in this scene.

- (NSArray *) chases  

Get an array of chases contained in this scene.

See also:
- addChase:

- chaseAtIndex:

- (unsigned char) chaseValueAtIndex: (unsigned)  index  

Get the chase value at a specific index.

See also:
- valueForChase:

- chaseAtIndex:

chases

- (unsigned) count  

Return the number of channels that this scene can hold data for.

Returns:
The last posisble channel that can be in the scene

- (void) hide  

Hide the scene, if not already managed by the scene manager, this will manage and hide the scene.

- (id) init  

Initilise the scene ready to be used.

No channel data exists until the setChannel function is called. It is initilised with all channels that the channelManager holds at the time of initilisiation.

Returns:
The initilised Scene
See also:
- setChannel:toValue:

sceneShouldGrow

Reimplemented in LODirectProvider.

- (id) initWithLastChannel: (unsigned)  aChannel  

Initilise the scene ready to be used.

No channel data exists until the setChannel function is called.

Parameters:
aChannel The last numbered channel that this scene wil hold values for
Returns:
The initilised Scene
See also:
- setChannel:toValue:

Reimplemented in LODirectProvider.

- (id) initWithScene: (LOScene *)  aScene  

Initilise a scene by copying the contents of an existing scene.

- (id) initWithXML: (NSXMLElement *)  XMLElement  

Initilise with an XML Element.

If the XML contains channels that do not exist, then will be ignored.

See also:
- addChasesFromXML:

- XML:

- (BOOL) isEqualtoScene: (LOScene *)  aScene  

Test is a scene is equal to another scene.

This test only checks the current channel values and chases it does not not check the name, or autoGrow settings

- (BOOL) isHidden  

Check to see if this scene is hidden by the scene manager.

- (BOOL) isManaged  

Check to see if this scene is managed by the scene manager.

See also:
- sceneNumber

- (NSString *) name  

The name of the scene if set, or nil.

- (id *) objectAttributeArrayForChannel: (unsigned)  aChannel  

Returns a C array of objects.

The array is LOFixtureAttributeIndexSize elements long. It is not safe to keep a copy of this pointer, as the memory will be free(3)ed when the scene is deallocated.

Returns:
an array pointer, or NULL if no objects have been set for this channel

- (id) objectForAttributeIndex: (LOFixtureAttributeIndex)  index
onChannel: (unsigned)  aChannel 

Get the object for a fixture attribute.

Returns:
the object or nil if its not set

- (LOOffset *) offsetForChannel: (unsigned)  aChannel  

Get the channel offset.

Parameters:
aChannel The channel number that the value should be provide for.
Returns:
The offset or nil if one is not set

- (void) releaseChannel: (unsigned)  aChannel  

Remove the channel value for a given channel.

Reimplemented in LODirectProvider.

- (void) removeAllChases  

Remove all the chases from this scene.

See also:
- removeChaseAtIndex:

- (void) removeChase: (LOChase *)  aChase  

Remove a chase from the scene.

See also:
removeChases

removeChaseAtIndex

- removeAllChases

- (void) removeChaseAtIndex: (unsigned)  index  

Remove a chase at a specific index.

See also:
removeChase

removeChases

- removeAllChases

- (void) removeChases: (NSArray *)  chaseArray  

Remove several chases from the scene.

See also:
removeChaseAtIndex

- removeAllChases

- (void) removeProvider: (id<LOChannelProvider>)  theProvider  

Let the scene know that this provider is nolonger providing data for it.

See also:
- addProvider:

+ (LOScene *) sceneAfterMaster: (BOOL)  afterMaster
withZeroChannels: (BOOL)  zeroChannels 

Create a new scene based on the output of all non fixture channels.

The newley created scene is not automatically added to the scene manager.

Convienence function for the same named function from LOChannleManager.

Parameters:
afterMaster If True take the channel values after the master fader is applied
zeroChannels If False don't include any channels at level zero (before master fader)
See also:
sceneFromCaputuredOutput:

- (int) sceneNumber  

Get the number of this scene from the scene manager.

If the scene is not currently in the scene manager it will automatically be added and the new number returned. If you do not wish this to happen you shoudl check first if the scene is managed.

See also:
- isManaged

- (BOOL) sceneShouldGrow  

Tests to see if the scene size will automatically grow as new channels are added to the channel manager.

This is set to YES by default if the init function is used as opposed to the initWithLastChannel function

- (void) setChannel: (unsigned)  aChannel
attributeIndex: (LOFixtureAttributeIndex)  index
toObject: (id)  anObject 

Set the channels fixture attribute to a given object.

Parameters:
aChannel The channel number (1 indexed)
index The index of the attribute we are setting. This uses a fixed set of intexes, and is not dependant on the actual fixture. Clearly is you set an attribute that the fixture does not have, it will just be ignored.
anObject The object representing the value to set in the fixture object. This is the object that will be passed to the updateOutputWithObject: function of LOFixtureAttribute, so must be of a supported type for the given attribute.

- (void) setChannel: (unsigned)  aChannel
offset: (LOOffset *)  theOffset 

Set the fade profile for the channel.

Posts notification LOSceneDidUpdateChannel as its possible the fade profile could chaneg the current value of a channel

Parameters:
aChannel The channel number to set
theOffset The offset.

- (void) setChannel: (unsigned)  aChannel
toValue: (unsigned char)  theValue 

Set the value of the channel.

Posts notification LOSceneDidUpdateChannel

Parameters:
aChannel The channel number to set
theValue The valule of the channel.

Reimplemented in LODirectProvider.

- (void) setChaseValue: (unsigned char)  value
AtIndex: (unsigned)  index 

Get the chase value at a specific index.

See also:
- chaseAtIndex:

- chaseValueAtIndex:

chases

- (void) setName: (NSString *)  theName  

Set the name of the scene.

Posts notification LOSceneDidUpdateName

- (void) setSceneShouldGrow: (BOOL)  boolValue  

Set if a scene should automatically grow in size as new channels are added to the channel manager.

- (void) unhide  

Un-hide the scene, if not already managed by the scene manager, this will manage the scene.

- (int) valueForChannel: (unsigned)  aChannel  

Get the channel value.

Parameters:
aChannel The channel number that the value should be provide for.
Returns:
The channel value, or < 0 if this provider does not have data for this channel

Reimplemented from < LOChannelProvider >.

- (unsigned char) valueForChase: (LOChase *)  chase  

Get the value of the chase.

See also:
- chaseValueAtIndex:

chases

- (NSXMLElement *) XML  

Get the Scene details as XML.

 <scene lastChannel="x" autoGrow="true|flase" name="" [hidden="true"]>
  <channel number="x" value="x">
   <attribute number="x">
    ...
   </attribute>
  </channel>
 </scene>

Returns:
The XML Representation of the scene


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