org.fourthline.cling.support.renderingcontrol.RenderingControlException Java Examples

The following examples show how to use org.fourthline.cling.support.renderingcontrol.RenderingControlException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AudioRenderingControl.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
protected ZxtMediaPlayer getInstance(UnsignedIntegerFourBytes instanceId) throws RenderingControlException {
    ZxtMediaPlayer player = getPlayers().get(instanceId);
    if (player == null) {
        throw new RenderingControlException(RenderingControlErrorCode.INVALID_INSTANCE_ID);
    }
    return player;
}
 
Example #2
Source File: AudioRenderingControl.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
@Override
public UnsignedIntegerTwoBytes getVolume(UnsignedIntegerFourBytes instanceId, String channelName) throws RenderingControlException {
    checkChannel(channelName);
    int vol = (int) (getInstance(instanceId).getVolume() * 100);
    log.fine("Getting backend volume: " + vol);
    return new UnsignedIntegerTwoBytes(vol);
}
 
Example #3
Source File: AudioRenderingControl.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #4
Source File: AudioRenderingControl.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
protected ZxtMediaPlayer getInstance(UnsignedIntegerFourBytes instanceId) throws RenderingControlException {
    ZxtMediaPlayer player = getPlayers().get(instanceId);
    if (player == null) {
        throw new RenderingControlException(RenderingControlErrorCode.INVALID_INSTANCE_ID);
    }
    return player;
}
 
Example #5
Source File: AudioRenderingControl.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
@Override
public UnsignedIntegerTwoBytes getVolume(UnsignedIntegerFourBytes instanceId, String channelName) throws RenderingControlException {
    checkChannel(channelName);
    int vol = (int) (getInstance(instanceId).getVolume() * 100);
    log.fine("Getting backend volume: " + vol);
    return new UnsignedIntegerTwoBytes(vol);
}
 
Example #6
Source File: AudioRenderingControl.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
@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);
}
 
Example #7
Source File: AudioRenderingControl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
protected void checkChannel(String channelName) throws RenderingControlException {
    if (!getChannel(channelName).equals(Channel.Master)) {
        throw new RenderingControlException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported audio channel: " + channelName);
    }
}
 
Example #8
Source File: AudioRenderingControl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean getMute(UnsignedIntegerFourBytes instanceId, String channelName) throws RenderingControlException {
    checkChannel(channelName);
    return getInstance(instanceId).getVolume() == 0;
}
 
Example #9
Source File: AudioRenderingControl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void setMute(UnsignedIntegerFourBytes instanceId, String channelName, boolean desiredMute) throws RenderingControlException {
    checkChannel(channelName);
    log.fine("Setting backend mute to: " + desiredMute);
    getInstance(instanceId).setMute(desiredMute);
}
 
Example #10
Source File: AudioRenderingControl.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public boolean getMute(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes, @UpnpInputArgument(name = "Channel") String s) throws RenderingControlException {
    return false;
}
 
Example #11
Source File: AudioRenderingControl.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public UnsignedIntegerTwoBytes getVolume(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes, @UpnpInputArgument(name = "Channel") String s) throws RenderingControlException {
    return null;
}
 
Example #12
Source File: AudioRenderingControl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
protected void checkChannel(String channelName) throws RenderingControlException {
    if (!getChannel(channelName).equals(Channel.Master)) {
        throw new RenderingControlException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported audio channel: " + channelName);
    }
}
 
Example #13
Source File: AudioRenderingControl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean getMute(UnsignedIntegerFourBytes instanceId, String channelName) throws RenderingControlException {
    checkChannel(channelName);
    return getInstance(instanceId).getVolume() == 0;
}
 
Example #14
Source File: AudioRenderingControl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setMute(UnsignedIntegerFourBytes instanceId, String channelName, boolean desiredMute) throws RenderingControlException {
    checkChannel(channelName);
    log.fine("Setting backend mute to: " + desiredMute);
    getInstance(instanceId).setMute(desiredMute);
}
 
Example #15
Source File: AudioRenderingControl.java    From HPlayer with Apache License 2.0 2 votes vote down vote up
@Override
public void setMute(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes, @UpnpInputArgument(name = "Channel") String s, @UpnpInputArgument(name = "DesiredMute", stateVariable = "Mute") boolean b) throws RenderingControlException {

}
 
Example #16
Source File: AudioRenderingControl.java    From HPlayer with Apache License 2.0 2 votes vote down vote up
@Override
public void setVolume(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes, @UpnpInputArgument(name = "Channel") String s, @UpnpInputArgument(name = "DesiredVolume", stateVariable = "Volume") UnsignedIntegerTwoBytes unsignedIntegerTwoBytes) throws RenderingControlException {

}