本文整理汇总了Java中org.fourthline.cling.support.model.Res.getBitsPerSample方法的典型用法代码示例。如果您正苦于以下问题:Java Res.getBitsPerSample方法的具体用法?Java Res.getBitsPerSample怎么用?Java Res.getBitsPerSample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fourthline.cling.support.model.Res
的用法示例。
在下文中一共展示了Res.getBitsPerSample方法的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());
}
示例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());
}