model.channel
Class ChannelValues

java.lang.Object
  extended by model.channel.ChannelValues

public class ChannelValues
extends Object

This class stores all the current channel values. Additionally, it decides what the actual value of a channel will be when it is receiving values from multiple sources.

TODO: I need to rewrite this entire class using a numbered priority system. The current system does not allow enough flexibility for the power I want to have in the program. For now, this does work well, and until I have time to rewrite this entire portion of the program, I will leave it as it is.


Field Summary
static float FADE_DOWN_SOURCE
          These modes relate to the status of specific channels at any given time.
static float FADE_UP_SOURCE
          These modes relate to the status of specific channels at any given time.
static float FADER_SOURCE
          When a channel value is being changed, the channel source value is passed in with the method.
static float SUBMASTER_SOURCE
          When a channel value is being changed, the channel source value is passed in with the method.
 
Constructor Summary
ChannelValues(int _maxChannel)
          This constructor will create a new ChannelValue object with the set maximum number of channels.
 
Method Summary
 void addSet(model.channel.IValueSet set)
           
 Channel getChannel(Channel channel)
          This method returns the Channel object for the given channel address.
 Channel[] getChannels()
          This method will return an array of Channel objects for every channel with a non-zero value.
 Channel[] getChannels(Channel[] channels)
          This method will return Channel objects for the given channels.
 Channel[] getChannels(Channel[] channels, float source)
          This method will return a Channel object with the value from the given source for each given channel address.
 Channel[] getChannelsForCue()
          This is a specilized form of getChannels() used when creating new cues.
 float[] getChannelSource(Channel channel)
           
 float[][] getChannelSources(Channel[] channels)
           
 short getChannelValue(Channel channel)
           
 short getChannelValue(short address)
          This method returns the value of the given channel address.
 short[] getChannelValues(short[] addresses)
          This method will return an array of Channel objects for every channel with a non-zero value.
 model.channel.IValueSet getValueSet(float source)
           
 void removeAllCues()
           
 void removeSet(float source)
           
 void removeSet(model.channel.IValueSet set)
           
 Channel[] resetValues(float source)
           
 void updateChannel(Channel channel, float source)
          This method will update the value for the given address, value pair.
 void updateChannels(Channel[] channels, float source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FADER_SOURCE

public static final float FADER_SOURCE
When a channel value is being changed, the channel source value is passed in with the method. FADER_SOURCE is used when the channel value is from the virtual faders or keyboard.

See Also:
Constant Field Values

SUBMASTER_SOURCE

public static final float SUBMASTER_SOURCE
When a channel value is being changed, the channel source value is passed in with the method. SUBMASTER_SOURCE is used when the channel value is from a submaster.

See Also:
Constant Field Values

FADE_UP_SOURCE

public static final float FADE_UP_SOURCE
These modes relate to the status of specific channels at any given time. This status decides what the color code around the channel will be.

The FADE_UP_MODE is utilized when a channel is being faded up in value by a cue transition.

See Also:
Constant Field Values

FADE_DOWN_SOURCE

public static final float FADE_DOWN_SOURCE
These modes relate to the status of specific channels at any given time. This status decides what the color code around the channel will be.

The FADE_DOWN_MODE is utilized when a channel is being faded down in value by a cue transition.

See Also:
Constant Field Values
Constructor Detail

ChannelValues

public ChannelValues(int _maxChannel)
This constructor will create a new ChannelValue object with the set maximum number of channels. It will instantiate all of the channel values to their defaults.

TODO: Update Comments

Parameters:
_maxChannel - The maximum number of channels for this setup.
Method Detail

removeSet

public void removeSet(model.channel.IValueSet set)

removeSet

public void removeSet(float source)

addSet

public void addSet(model.channel.IValueSet set)

getChannelValue

public short getChannelValue(short address)
This method returns the value of the given channel address.

Parameters:
address - The address whos value will be returned.
Returns:
The value of the given address.

getChannelValue

public short getChannelValue(Channel channel)

getChannel

public Channel getChannel(Channel channel)
This method returns the Channel object for the given channel address. Only the address will be used from the given Channel, the value will be ignored.

Parameters:
channel - The channel to return the Channel object for.
Returns:
The Channel object representing the given channel address.

getChannels

public Channel[] getChannels(Channel[] channels)
This method will return Channel objects for the given channels. Only the address is used from the given channels, the value is ignored.

Parameters:
channels - The channels to return Channel objects for.
Returns:
The array of Channel objects corresponding to the given channels.

getChannelValues

public short[] getChannelValues(short[] addresses)
This method will return an array of Channel objects for every channel with a non-zero value.

Returns:
The array of Channel objects for every channel with a non-zero value.

getChannels

public Channel[] getChannels()
This method will return an array of Channel objects for every channel with a non-zero value.

Returns:
The array of Channel objects for every channel with a non-zero value.

getChannelsForCue

public Channel[] getChannelsForCue()
This is a specilized form of getChannels() used when creating new cues. In addition to returning all channels with a non-zero value, it will also return channels with a hard-ducked fader value (-100).

Returns:
The array of Channel objects for cue creation.

updateChannel

public void updateChannel(Channel channel,
                          float source)
This method will update the value for the given address, value pair.

Parameters:
channel - The channel object with the address, value pair to be updated.
source - The source of the new channel value.

updateChannels

public void updateChannels(Channel[] channels,
                           float source)

getChannelSource

public float[] getChannelSource(Channel channel)

getChannelSources

public float[][] getChannelSources(Channel[] channels)

getValueSet

public model.channel.IValueSet getValueSet(float source)

getChannels

public Channel[] getChannels(Channel[] channels,
                             float source)
This method will return a Channel object with the value from the given source for each given channel address.

Parameters:
channels - The channels that you want the values from the given source for. Only the address parameter from these channels will the used, the value will be ignored.
source - The source to get the values from.
Returns:
The array containing the channel objects for the given channels with the value of that channel from the given source.

resetValues

public Channel[] resetValues(float source)

removeAllCues

public void removeAllCues()