@Override protected ChannelVolumeDB valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Integer volumeDB = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) volumeDB = (new UnsignedIntegerTwoBytesDatatype() .valueOf(attribute.getValue())) .getValue().intValue(); // Java is fun! } return channel != null && volumeDB != null ? new ChannelVolumeDB(channel, volumeDB) : null; }
@Override public void setPortMapping(PortMapping portMapping) { enabledField.setSelected(portMapping.isEnabled()); leaseDurationField.setText(portMapping.getLeaseDurationSeconds().getValue().toString()); remoteHostField.setText(portMapping.getRemoteHost()); externalPortField.setText(portMapping.getExternalPort().getValue().toString()); protocolField.setSelectedItem(portMapping.getProtocol()); internalClientField.setText(portMapping.getInternalClient()); internalPortField.setText(portMapping.getInternalPort().getValue().toString()); descriptionField.setText(portMapping.getDescription()); }
@Override protected ChannelVolume valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Integer volume = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) volume = (new UnsignedIntegerTwoBytesDatatype() .valueOf(attribute.getValue())) .getValue().intValue(); // Java is fun! } return channel != null && volume != null ? new ChannelVolume(channel, volume) : null; }
@Override public void setVolume(UnsignedIntegerFourBytes instanceId, String channelName, UnsignedIntegerTwoBytes desiredVolume) throws RenderingControlException { checkChannel(channelName); double vol = desiredVolume.getValue() / 100d; log.fine("Setting backend volume to: " + vol); getInstance(instanceId).setVolume(vol); }
public Object getValueAt(int row, int column) { switch (column) { case 0: return getPortMappings()[row].isEnabled(); case 1: return getPortMappings()[row].getLeaseDurationSeconds().getValue(); case 2: return getPortMappings()[row].getRemoteHost(); case 3: return getPortMappings()[row].getExternalPort().getValue(); case 4: return getPortMappings()[row].getProtocol().toString(); case 5: return getPortMappings()[row].getInternalClient(); case 6: return getPortMappings()[row].getInternalPort().getValue(); case 7: return getPortMappings()[row].getDescription(); } return null; }
@Override public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception { for (Channel channel : getCurrentChannels()) { String channelString = channel.name(); lc.setEventedValue( instanceId, new RenderingControlVariable.Mute(new ChannelMute(channel, getMute(instanceId, channelString))), new RenderingControlVariable.Loudness(new ChannelLoudness(channel, getLoudness(instanceId, channelString))), new RenderingControlVariable.Volume(new ChannelVolume(channel, getVolume(instanceId, channelString).getValue().intValue())), new RenderingControlVariable.VolumeDB(new ChannelVolumeDB(channel, getVolumeDB(instanceId, channelString))), new RenderingControlVariable.PresetNameList(PresetName.FactoryDefaults.name()) ); } }
@Override protected ChannelVolume valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Integer volume = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) volume = (new UnsignedIntegerTwoBytesDatatype() .valueOf(attribute.getValue())) .getValue().intValue(); // Java is fun! } return channel != null && volume != null ? new ChannelVolume(channel, volume) : null; }
@Override protected ChannelVolumeDB valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Integer volumeDB = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) volumeDB = (new UnsignedIntegerTwoBytesDatatype() .valueOf(attribute.getValue())) .getValue().intValue(); // Java is fun! } return channel != null && volumeDB != null ? new ChannelVolumeDB(channel, volumeDB) : null; }
@Override public void setVolume(UnsignedIntegerFourBytes instanceId, String channelName, UnsignedIntegerTwoBytes desiredVolume) throws RenderingControlException { checkChannel(channelName); double vol = desiredVolume.getValue() / 100d; log.fine("Setting backend volume to: " + vol); getInstance(instanceId).setVolume(vol); }
@Override public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception { for (Channel channel : getCurrentChannels()) { String channelString = channel.name(); lc.setEventedValue( instanceId, new RenderingControlVariable.Mute(new ChannelMute(channel, getMute(instanceId, channelString))), new RenderingControlVariable.Loudness(new ChannelLoudness(channel, getLoudness(instanceId, channelString))), new RenderingControlVariable.Volume(new ChannelVolume(channel, getVolume(instanceId, channelString).getValue().intValue())), new RenderingControlVariable.VolumeDB(new ChannelVolumeDB(channel, getVolumeDB(instanceId, channelString))), new RenderingControlVariable.PresetNameList(PresetName.FactoryDefaults.name()) ); } }
@Override protected ChannelVolumeDB valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Integer volumeDB = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) volumeDB = (new UnsignedIntegerTwoBytesDatatype() .valueOf(attribute.getValue())) .getValue().intValue(); // Java is fun! } return channel != null && volumeDB != null ? new ChannelVolumeDB(channel, volumeDB) : null; }
protected int getIntValue(final ActionInvocation<?> response, final String argumentName) { return ((UnsignedIntegerTwoBytes) response.getOutput(argumentName).getValue()).getValue().intValue(); }
@Override protected ChannelVolume valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Integer volume = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) volume = (new UnsignedIntegerTwoBytesDatatype() .valueOf(attribute.getValue())) .getValue().intValue(); // Java is fun! } return channel != null && volume != null ? new ChannelVolume(channel, volume) : null; }
@Override public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception { for (Channel channel : getCurrentChannels()) { String channelString = channel.name(); lc.setEventedValue( instanceId, new RenderingControlVariable.Mute(new ChannelMute(channel, getMute(instanceId, channelString))), new RenderingControlVariable.Loudness(new ChannelLoudness(channel, getLoudness(instanceId, channelString))), new RenderingControlVariable.Volume(new ChannelVolume(channel, getVolume(instanceId, channelString).getValue().intValue())), new RenderingControlVariable.VolumeDB(new ChannelVolumeDB(channel, getVolumeDB(instanceId, channelString))), new RenderingControlVariable.PresetNameList(PresetName.FactoryDefaults.name()) ); } }