当前位置: 首页>>代码示例>>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;未经允许,请勿转载。