当前位置: 首页>>代码示例>>Java>>正文


Java MusicTrack.setAlbum方法代码示例

本文整理汇总了Java中org.fourthline.cling.support.model.item.MusicTrack.setAlbum方法的典型用法代码示例。如果您正苦于以下问题:Java MusicTrack.setAlbum方法的具体用法?Java MusicTrack.setAlbum怎么用?Java MusicTrack.setAlbum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.fourthline.cling.support.model.item.MusicTrack的用法示例。


在下文中一共展示了MusicTrack.setAlbum方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createItem

import org.fourthline.cling.support.model.item.MusicTrack; //导入方法依赖的package包/类
public Item createItem(MediaFile song) throws Exception {
    MediaFile parent = mediaFileService.getParentOf(song);
    MusicTrack item = new MusicTrack();
    item.setId(String.valueOf(song.getId()));
    item.setParentID(String.valueOf(parent.getId()));
    item.setTitle(song.getTitle());
    item.setAlbum(song.getAlbumName());
    if (song.getArtist() != null) {
        item.setArtists(new PersonWithRole[]{new PersonWithRole(song.getArtist())});
    }
    Integer year = song.getYear();
    if (year != null) {
        item.setDate(year + "-01-01");
    }
    item.setOriginalTrackNumber(song.getTrackNumber());
    if (song.getGenre() != null) {
        item.setGenres(new String[]{song.getGenre()});
    }
    item.setResources(Arrays.asList(createResourceForSong(song)));
    item.setDescription(song.getComment());
    item.addProperty(new DIDLObject.Property.UPNP.ALBUM_ART_URI(getAlbumArtUrl(parent.getId())));

    return item;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:25,代码来源:DispatchingContentDirectory.java

示例2: createItem

import org.fourthline.cling.support.model.item.MusicTrack; //导入方法依赖的package包/类
public Item createItem(MediaFile song) throws Exception {
    MediaFile parent = getMediaFileService().getParentOf(song);
    MusicTrack item = new MusicTrack();
    item.setId(String.valueOf(song.getId()));
    item.setParentID(String.valueOf(parent.getId()));
    item.setTitle(song.getTitle());
    item.setAlbum(song.getAlbumName());
    if (song.getArtist() != null) {
        item.setArtists(getDispatcher().getAlbumProcessor().getAlbumArtists(song.getArtist()));
    }
    Integer year = song.getYear();
    if (year != null) {
        item.setDate(year + "-01-01");
    }
    item.setOriginalTrackNumber(song.getTrackNumber());
    if (song.getGenre() != null) {
        item.setGenres(new String[]{song.getGenre()});
    }
    item.setResources(Arrays.asList(getDispatcher().createResourceForSong(song)));
    item.setDescription(song.getComment());
    item.addProperty(new DIDLObject.Property.UPNP.ALBUM_ART_URI(getDispatcher().getAlbumProcessor().getAlbumArtURI(parent.getId())));

    return item;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:25,代码来源:MediaFileUpnpProcessor.java

示例3: createItem

import org.fourthline.cling.support.model.item.MusicTrack; //导入方法依赖的package包/类
private Item createItem(MediaFile song) throws Exception {
    MediaFile parent = mediaFileService.getParentOf(song);
    MusicTrack item = new MusicTrack();
    item.setId(String.valueOf(song.getId()));
    item.setParentID(String.valueOf(parent.getId()));
    item.setTitle(song.getTitle());
    item.setAlbum(song.getAlbumName());
    if (song.getArtist() != null) {
        item.setArtists(new PersonWithRole[]{new PersonWithRole(song.getArtist())});
    }
    Integer year = song.getYear();
    if (year != null) {
        item.setDate(year + "-01-01");
    }
    item.setOriginalTrackNumber(song.getTrackNumber());
    if (song.getGenre() != null) {
        item.setGenres(new String[]{song.getGenre()});
    }
    item.setResources(Arrays.asList(createResourceForSong(song)));
    item.setDescription(song.getComment());
    item.addProperty(new DIDLObject.Property.UPNP.ALBUM_ART_URI(getAlbumArtUrl(parent)));

    return item;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:25,代码来源:FolderBasedContentDirectory.java

示例4: addMusicTracks

import org.fourthline.cling.support.model.item.MusicTrack; //导入方法依赖的package包/类
public void addMusicTracks(MusicTrack[] musicTracks) {
    if (musicTracks != null) {
        for (MusicTrack musicTrack : musicTracks) {
            musicTrack.setAlbum(getTitle());
            addItem(musicTrack);
        }
    }
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:9,代码来源:MusicAlbum.java


注:本文中的org.fourthline.cling.support.model.item.MusicTrack.setAlbum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。