protected Channel getChannel(String channelName) throws RenderingControlException { try { return Channel.valueOf(channelName); } catch (IllegalArgumentException ex) { throw new RenderingControlException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported audio channel: " + channelName); } }
@Override protected ChannelMute valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Boolean mute = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) mute = new BooleanDatatype().valueOf(attribute.getValue()); } return channel != null && mute != null ? new ChannelMute(channel, mute) : null; }
@Override protected ChannelLoudness valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Boolean loudness = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) loudness = new BooleanDatatype().valueOf(attribute.getValue()); } return channel != null && loudness != null ? new ChannelLoudness(channel, loudness) : 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 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; }
protected Channel getChannel(String channelName) throws RenderingControlException { try { return Channel.valueOf(channelName); } catch (IllegalArgumentException ex) { throw new RenderingControlException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported audio channel: " + channelName); } }
@Override protected ChannelLoudness valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Boolean loudness = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) loudness = new BooleanDatatype().valueOf(attribute.getValue()); } return channel != null && loudness != null ? new ChannelLoudness(channel, loudness) : null; }
@Override protected ChannelMute valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Boolean mute = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) mute = new BooleanDatatype().valueOf(attribute.getValue()); } return channel != null && mute != null ? new ChannelMute(channel, mute) : null; }
@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; }
protected Channel getChannel(String channelName) throws RenderingControlException { try { return Channel.valueOf(channelName); } catch (IllegalArgumentException ex) { throw new RenderingControlException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported audio channel: " + channelName); } }
@Override protected ChannelLoudness valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Boolean loudness = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) loudness = new BooleanDatatype().valueOf(attribute.getValue()); } return channel != null && loudness != null ? new ChannelLoudness(channel, loudness) : null; }
@Override protected ChannelMute valueOf(Map.Entry<String, String>[] attributes) throws InvalidValueException { Channel channel = null; Boolean mute = null; for (Map.Entry<String, String> attribute : attributes) { if (attribute.getKey().equals("channel")) channel = Channel.valueOf(attribute.getValue()); if (attribute.getKey().equals("val")) mute = new BooleanDatatype().valueOf(attribute.getValue()); } return channel != null && mute != null ? new ChannelMute(channel, mute) : 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 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; }