model.cue
Class ACue

java.lang.Object
  extended by model.cue.ACue

public class ACue
extends Object

This class represents an individual cue. It contains the channel assignments for the cue, the cue number, name, description, fade up time, and fade down time.


Constructor Summary
ACue(float _number, String _name, String _desc, long _fadeUpMillis, long _fadeDownMillis, int _maxChannel)
          This constructor will create a cue with a set number, name, description, fade up time, and fade down time.
ACue(float _number, String _name, String _desc, long _fadeUpMillis, long _fadeDownMillis, int _maxChannel, Hashtable<Short,Channel> _channels)
          This constructor will create a cue with a set number, name, description, fade up time, fade down time, and starting channel values.
ACue(int _maxChannel)
          This constructor creates a new cueset with the default cue 0
 
Method Summary
static ACue extractFile(String data, int cueMaxChannel)
          This method takes in the data from a saved cue file, and returns a new cue.
 Channel getChannel(short address)
          This method will return a channel object for the given address.
 Channel[] getChannels()
          This method will return the complete set of Channel objects for this cue.
 short[] getChannelValues(short[] addresses)
          This method returns an array of channel values.
 String getDesc()
          This method will return the cue's description.
 long getFadeDownMillis()
          This method returns the fade down time in milliseconds.
 long getFadeUpMillis()
          This method returns the fade up time in milliseconds.
 String getFileData()
          This method is used for saving cues to a file.
 String getName()
          This method will return the cue's name.
 float getNumber()
          This method will get the cue's number.
 String getSummary()
          This method returns a string containing the cue's number, fade up and fade down times, and name.
 short getValue(short address)
          This method will return the value of the given channel in this cue.
 void setChannelValue(Channel channel)
          This method will set the value of the given channel in this cue.
 void setChannelValues(Channel[] c)
          This method will set a series of channel values in the cue.
 void setDesc(String _desc)
          This method will set the cue's description.
 void setFadeDownMillis(long _fadeDownMillis)
          This method sets the fade down time in milliseconds.
 void setFadeUpMillis(long _fadeUpMillis)
          This method sets the fade up time in milliseconds.
 void setName(String _name)
          This method will set the cue's name.
 void setNumber(float _number)
          This method will set the cue's number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACue

public ACue(int _maxChannel)
This constructor creates a new cueset with the default cue 0

Parameters:
_maxChannel - The maximum number of channels for this cue.

ACue

public ACue(float _number,
            String _name,
            String _desc,
            long _fadeUpMillis,
            long _fadeDownMillis,
            int _maxChannel)
This constructor will create a cue with a set number, name, description, fade up time, and fade down time.

Parameters:
_number - The cue's number
_name - The cue's name
_desc - The cue's description
_fadeUpMillis - The fade up time for this cue, in milliseconds
_fadeDownMillis - The fade down time for this cue, in milliseconds
_maxChannel - The maximum number of channels possible for this show

ACue

public ACue(float _number,
            String _name,
            String _desc,
            long _fadeUpMillis,
            long _fadeDownMillis,
            int _maxChannel,
            Hashtable<Short,Channel> _channels)
This constructor will create a cue with a set number, name, description, fade up time, fade down time, and starting channel values.

Parameters:
_number - The cue's number
_name - The cue's name
_desc - The cue's description
_fadeUpMillis - The fade up time for this cue, in milliseconds
_fadeDownMillis - The fade down time for this cue, in milliseconds
_maxChannel - The maximum number of channels possible for this show
_channels - This hashtable contains any number of address, channel pairs with the default values for this cue. Any channels that are not present in the hashtable will have an assumed value of 0.
Method Detail

getValue

public short getValue(short address)
This method will return the value of the given channel in this cue.

Parameters:
address - The address to return the value for
Returns:
The value of the channel. If the cue's hashtable does not have a predefined value for this channel, it will return the default value of 0.

getChannelValues

public short[] getChannelValues(short[] addresses)
This method returns an array of channel values.

Parameters:
addresses - The array of channel addresses to return the values for.
Returns:
The channel values for the addresses passed into the method.

getChannel

public Channel getChannel(short address)
This method will return a channel object for the given address.

Parameters:
address - The address to return the Channel object for.
Returns:
The Channel object of the particular address in this cue.

getChannels

public Channel[] getChannels()
This method will return the complete set of Channel objects for this cue. It will return a value for all channels 1 through maxChannel. For the channels that don't have an entry in the hashtable, this method will return the default value of 0.

Returns:
An array of length maxChannels which contains the Channel objects for every address in this cue.

setChannelValue

public void setChannelValue(Channel channel)
This method will set the value of the given channel in this cue.

Parameters:
channel - The Channel object with the address, value pair.

setChannelValues

public void setChannelValues(Channel[] c)
This method will set a series of channel values in the cue.

Parameters:
c - The Channel objects with the new address, value pairs.

getName

public String getName()
This method will return the cue's name.

Returns:
The cue's name.

setName

public void setName(String _name)
This method will set the cue's name.

Parameters:
_name - The cue's new name.

getNumber

public float getNumber()
This method will get the cue's number.

Returns:
The cue's number.

setNumber

public void setNumber(float _number)
This method will set the cue's number.

Parameters:
_number - The cue's number.

getDesc

public String getDesc()
This method will return the cue's description.

Returns:
The cue's description.

setDesc

public void setDesc(String _desc)
This method will set the cue's description.

Parameters:
_desc - The cue's new description.

getSummary

public String getSummary()
This method returns a string containing the cue's number, fade up and fade down times, and name. This is the description displayed in the cue window in the user interface.

Returns:
The basic information about this cue in the format of "1.0: Fade up 3.5: Fade down 1.0: Act I Intro"

getFadeUpMillis

public long getFadeUpMillis()
This method returns the fade up time in milliseconds.

Returns:
The fade up time in milliseconds.

setFadeUpMillis

public void setFadeUpMillis(long _fadeUpMillis)
This method sets the fade up time in milliseconds.

Parameters:
_fadeUpMillis - The fade up time in milliseconds.

getFadeDownMillis

public long getFadeDownMillis()
This method returns the fade down time in milliseconds.

Returns:
The fade down time in milliseconds.

setFadeDownMillis

public void setFadeDownMillis(long _fadeDownMillis)
This method sets the fade down time in milliseconds.

Parameters:
_fadeDownMillis - The fade down time in milliseconds.

getFileData

public String getFileData()
This method is used for saving cues to a file. It will return the cue's information in an XML format to be saved in the file. The channel values are stored in the following format:
14
57
Each channel gets a separate channelValue set. Data is only saved for channels with non-zero values.

Returns:
A String with the data for this cue.

extractFile

public static ACue extractFile(String data,
                               int cueMaxChannel)
This method takes in the data from a saved cue file, and returns a new cue.

Parameters:
data - The data from the saved cue file.
int - cueMaxChannel The maximum number of channels for this cue.
Returns:
The ACue represented by the saved cue file.