本文整理汇总了Java中org.fourthline.cling.support.model.item.MusicTrack.setArtists方法的典型用法代码示例。如果您正苦于以下问题:Java MusicTrack.setArtists方法的具体用法?Java MusicTrack.setArtists怎么用?Java MusicTrack.setArtists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fourthline.cling.support.model.item.MusicTrack
的用法示例。
在下文中一共展示了MusicTrack.setArtists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}