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

LODiplessCrossFadeProvider Class Reference

A channel provider that passes data to the channel manager from two different sources with a dipless cross fade. More...

#import <LODiplessCrossFadeProvider.h>

Inheritance diagram for LODiplessCrossFadeProvider:

< LOChannelProvider > LOTimedDiplessCrossFadeProvider

Public Member Functions

(id) - init
 Initilise the provider ready to be used.
(id) - initWithLastChannel:
 Initilise the provider ready to be used.
(id) - initWithScene:andScene:
 Initilise the provider read to be used.
(void) - setChannel:toValue:onSource:
 Set the value of the channel.
(void) - setScene:forSource:
 Set the scene for a data source.
(unsigned char) - master
 Get the master value.
(void) - setMaster:
 Set the master value, update the output and notifies the channel manager.
(unsigned char) - crossFader
(unsigned char) - crossFade
 Get the cross fade value.
(void) - setCrossFade:
 Set the cross fade value.
(unsigned char) - fadeUp
 Get the cross fade UP value.
(unsigned char) - fadeDown
 Get the cross fade UP value.
(void) - setFadeUp:
 Set the fade up value.
(void) - setFadeDown:
 Set the fade down value.
(void) - setFadeDown:andUp:
 Set both fade values.
(LOScene *) - crossFadeScene
 Get the current cross fade scene (pre master).
(void) - updateOutputForChannel:
 This method recalculates the output cache, and if the channel output has changed will notify the channel manager.
(void) - updateOutput
 This method recalculates the output cache, and if a channel has been updated, notified the channel manager.
(void) - setProviderID:
 Set the provider ID to be something other that the defaulr.

Protected Attributes

LOChannelManagerchannelManager
 The channel manager.
LOScenesourceA
 The first Source (commonly know as A).
LOScenesourceB
 The Second Source (commonly knows as B).
LOScenecachedScene
 The cached value of the current output.
NSMutableArray * sourceAProviders
 Chase Intensity Providers for chases in source A.
NSMutableArray * sourceBProviders
 Chase Intensity Providers for chases in source B.
unsigned char master
 The master value to scale all channel data by.
unsigned char fadeDown
 The fade position for fading sourceA (0) down to sourceB (255).
unsigned char fadeUp
 The fade position for fading sourceA (0) up to sourceB (255).
int providerID
 The ID of this provider.

Detailed Description

A channel provider that passes data to the channel manager from two different sources with a dipless cross fade.

You can independantly fade down and fade up to perform a standard cross fade both up & down fade settings will be the same. As an example let us assume there are just 2 channels, and in sourceA they are set to value 30 and 100, and in sourceB they are set to 60 and 50.

The transition of channel 1 is 30 to 60, so this is controlled by the up fade value. The down fade value will have no effect on this channel. Whereas channel 2 is a transition from 100 to 50 and so is controlled by the down fade value. The up fade value has no effect on the channel.

This allows you to fade a scene out at a different rate that you fade a scene in, and is sometimes use in cue stacks.

The sources can either be scenes, or set directly.


Member Function Documentation

- (unsigned char) crossFade  

Get the cross fade value.

0 is source A, 255 is source B. If the UP and DOWN fade values are different, then the average value will be returned.

Returns:
The current cross fade value
See also:
- setCrossFade:

- (unsigned char) crossFader  

Deprecated:
Due to wrong name, use crossFade instead

- (LOScene *) crossFadeScene  

Get the current cross fade scene (pre master).

Parameters:
crossFadeScene The scene

- (unsigned char) fadeDown  

Get the cross fade UP value.

0 is source A, 255 is source B.

Returns:
The current cross fade up value
See also:
- setFadeUp:

- setFadeDown:

- setCrossFade:

fadeUp

- (unsigned char) fadeUp  

Get the cross fade UP value.

0 is source A, 255 is source B.

Returns:
The current cross fade up value
See also:
- setFadeUp:

- setFadeDown:

- setCrossFade:

fadeDown

- (id) init  

Initilise the provider ready to be used.

This method registeres the provider with the channel manager, but no channel data exists until the setChannel function, or the setScene funtion, is called. It is initilised with all channels that the channelManager holds at the time of initilisiation.

Returns:
The initilised provider
See also:
- setChannel:toValue:onSource:

- (id) initWithLastChannel: (unsigned)  aChannel  

Initilise the provider ready to be used.

This method registeres the provider with the channel manager, but no channel data exists until the setChannel function, or the setScene funtion, is called.

Parameters:
aChannel The last numbered channel that this provider will provide data for
Returns:
The initilised provider
See also:
- setChannel:toValue:onSource:

- (id) initWithScene: (LOScene *)  AScene
andScene: (LOScene *)  BScene 

Initilise the provider read to be used.

This method registeres the provider with the channel manager, and uses the 2 scenes as the channel value data source.

If initilised this way the setChannel function will update the scenes referenced, and not a local copy.

If Either scene is NIL a new one will be created with a size of all the channelManager channels avaliable.

Parameters:
AScene The scene used for the A provider
BScene The scene used for the B provider
Returns:
The initilised provider

- (unsigned char) master  

Get the master value.

Returns:
The current master value
See also:
- setMaster:

- (void) setChannel: (unsigned)  aChannel
toValue: (unsigned char)  theValue
onSource: (LODiplessCrossFadeSource)  theSource 

Set the value of the channel.

This function notifies the channel manager that there is a possible update for the main output.

In the event that an external scene is used then this will update that scene/

Parameters:
aChannel The channel number to se
theValue The valule of the channel.
theSource The source to update.
See also:
- setScene:forSource:

- (void) setCrossFade: (unsigned char)  theCrossFade  

Set the cross fade value.

0 is source A, 255 is source B. This sets both the fade up and fade down values to be the same

Parameters:
theCrossFade The value to set
See also:
- crossFade:

- (void) setFadeDown: (unsigned char)  theFade  

Set the fade down value.

0 is source A, 255 is source B.

Parameters:
theFade The value to set
See also:
fadeDown

- (void) setFadeDown: (unsigned char)  theFadeDown
andUp: (unsigned char)  theFadeUp 

Set both fade values.

0 is source A, 255 is source B.

Parameters:
theFadeDown The value to set
theFadeUp The value to set
See also:
- setFadeDown:

- setFadeUp:

- (void) setFadeUp: (unsigned char)  theFade  

Set the fade up value.

0 is source A, 255 is source B.

Parameters:
theFade The value to set
See also:
fadeUp

- (void) setMaster: (unsigned char)  theMaster  

Set the master value, update the output and notifies the channel manager.

Parameters:
theMaster The value to set
See also:
master:

- (void) setProviderID: (int)  theProviderID  

Set the provider ID to be something other that the defaulr.

- (void) setScene: (LOScene *)  aScene
forSource: (LODiplessCrossFadeSource)  theSource 

Set the scene for a data source.

Setting the scene releases the current data source and replaces it with a new one. it is important that the new Scene does not have more channels than this provider was initilised with.

It should also be noted that the output is not updated and the channel amanger is not notified of any changes. You should call the updateOutput function to do this.

Parameters:
aScene The scene
theSource The source to update
See also:
- setChannel:toValue:onSource:

- updateOutput:

- (void) updateOutputForChannel: (unsigned)  aChannel  

This method recalculates the output cache, and if the channel output has changed will notify the channel manager.

You should call this if the scene data changes.

Parameters:
aChannel The channel to update.


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