• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Service类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setAVTransportURI

import org.cybergarage.upnp.Service; //导入依赖的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


示例2: play

import org.cybergarage.upnp.Service; //导入依赖的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


示例3: play

import org.cybergarage.upnp.Service; //导入依赖的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


示例4: goon

import org.cybergarage.upnp.Service; //导入依赖的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


示例5: getTransportState

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


示例6: getVolumeDbRange

import org.cybergarage.upnp.Service; //导入依赖的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


示例7: seek

import org.cybergarage.upnp.Service; //导入依赖的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


示例8: getPositionInfo

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


示例9: getMediaDuration

import org.cybergarage.upnp.Service; //导入依赖的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


示例10: setMute

import org.cybergarage.upnp.Service; //导入依赖的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


示例11: getMute

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


示例12: setVoice

import org.cybergarage.upnp.Service; //导入依赖的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.Service; //导入依赖的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: getTransportState

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


示例15: getVolumeDbRange

import org.cybergarage.upnp.Service; //导入依赖的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);
	}
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:18,代码来源:MultiPointController.java


示例16: getPositionInfo

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


示例17: getMediaDuration

import org.cybergarage.upnp.Service; //导入依赖的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;
	}

}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:21,代码来源:MultiPointController.java


示例18: setMute

import org.cybergarage.upnp.Service; //导入依赖的package包/类
@Override
public boolean setMute(Device mediaRenderDevice, String targetValue) {
	Service service = mediaRenderDevice.getService(RenderingControl);
	if (service == null) {
		return false;
	}
	final Action action = service.getAction("SetMute");
	if (action == null) {
		return false;
	}

	action.setArgumentValue("InstanceID", "0");
	action.setArgumentValue("Channel", "Master");
	action.setArgumentValue("DesiredMute", targetValue);
	return action.postControlAction();
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:17,代码来源:MultiPointController.java


示例19: getMute

import org.cybergarage.upnp.Service; //导入依赖的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");
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:17,代码来源:MultiPointController.java


示例20: setVoice

import org.cybergarage.upnp.Service; //导入依赖的package包/类
@Override
public boolean setVoice(Device device, int value) {
	Service service = device.getService(RenderingControl);
	if (service == null) {
		return false;
	}

	final Action action = service.getAction("SetVolume");
	if (action == null) {
		return false;
	}

	action.setArgumentValue("InstanceID", "0");
	action.setArgumentValue("Channel", "Master");
	action.setArgumentValue("DesiredVolume", value);
	return action.postControlAction();

}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:19,代码来源:MultiPointController.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConnectionParameter类代码示例发布时间:2022-05-22
下一篇:
Java JPushClient类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap