本文整理汇总了Java中org.fourthline.cling.support.renderingcontrol.callback.SetVolume类的典型用法代码示例。如果您正苦于以下问题:Java SetVolume类的具体用法?Java SetVolume怎么用?Java SetVolume使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SetVolume类属于org.fourthline.cling.support.renderingcontrol.callback包,在下文中一共展示了SetVolume类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDeviceVolume
import org.fourthline.cling.support.renderingcontrol.callback.SetVolume; //导入依赖的package包/类
/**
* 设置音量
*/
public void setDeviceVolume(int volume) {
ActionCallback setVolume = new SetVolume(renderingControlService, volume) {
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
onFailureCallBack(SET_VOLUME, arg2);
}
@Override
public void success(ActionInvocation invocation) {
onSuccessCallBack(SET_VOLUME);
}
};
mUpnpService.getControlPoint().execute(setVolume);
}
示例2: setVolume
import org.fourthline.cling.support.renderingcontrol.callback.SetVolume; //导入依赖的package包/类
public void setVolume(long newVolume) {
SetVolume callback = new SetVolume(mRendererControlService, newVolume) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "SetVolume failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mRendererControlService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例3: setVolume
import org.fourthline.cling.support.renderingcontrol.callback.SetVolume; //导入依赖的package包/类
@Override
public void setVolume(int volume) {
if(volume < 0) {
volume = 0;
} else if(volume > device.volumeMax) {
volume = device.volumeMax;
}
device.volume = volume;
try {
controlPoint.execute(new SetVolume(device.renderer.findService(new ServiceType("schemas-upnp-org", "RenderingControl")), volume) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMessage) {
Log.w(TAG, "Set volume failed: " + defaultMessage);
}
});
} catch(Exception e) {
Log.w(TAG, "Failed to set volume");
}
}
示例4: setVolume
import org.fourthline.cling.support.renderingcontrol.callback.SetVolume; //导入依赖的package包/类
@Override
public void setVolume(final int volume)
{
if (getRenderingControlService() == null)
return;
controlPoint.execute(new SetVolume(getRenderingControlService(), volume) {
@Override
public void success(ActionInvocation invocation)
{
super.success(invocation);
Log.v(TAG, "Success to set volume");
rendererState.setVolume(volume);
}
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2)
{
Log.w(TAG, "Fail to set volume ! " + arg2);
}
});
}
示例5: testRenderingControlActionSetVolume
import org.fourthline.cling.support.renderingcontrol.callback.SetVolume; //导入依赖的package包/类
public void testRenderingControlActionSetVolume() {
UpnpClient upnpClient = getInitializedUpnpClientWithDevice(OPENBIT_AVTRANSPORT_DEVICE2);
Device<?, ?, ?> device = upnpClient
.getDevice(OPENBIT_AVTRANSPORT_DEVICE2);
Service avservice = getRenderingControlService(device);
// GetTransportInfo
Log.d(getClass().getName(), "Action SetVolume ");
actionFinished = false;
SetVolume actionCallback = new SetVolume(avservice, 0) {
@Override
public void success(ActionInvocation invocation) {
super.success(invocation);
displaySuccess(invocation);
}
@Override
public void failure(ActionInvocation actioninvocation,
UpnpResponse upnpresponse, String s) {
Log.d(getClass().getName(), "Failure UpnpResponse: "
+ upnpresponse);
Log.d(getClass().getName(),
"UpnpResponse: " + upnpresponse.getResponseDetails());
actionFinished = true;
}
};
upnpClient.getControlPoint().execute(actionCallback);
waitForActionComplete();
}