本文整理汇总了Java中org.cybergarage.upnp.Action.getArgumentValue方法的典型用法代码示例。如果您正苦于以下问题:Java Action.getArgumentValue方法的具体用法?Java Action.getArgumentValue怎么用?Java Action.getArgumentValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cybergarage.upnp.Action
的用法示例。
在下文中一共展示了Action.getArgumentValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTransportState
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
public String getTransportState(Device device) {
if (device == null) {
return "STOPPED";
}
Service localService = device.getService("urn:schemas-upnp-org:service:AVTransport:1");
if (localService == null) {
return null;
}
Action localAction = localService.getAction(AVTransport.GETTRANSPORTINFO);
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
if (localAction.postControlAction()) {
return localAction.getArgumentValue(AVTransport.CURRENTTRANSPORTSTATE);
}
return null;
}
示例2: getVolumeDbRange
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
public String getVolumeDbRange(Device device, String argument) {
if (device == null) {
return "";
}
Service localService = device.getService("urn:schemas-upnp-org:service:RenderingControl:1");
if (localService == null) {
return null;
}
Action localAction = localService.getAction(RenderingControl.GETVOLUMEDBRANGE);
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
localAction.setArgumentValue(RenderingControl.CHANNEL, RenderingControl.MASTER);
if (localAction.postControlAction()) {
return localAction.getArgumentValue(argument);
}
return null;
}
示例3: getPositionInfo
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
public String[] getPositionInfo(Device device) {
if (device == null) {
return new String[]{"00:00:00", ""};
}
Service localService = device.getService("urn:schemas-upnp-org:service:AVTransport:1");
if (localService == null) {
return null;
}
Action localAction = localService.getAction(AVTransport.GETPOSITIONINFO);
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
if (localAction.postControlAction()) {
String seek = localAction.getArgumentValue(AVTransport.RELTIME);
String url = localAction.getArgumentValue(AVTransport.TRACKURI);
return new String[]{seek, url};
}
return new String[]{"00:00:00", ""};
}
示例4: getMediaDuration
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
public String getMediaDuration(Device device) {
if (device == null) {
return "00:00:00";
}
Service localService = device.getService("urn:schemas-upnp-org:service:AVTransport:1");
if (localService == null) {
return null;
}
Action localAction = localService.getAction(AVTransport.GETMEDIAINFO);
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
if (localAction.postControlAction()) {
return localAction.getArgumentValue(AVTransport.MEDIADURATION);
}
return null;
}
示例5: getMute
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
public String getMute(Device device) {
if (device == null) {
return "";
}
Service service = device.getService("urn:schemas-upnp-org:service:RenderingControl:1");
if (service == null) {
return null;
}
Action getAction = service.getAction(RenderingControl.GETMUTE);
if (getAction == null) {
return null;
}
getAction.setArgumentValue("InstanceID", "0");
getAction.setArgumentValue(RenderingControl.CHANNEL, RenderingControl.MASTER);
getAction.postControlAction();
return getAction.getArgumentValue(RenderingControl.CURRENTMUTE);
}
示例6: getTransportState
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
@Override
public String getTransportState(Device device) {
Service localService = device.getService(AVTransport1);
if (localService == null) {
return null;
}
final Action localAction = localService.getAction("GetTransportInfo");
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
if (localAction.postControlAction()) {
return localAction.getArgumentValue("CurrentTransportState");
} else {
return null;
}
}
示例7: getVolumeDbRange
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
public String getVolumeDbRange(Device device, String argument) {
Service localService = device.getService(RenderingControl);
if (localService == null) {
return null;
}
Action localAction = localService.getAction("GetVolumeDBRange");
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
localAction.setArgumentValue("Channel", "Master");
if (!localAction.postControlAction()) {
return null;
} else {
return localAction.getArgumentValue(argument);
}
}
示例8: getPositionInfo
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
@Override
public String getPositionInfo(Device device) {
Service localService = device.getService(AVTransport1);
if (localService == null)
return null;
final Action localAction = localService.getAction("GetPositionInfo");
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
boolean isSuccess = localAction.postControlAction();
if (isSuccess) {
return localAction.getArgumentValue("AbsTime");
} else {
return null;
}
}
示例9: getMediaDuration
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
@Override
public String getMediaDuration(Device device) {
Service localService = device.getService(AVTransport1);
if (localService == null) {
return null;
}
final Action localAction = localService.getAction("GetMediaInfo");
if (localAction == null) {
return null;
}
localAction.setArgumentValue("InstanceID", "0");
if (localAction.postControlAction()) {
return localAction.getArgumentValue("MediaDuration");
} else {
return null;
}
}
示例10: getMute
import org.cybergarage.upnp.Action; //导入方法依赖的package包/类
@Override
public String getMute(Device device) {
Service service = device.getService(RenderingControl);
if (service == null) {
return null;
}
final Action getAction = service.getAction("GetMute");
if (getAction == null) {
return null;
}
getAction.setArgumentValue("InstanceID", "0");
getAction.setArgumentValue("Channel", "Master");
getAction.postControlAction();
return getAction.getArgumentValue("CurrentMute");
}