use of org.fourthline.cling.support.renderingcontrol.callback.SetVolume in project BeyondUPnP by kevinshine.
the class PlaybackCommand method setVolume.
public static void setVolume(int newVolume) {
Device device = SystemManager.getInstance().getSelectedDevice();
//Check selected device
if (device == null)
return;
Service rcService = device.findService(SystemManager.RENDERING_CONTROL_SERVICE);
if (rcService != null) {
ControlPoint cp = SystemManager.getInstance().getControlPoint();
cp.execute(new SetVolume(rcService, newVolume) {
@Override
public void success(ActionInvocation invocation) {
Log.i(TAG, "SetVolume success.");
}
@Override
public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) {
Log.e(TAG, "SetVolume failure.");
}
});
}
}
Aggregations