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


Java Res.getSampleFrequency方法代码示例

本文整理汇总了Java中org.fourthline.cling.support.model.Res.getSampleFrequency方法的典型用法代码示例。如果您正苦于以下问题:Java Res.getSampleFrequency方法的具体用法?Java Res.getSampleFrequency怎么用?Java Res.getSampleFrequency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.fourthline.cling.support.model.Res的用法示例。


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

示例1: generateResource

import org.fourthline.cling.support.model.Res; //导入方法依赖的package包/类
protected void generateResource(Res resource, Document descriptor, Element parent) {

        if (resource.getValue() == null) {
            throw new RuntimeException("Missing resource URI value" + resource);
        }
        if (resource.getProtocolInfo() == null) {
            throw new RuntimeException("Missing resource protocol info: " + resource);
        }

        Element resourceElement = appendNewElement(descriptor, parent, "res", resource.getValue());
        resourceElement.setAttribute("protocolInfo", resource.getProtocolInfo().toString());
        if (resource.getImportUri() != null)
            resourceElement.setAttribute("importUri", resource.getImportUri().toString());
        if (resource.getSize() != null)
            resourceElement.setAttribute("size", resource.getSize().toString());
        if (resource.getDuration() != null)
            resourceElement.setAttribute("duration", resource.getDuration());
        if (resource.getBitrate() != null)
            resourceElement.setAttribute("bitrate", resource.getBitrate().toString());
        if (resource.getSampleFrequency() != null)
            resourceElement.setAttribute("sampleFrequency", resource.getSampleFrequency().toString());
        if (resource.getBitsPerSample() != null)
            resourceElement.setAttribute("bitsPerSample", resource.getBitsPerSample().toString());
        if (resource.getNrAudioChannels() != null)
            resourceElement.setAttribute("nrAudioChannels", resource.getNrAudioChannels().toString());
        if (resource.getColorDepth() != null)
            resourceElement.setAttribute("colorDepth", resource.getColorDepth().toString());
        if (resource.getProtection() != null)
            resourceElement.setAttribute("protection", resource.getProtection());
        if (resource.getResolution() != null)
            resourceElement.setAttribute("resolution", resource.getResolution());
    }
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:33,代码来源:DIDLParser.java

示例2: generateResource

import org.fourthline.cling.support.model.Res; //导入方法依赖的package包/类
protected void generateResource(Res resource, Document descriptor,
		Element parent) {

	if (resource.getValue() == null) {
		throw new RuntimeException("Missing resource URI value" + resource);
	}
	if (resource.getProtocolInfo() == null) {
		throw new RuntimeException("Missing resource protocol info: "
				+ resource);
	}

	Element resourceElement = appendNewElement(descriptor, parent, "res",
			resource.getValue());
	resourceElement.setAttribute("protocolInfo", resource.getProtocolInfo()
			.toString());
	if (resource.getImportUri() != null)
		resourceElement.setAttribute("importUri", resource.getImportUri()
				.toString());
	if (resource.getSize() != null)
		resourceElement.setAttribute("size", resource.getSize().toString());
	if (resource.getDuration() != null)
		resourceElement.setAttribute("duration", resource.getDuration());
	if (resource.getBitrate() != null)
		resourceElement.setAttribute("bitrate", resource.getBitrate()
				.toString());
	if (resource.getSampleFrequency() != null)
		resourceElement.setAttribute("sampleFrequency", resource
				.getSampleFrequency().toString());
	if (resource.getBitsPerSample() != null)
		resourceElement.setAttribute("bitsPerSample", resource
				.getBitsPerSample().toString());
	if (resource.getNrAudioChannels() != null)
		resourceElement.setAttribute("nrAudioChannels", resource
				.getNrAudioChannels().toString());
	if (resource.getColorDepth() != null)
		resourceElement.setAttribute("colorDepth", resource.getColorDepth()
				.toString());
	if (resource.getProtection() != null)
		resourceElement
				.setAttribute("protection", resource.getProtection());
	if (resource.getResolution() != null)
		resourceElement
				.setAttribute("resolution", resource.getResolution());
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:45,代码来源:GenerateXml.java


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