當前位置: 首頁>>代碼示例>>Java>>正文


Java MusicArtist類代碼示例

本文整理匯總了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;
}
 
開發者ID:airsonic,項目名稱:airsonic,代碼行數:10,代碼來源:ArtistUpnpProcessor.java

示例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();
}
 
開發者ID:OpenSilk,項目名稱:Orpheus,代碼行數:14,代碼來源:ModelUtil.java

示例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();
    }
}
 
開發者ID:OpenSilk,項目名稱:Orpheus,代碼行數:50,代碼來源:UpnpCDProvider.java


注:本文中的org.fourthline.cling.support.model.container.MusicArtist類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。