本文整理汇总了Java中org.fourthline.cling.support.model.container.MusicArtist类的典型用法代码示例。如果您正苦于以下问题:Java MusicArtist类的具体用法?Java MusicArtist怎么用?Java MusicArtist使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MusicArtist类属于org.fourthline.cling.support.model.container包,在下文中一共展示了MusicArtist类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContainer
import org.fourthline.cling.support.model.container.MusicArtist; //导入依赖的package包/类
public Container createContainer(Artist artist) {
MusicArtist container = new MusicArtist();
container.setId(getRootId() + DispatchingContentDirectory.SEPARATOR + artist.getId());
container.setParentID(getRootId());
container.setTitle(artist.getName());
container.setChildCount(artist.getAlbumCount());
return container;
}
示例2: parseArtist
import org.fourthline.cling.support.model.container.MusicArtist; //导入依赖的package包/类
public static Artist parseArtist(String authority, String device,MusicArtist ma) {
final Artist.Builder artist = Artist.builder();
// mandatory fields
try {
artist.setUri(UpnpCDUris.makeUri(authority, device, ma.getId()));
artist.setParentUri(UpnpCDUris.makeUri(authority, device, ma.getParentID()));
artist.setName(ma.getTitle());
} catch (Exception e) {
e.printStackTrace();
return null;
}
return artist.build();
}
示例3: parseDidlContent
import org.fourthline.cling.support.model.container.MusicArtist; //导入依赖的package包/类
void parseDidlContent(DIDLContent didlContent, ActionInvocation actionInvocation,
Subscriber<? super Model> subscriber) {
final List<Container> containers = didlContent.getContainers();
final List<Item> items = didlContent.getItems();
final List<Model> resources = new ArrayList<>(containers.size() + items.size());
final String deviceId = rs.getDevice().getIdentity().getUdn().getIdentifierString();
for (Container c : didlContent.getContainers()) {
Model b = null;
if (MusicArtist.CLASS.equals(c)) {
b = ModelUtil.parseArtist(mAuthority, deviceId, (MusicArtist) c);
} else if (MusicAlbum.CLASS.equals(c)) {
b = ModelUtil.parseAlbum(mAuthority, deviceId, (MusicAlbum) c);
} else {
b = ModelUtil.parseFolder(mAuthority, deviceId, c);
}
if (b != null) {
subscriber.onNext(b);
}
}
for (Item item : items) {
if (MusicTrack.CLASS.equals(item)) {
MusicTrack mt = (MusicTrack) item;
Track s = ModelUtil.parseSong(mAuthority, deviceId, mt);
if (s != null) {
subscriber.onNext(s);
}
}
}
//TODO handle pagination
UnsignedIntegerFourBytes numRet = (UnsignedIntegerFourBytes)
actionInvocation.getOutput("NumberReturned").getValue();
UnsignedIntegerFourBytes total = (UnsignedIntegerFourBytes)
actionInvocation.getOutput("TotalMatches").getValue();
// server was unable to compute total matches
if (numRet.getValue() != 0 && total.getValue() == 0) {
if (containers.size() != 0 && items.size() != 0) {
//TODO
}
} else if (numRet.getValue() == 0 && total.getValue() == 720) {
// no results, total should return an error
}
if (!subscriber.isUnsubscribed()) {
subscriber.onCompleted();
}
}