本文整理汇总了Java中org.cybergarage.upnp.Device.isDeviceType方法的典型用法代码示例。如果您正苦于以下问题:Java Device.isDeviceType方法的具体用法?Java Device.isDeviceType怎么用?Java Device.isDeviceType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cybergarage.upnp.Device
的用法示例。
在下文中一共展示了Device.isDeviceType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printMediaServers
import org.cybergarage.upnp.Device; //导入方法依赖的package包/类
public void printMediaServers() {
DeviceList devList = getDeviceList();
int devCnt = devList.size();
int mediaServerCnt = 0;
for (int n = 0; n < devCnt; n++) {
Device dev = devList.getDevice(n);
if (dev.isDeviceType(MediaServer.DEVICE_TYPE)) {
System.out.println("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
printContentDirectory(dev);
mediaServerCnt++;
}
}
if (mediaServerCnt == 0) {
System.out.println("MediaServer is not found");
}
}
示例2: getDeviceList
import org.cybergarage.upnp.Device; //导入方法依赖的package包/类
private DeviceList getDeviceList(String deviceType) {
DeviceList devList = new DeviceList();
DeviceList allDevList = getDeviceList();
int allDevCnt = allDevList.size();
for (int n = 0; n < allDevCnt; n++) {
Device dev = allDevList.getDevice(n);
if (dev.isDeviceType(deviceType)) {
devList.add(dev);
}
}
return devList;
}
示例3: updateMediaServerList
import org.cybergarage.upnp.Device; //导入方法依赖的package包/类
private boolean updateMediaServerList() {
MediaPlayer dmp = getMediaPlayer();
if (dmp == null) {
return false;
}
MediaController controller = dmp.getController();
if (controller == null) {
return false;
}
int n;
DeviceList devList = controller.getDeviceList();
int devCnt = devList.size();
for (n = 0; n < devCnt; n++) {
Device dev = devList.getDevice(n);
if (dev.isDeviceType(MediaServer.DEVICE_TYPE)) {
System.out.println("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
}
}
int nContents = getNContentNodes();
ContentNode[] cnode = new ContentNode[nContents];
for (n = 0; n < nContents; n++) {
cnode[n] = getContentNode(n);
}
for (n = 0; n < nContents; n++) {
String containerName = cnode[n].getName();
if (!controller.hasDevice(containerName)) {
ContainerNode mserverNode = new ContainerNode();
mserverNode.setName(containerName);
addContentNode(mserverNode);
}
}
return false;
}
示例4: getServerDevice
import org.cybergarage.upnp.Device; //导入方法依赖的package包/类
public Device getServerDevice(String name) {
Device foundDev = getDevice(name);
return foundDev.isDeviceType(MediaServer.DEVICE_TYPE) ? foundDev : null;
}
示例5: getRendererDevice
import org.cybergarage.upnp.Device; //导入方法依赖的package包/类
public Device getRendererDevice(String name) {
Device foundDev = getDevice(name);
return foundDev.isDeviceType(MediaRenderer.DEVICE_TYPE) ? foundDev : null;
}