本文整理匯總了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();
}
}