com.amx.duet.tools.comm.component
Class VirtualPreAmpComponent

java.lang.Object
  extended bycom.amx.duet.devicesdk.component.PreAmpComponentImpl
      extended bycom.amx.duet.tools.comm.component.VirtualPreAmpComponent
All Implemented Interfaces:
ICommonComponent, com.amx.duet.devicesdk.component.IPreAmpComponent, com.amx.duet.devicesdk.component.IPreAmpComponentListener, ISurroundModes

public abstract class VirtualPreAmpComponent
extends com.amx.duet.devicesdk.component.PreAmpComponentImpl
implements ICommonComponent, ISurroundModes

The VirtualPreAmpComponent class stores and maintains a list of selectable surround modes for the device. Each source is added to both an internal list within this class and a list stored in the parent class. The active surroundMode can be changed with a call to the updateSurroundMode method. In the constructor of the implemented class (i.e. MakeModelPreAmpComponent ) the surround modes for the device should be added. One way to accomplish this with TSE's as described in the duet module programming guide is setSurroundModeList( MakeModeSurroundModes.VALUES );.


Constructor Summary
VirtualPreAmpComponent(com.amx.duet.devicesdk.component.IPreAmpComponent caller, int index)
           
 
Method Summary
 com.amx.duet.devicesdk.type.SurroundMode addSurroundMode(int surroundModeNumber, java.lang.String surroundModeLabel)
          Creates an InternalSurroundMode for the surroundModeLabel speceified, then adds that SurroundMode object to the source select list.
 com.amx.duet.devicesdk.type.SurroundMode addSurroundMode(int surroundModeNumber, com.amx.duet.devicesdk.type.SurroundMode surroundMode)
          Adds a SurroundMode object to the source select list.
 void dispose()
          Class destructor used for clean up
 com.amx.duet.devicesdk.type.SurroundMode getSurroundMode(int surroundModeNumber)
          Returns the SurroundMode for the specified surroundModeNumber.
 int getSurroundModeCount()
          Returns the number of valid surround mode settings.
 int getSurroundModeNumber(com.amx.duet.devicesdk.type.SurroundMode surroundMode)
          Find the number of the surround mode.
 java.lang.String[] getSurroundModeProperties()
          Returns the properties for all surround mode settings.
 java.lang.String getSurroundModeProperty(int surroundModeNumber)
          Returns the properties for a single surround mode setting.
 int getSurroundModeSelect()
          Returns the currently selected surround mode.
 void processAddSurroundModeEvent(int surroundModeNumber, java.lang.String surroundModeLabel)
          Processes the event when a Surround Mode is added.
 void processSurroundModeCountEvent(int surroundModeNumber)
          Processes the event when the PreAmp Surround Mode Count is requested.
 void processSurroundModeProperties(java.lang.String[] propertyArray)
          Processes the event when the PreAmp Surround Mode properties are requested.
 void processSurroundModePropertyEvent(java.lang.String propertyValue)
          Processes the event when the PreAmp Surround Mode Property is changed.
 void processSurroundModeSelectEvent(int surroundModeNumber)
          Processes the event when the PreAmp Surround Mode selection is made.
abstract  void sendCommandFeedback(java.lang.String message, com.amx.duet.devicesdk.base.AdvancedEvent advEv, int zone)
          Sends feedback to the device.
abstract  void setSurroundMode(com.amx.duet.devicesdk.type.SurroundMode surroundMode)
          Send the command to the device to set the specified surround mode.
 void setSurroundModeList(java.util.List surroundModes)
          Sets list of surround modes for the device.
This method should not be overridden by the programmer unless non-standard behavior is desired.
 void setSurroundModeList(com.amx.duet.devicesdk.type.SurroundMode[] surroundModes)
          A convenience method to set the list of surround modes for the device.
 void setSurroundModeSelect(int surroundModeNumber)
          Sets the current surround mode setting, where index is a virtual index number between 1 and the value returned by getSurroundModeCount().
 void updateSurroundMode(com.amx.duet.devicesdk.type.SurroundMode surroundMode)
          A convenience method to update the Surround Mode
 void updateSurroundModeSelect(int surroundModeNumber)
          Set the SurroundMode for the device.
The new value is compared against the current value.
 
Methods inherited from class com.amx.duet.devicesdk.component.PreAmpComponentImpl
addPreAmpComponentListener, adjustBalance, adjustBass, adjustTreble, cycleLoudness, getBalance, getBass, getPreAmpComponent, getPreAmpComponentCount, getPreAmpComponentIndex, getSurroundMode, getSurroundModeDisplayText, getSurroundModeValues, getTreble, isLoudnessOn, nextSurroundMode, previousSurroundMode, processBalanceEvent, processBassEvent, processLoudnessEvent, processSurroundModeEvent, processTrebleEvent, refresh, reinitialize, removePreAmpComponentListener, setBalance, setBass, setLoudnessOn, setTreble, updateBalance, updateBass, updateLoudness, updateTreble
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.amx.duet.tools.comm.ICommonComponent
refresh, reinitialize
 

Constructor Detail

VirtualPreAmpComponent

public VirtualPreAmpComponent(com.amx.duet.devicesdk.component.IPreAmpComponent caller,
                              int index)
Parameters:
caller -
index -
Method Detail

addSurroundMode

public com.amx.duet.devicesdk.type.SurroundMode addSurroundMode(int surroundModeNumber,
                                                                java.lang.String surroundModeLabel)
Creates an InternalSurroundMode for the surroundModeLabel speceified, then adds that SurroundMode object to the source select list.

Parameters:
surroundModeNumber - integer value representing the selectable surround mode
surroundModeLabel - the name of the surround mode.
Returns:
The SurroundMode added.
See Also:
addSurroundMode( int, SurroundMode );

addSurroundMode

public com.amx.duet.devicesdk.type.SurroundMode addSurroundMode(int surroundModeNumber,
                                                                com.amx.duet.devicesdk.type.SurroundMode surroundMode)
Adds a SurroundMode object to the source select list. Each object is added to both an internal list within this class and the list stored in the parent class. Input select group number has a 1:1 correlation with input source inputNumber. The input source should only be set to active if it has been configured within the group to be the only selectable source. Thus, in a device where all sources are selectable (mutually exclusive) each source must be set as an active source.

Parameters:
surroundModeNumber - integer value representing the selectable surround mode
surroundMode - a predefined SurroundMode used by the device
Returns:
The SurroundMode added.

dispose

public void dispose()
Description copied from interface: ICommonComponent
Class destructor used for clean up

Specified by:
dispose in interface ICommonComponent

getSurroundMode

public com.amx.duet.devicesdk.type.SurroundMode getSurroundMode(int surroundModeNumber)
Returns the SurroundMode for the specified surroundModeNumber. SurroundMode.INVALID is returned if no matching surroundModeNumber is found.

Parameters:
surroundModeNumber - integer value representing the selectable surround mode
Returns:
The matching SurroundMode or SurroundMode.INVALID if unable to match.

getSurroundModeCount

public int getSurroundModeCount()
Returns the number of valid surround mode settings.

Specified by:
getSurroundModeCount in interface ISurroundModes
Returns:
The number of surround mode settings.

getSurroundModeNumber

public int getSurroundModeNumber(com.amx.duet.devicesdk.type.SurroundMode surroundMode)
Find the number of the surround mode. The SurroundMode is matched based on the name of surround modes set within this VirtualPreAmpComponent. If no matching SurroundMode is found, Integer.MIN_VALUE is returned.

Parameters:
surroundMode - the SurroundMode to match
Returns:
The number that specifies the SurroundMode, or Integer.MIN_VALUE if unable to match.

getSurroundModeProperties

public java.lang.String[] getSurroundModeProperties()
Returns the properties for all surround mode settings.

Specified by:
getSurroundModeProperties in interface ISurroundModes
Returns:
All the properties for the surround modes.

getSurroundModeProperty

public java.lang.String getSurroundModeProperty(int surroundModeNumber)
Returns the properties for a single surround mode setting.

Specified by:
getSurroundModeProperty in interface ISurroundModes
Parameters:
surroundModeNumber - integer value representing the selectable surround mode
Returns:
String

getSurroundModeSelect

public int getSurroundModeSelect()
Returns the currently selected surround mode.

Specified by:
getSurroundModeSelect in interface ISurroundModes
Returns:
int

processAddSurroundModeEvent

public void processAddSurroundModeEvent(int surroundModeNumber,
                                        java.lang.String surroundModeLabel)
Processes the event when a Surround Mode is added.

Parameters:
surroundModeNumber - integer value representing the selectable surround mode
surroundModeLabel - the name of the surround mode.

processSurroundModeCountEvent

public void processSurroundModeCountEvent(int surroundModeNumber)
Processes the event when the PreAmp Surround Mode Count is requested.

Specified by:
processSurroundModeCountEvent in interface ISurroundModes
Parameters:
surroundModeNumber - integer value representing the selectable surround mode

processSurroundModeProperties

public void processSurroundModeProperties(java.lang.String[] propertyArray)
Processes the event when the PreAmp Surround Mode properties are requested.

Specified by:
processSurroundModeProperties in interface ISurroundModes
Parameters:
propertyArray -

processSurroundModePropertyEvent

public void processSurroundModePropertyEvent(java.lang.String propertyValue)
Processes the event when the PreAmp Surround Mode Property is changed.

Specified by:
processSurroundModePropertyEvent in interface ISurroundModes
Parameters:
propertyValue -

processSurroundModeSelectEvent

public void processSurroundModeSelectEvent(int surroundModeNumber)
Processes the event when the PreAmp Surround Mode selection is made.

Specified by:
processSurroundModeSelectEvent in interface ISurroundModes
Parameters:
surroundModeNumber - integer value representing the selectable surround mode

sendCommandFeedback

public abstract void sendCommandFeedback(java.lang.String message,
                                         com.amx.duet.devicesdk.base.AdvancedEvent advEv,
                                         int zone)
Sends feedback to the device. A sample implementation is shown below:
utilities.sendCommandFeedback( message, advEv, zone, utilities.getNetLinxDevice() );

Parameters:
message - The feedback message to send back to the deive
advEv - The AdvancedEvent to process
zone - The zone of the virtual device the feedback is sent to.

setSurroundMode

public abstract void setSurroundMode(com.amx.duet.devicesdk.type.SurroundMode surroundMode)
Send the command to the device to set the specified surround mode. * // TODO: Send your command to the device here... enQueue( surroundModeCommand( surroundMode ) ); where surroundCommand provides the correct command to send to device.

Specified by:
setSurroundMode in interface com.amx.duet.devicesdk.component.IPreAmpComponent
Parameters:
surroundMode - a predefined SurroundMode used by the device

setSurroundModeList

public void setSurroundModeList(java.util.List surroundModes)
Sets list of surround modes for the device.
This method should not be overridden by the programmer unless non-standard behavior is desired.

Parameters:
surroundModes - List

setSurroundModeList

public void setSurroundModeList(com.amx.duet.devicesdk.type.SurroundMode[] surroundModes)
A convenience method to set the list of surround modes for the device.

Parameters:
surroundModes -
See Also:
setSurroundModeList( List );

setSurroundModeSelect

public void setSurroundModeSelect(int surroundModeNumber)
Sets the current surround mode setting, where index is a virtual index number between 1 and the value returned by getSurroundModeCount().

Specified by:
setSurroundModeSelect in interface ISurroundModes
Parameters:
surroundModeNumber - integer value representing the selectable surround mode

updateSurroundMode

public void updateSurroundMode(com.amx.duet.devicesdk.type.SurroundMode surroundMode)
A convenience method to update the Surround Mode

Parameters:
surroundMode - the desired surround mode
See Also:
updateSurroundModeSelect( int );

updateSurroundModeSelect

public void updateSurroundModeSelect(int surroundModeNumber)
Set the SurroundMode for the device.
The new value is compared against the current value. If the value has changed, the new value is saved and a process event for the SurroundMode is called.

Specified by:
updateSurroundModeSelect in interface ISurroundModes
Parameters:
surroundModeNumber - the number of the surround mode selected


Copyright © 2008 AMX LLC. All Rights Reserved.