当前位置: 首页>>代码示例>>Java>>正文


Java Device类代码示例

本文整理汇总了Java中org.cybergarage.upnp.Device的典型用法代码示例。如果您正苦于以下问题:Java Device类的具体用法?Java Device怎么用?Java Device使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Device类属于org.cybergarage.upnp包,在下文中一共展示了Device类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: seek

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public boolean seek(Device device, String targetPosition) {
    if (device == null) {
        return false;
    }
    Service localService = device.getService("urn:schemas-upnp-org:service:AVTransport:1");
    if (localService == null) {
        return false;
    }
    Action localAction = localService.getAction(AVTransport.SEEK);
    if (localAction == null) {
        return false;
    }
    localAction.setArgumentValue("InstanceID", "0");
    localAction.setArgumentValue(AVTransport.UNIT, "ABS_TIME");
    localAction.setArgumentValue(AVTransport.TARGET, targetPosition);
    boolean postControlAction = localAction.postControlAction();
    if (postControlAction) {
        return postControlAction;
    }
    localAction.setArgumentValue(AVTransport.UNIT, "REL_TIME");
    localAction.setArgumentValue(AVTransport.TARGET, targetPosition);
    return localAction.postControlAction();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:24,代码来源:MultiPointController.java

示例2: 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");
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:17,代码来源:MediaController.java

示例3: setAVTransportURI

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public boolean setAVTransportURI(Device dev, ItemNode itemNode) {
    if (dev == null) {
        return false;
    }
    ResourceNode resNode = itemNode.getFirstResource();
    if (resNode == null) {
        return false;
    }
    String resURL = resNode.getURL();
    if (resURL == null || resURL.length() <= 0) {
        return false;
    }
    Service avTransService = dev.getService(AVTransport.SERVICE_TYPE);
    if (avTransService == null) {
        return false;
    }
    Action action = avTransService.getAction(AVTransport.SETAVTRANSPORTURI);
    if (action == null) {
        return false;
    }
    action.setArgumentValue("InstanceID", "0");
    action.setArgumentValue(AVTransport.CURRENTURI, resURL);
    action.setArgumentValue(AVTransport.CURRENTURIMETADATA, "");
    return action.postControlAction();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:26,代码来源:MediaController.java

示例4: play

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public boolean play(Device dev) {
    if (dev == null) {
        return false;
    }
    Service avTransService = dev.getService(AVTransport.SERVICE_TYPE);
    if (avTransService == null) {
        return false;
    }
    Action action = avTransService.getAction(AVTransport.PLAY);
    if (action == null) {
        return false;
    }
    action.setArgumentValue("InstanceID", "0");
    action.setArgumentValue(AVTransport.SPEED, "1");
    return action.postControlAction();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:17,代码来源:MediaController.java

示例5: syncGetPlayUrl

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public String syncGetPlayUrl(Device device) {
    String encryptUrl = getEncryptUrl();
    if (TextUtils.isEmpty(encryptUrl)) {
        return null;
    }
    if (PreferencesManager.getInstance().isLinkShellSwitch()) {
        String linkShellUrl = PlayUtils.getURLFromLinkShell(encryptUrl, this.mUUid);
        if (!TextUtils.isEmpty(linkShellUrl)) {
            encryptUrl = linkShellUrl;
        }
    }
    VolleyResult<RealLink> result = new LetvRequest().setUrl(encryptUrl).setCache(new VolleyNoCache()).setTag(BasePlayLiveFlow.REQUEST_REAL_LINK_SYNC).setParser(new LiveRealParser()).setMaxRetries(2).setRequestType(RequestManner.NETWORK_ONLY).syncFetch();
    if (result == null || result.networkState != NetworkResponseState.SUCCESS) {
        return null;
    }
    RealLink realLink = result.result;
    if (realLink == null || TextUtils.isEmpty(realLink.location)) {
        return null;
    }
    return realLink.location;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:22,代码来源:RequestRealLink.java

示例6: addDevice

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public synchronized void addDevice(Device d) {
	if (!DLNAUtil.isMediaRenderDevice(d))
		return;
	int size = mDevices.size();
	for (int i = 0; i < size; i++) {
		String udnString = mDevices.get(i).getUDN();
		if (d.getUDN().equalsIgnoreCase(udnString)) {
			return;
		}
	}
	
	mDevices.add(d);
	LogUtil.d(TAG, "Devices add a device" + d.getDeviceType());
	if (mDeviceChangeListener != null) {
		mDeviceChangeListener.onDeviceChange(d);
	}
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:18,代码来源:DLNAContainer.java

示例7: play

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public boolean play(Device device, String path) {
    if (device == null) {
        return false;
    }
    Service service = device.getService("urn:schemas-upnp-org:service:AVTransport:1");
    if (service == null) {
        return false;
    }
    Action action = service.getAction("SetAVTransportURI");
    if (action == null) {
        return false;
    }
    Action playAction = service.getAction("Play");
    if (playAction == null || TextUtils.isEmpty(path)) {
        return false;
    }
    action.setArgumentValue("InstanceID", 0);
    action.setArgumentValue(AVTransport.CURRENTURI, path);
    action.setArgumentValue(AVTransport.CURRENTURIMETADATA, 0);
    if (!action.postControlAction()) {
        return false;
    }
    playAction.setArgumentValue("InstanceID", 0);
    playAction.setArgumentValue(AVTransport.SPEED, "1");
    return playAction.postControlAction();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:27,代码来源:MultiPointController.java

示例8: goon

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public boolean goon(Device device, String pausePosition) {
    if (device == null) {
        return false;
    }
    Service localService = device.getService("urn:schemas-upnp-org:service:AVTransport:1");
    if (localService == null) {
        return false;
    }
    Action localAction = localService.getAction(AVTransport.SEEK);
    if (localAction == null) {
        return false;
    }
    localAction.setArgumentValue("InstanceID", "0");
    localAction.setArgumentValue(AVTransport.UNIT, "ABS_TIME");
    localAction.setArgumentValue(AVTransport.TARGET, pausePosition);
    localAction.postControlAction();
    Action playAction = localService.getAction("Play");
    if (playAction == null) {
        return false;
    }
    playAction.setArgumentValue("InstanceID", 0);
    playAction.setArgumentValue(AVTransport.SPEED, "1");
    return playAction.postControlAction();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:25,代码来源:MultiPointController.java

示例9: getVolumeDbRange

import org.cybergarage.upnp.Device; //导入依赖的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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:20,代码来源:MultiPointController.java

示例10: getMediaDuration

import org.cybergarage.upnp.Device; //导入依赖的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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:19,代码来源:MultiPointController.java

示例11: setMute

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public boolean setMute(Device mediaRenderDevice, String targetValue) {
    if (mediaRenderDevice == null) {
        return false;
    }
    Service service = mediaRenderDevice.getService("urn:schemas-upnp-org:service:RenderingControl:1");
    if (service == null) {
        return false;
    }
    Action action = service.getAction(RenderingControl.SETMUTE);
    if (action == null) {
        return false;
    }
    action.setArgumentValue("InstanceID", "0");
    action.setArgumentValue(RenderingControl.CHANNEL, RenderingControl.MASTER);
    action.setArgumentValue(RenderingControl.DESIREDMUTE, targetValue);
    return action.postControlAction();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:MultiPointController.java

示例12: setVoice

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public boolean setVoice(Device device, int value) {
    if (device == null) {
        return false;
    }
    Service service = device.getService("urn:schemas-upnp-org:service:RenderingControl:1");
    if (service == null) {
        return false;
    }
    Action action = service.getAction(RenderingControl.SETVOLUME);
    if (action == null) {
        return false;
    }
    action.setArgumentValue("InstanceID", "0");
    action.setArgumentValue(RenderingControl.CHANNEL, RenderingControl.MASTER);
    action.setArgumentValue(RenderingControl.DESIREDVOLUME, value);
    return action.postControlAction();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:MultiPointController.java

示例13: getVoice

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public int getVoice(Device device) {
    if (device == null) {
        return 0;
    }
    Service service = device.getService("urn:schemas-upnp-org:service:RenderingControl:1");
    if (service == null) {
        return -1;
    }
    Action getAction = service.getAction(RenderingControl.GETVOLUME);
    if (getAction == null) {
        return -1;
    }
    getAction.setArgumentValue("InstanceID", "0");
    getAction.setArgumentValue(RenderingControl.CHANNEL, RenderingControl.MASTER);
    if (getAction.postControlAction()) {
        return getAction.getArgumentIntegerValue(RenderingControl.CURRENTVOLUME);
    }
    return -1;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:20,代码来源:MultiPointController.java

示例14: removeDevice

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public synchronized void removeDevice(Device d) {
	if (!DLNAUtil.isMediaRenderDevice(d)) {
		return;
	}
	int size = mDevices.size();
	for (int i = 0; i < size; i++) {
		String udnString = mDevices.get(i).getUDN();
		if (d.getUDN().equalsIgnoreCase(udnString)) {
			Device device = mDevices.remove(i);
			LogUtil.d(TAG, "Devices remove a device");

			boolean ret = false;
			if (mSelectedDevice != null) {
				ret = mSelectedDevice.getUDN().equalsIgnoreCase(
						device.getUDN());
			}
			if (ret) {
				mSelectedDevice = null;
			}
			if (mDeviceChangeListener != null) {
				mDeviceChangeListener.onDeviceChange(d);
			}
			break;
		}
	}
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:27,代码来源:DLNAContainer.java

示例15: removeDevice

import org.cybergarage.upnp.Device; //导入依赖的package包/类
public synchronized void removeDevice(Device d) {
    if (DLNAUtil.isMediaRenderDevice(d)) {
        int size = this.mDevices.size();
        int i = 0;
        while (i < size) {
            if (d.getUDN().equalsIgnoreCase(((Device) this.mDevices.get(i)).getUDN())) {
                Device device = (Device) this.mDevices.remove(i);
                if (device != null) {
                    LogInfo.log("dlna", "删除设备:" + device.getDeviceType());
                }
                boolean ret = false;
                if (this.mSelectedDevice != null) {
                    ret = this.mSelectedDevice.getUDN().equalsIgnoreCase(device.getUDN());
                }
                if (ret) {
                    this.mSelectedDevice = null;
                }
                if (this.mDeviceChangeListener != null) {
                    this.mDeviceChangeListener.onDeviceChange(d);
                }
            } else {
                i++;
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:27,代码来源:DLNAContainer.java


注:本文中的org.cybergarage.upnp.Device类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。