本文整理汇总了Java中com.mpatric.mp3agic.AbstractID3v2Tag类的典型用法代码示例。如果您正苦于以下问题:Java AbstractID3v2Tag类的具体用法?Java AbstractID3v2Tag怎么用?Java AbstractID3v2Tag使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractID3v2Tag类属于com.mpatric.mp3agic包,在下文中一共展示了AbstractID3v2Tag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getId3ByFile
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
public static AbstractID3v2Tag getId3ByFile(String path) throws IOException, UnsupportedTagException, InvalidDataException, NoSuchTagException {
InputStream in = FileSystemStorage.getInstance().openInputStream(path);
// Get the size of the ID3 header and load only that into memory
TagHeader tagHeader = TagHeaderFactory.makeHeader(in);
int dataSize = (int) tagHeader.getDataSize();
byte[] data = new byte[dataSize];
in = FileSystemStorage.getInstance().openInputStream(path);
int read = in.read(data);
if (read != dataSize)
throw new IOException("Expected " + dataSize + " bytes.");
// Use the 2nd library to parse the ID3 tag.
return ID3v2TagFactory.createTag(data);
}
示例2: setTitle
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setTitle(String title) {
changed = true;
if (title == null || title.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_TITLE);
else
this.mp3.getId3v2Tag().setTitle(title);
if (this.addId3v1Tag)
this.mp3.getId3v1Tag().setTitle(title);
}
示例3: setArtist
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setArtist(String artist) {
changed = true;
if (artist == null || artist.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_ARTIST);
else
this.mp3.getId3v2Tag().setArtist(artist);
if (this.addId3v1Tag)
this.mp3.getId3v1Tag().setArtist(artist);
}
示例4: setAlbumArtist
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setAlbumArtist(String artist) {
changed = true;
if (artist == null || artist.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_ALBUM_ARTIST);
else
this.mp3.getId3v2Tag().setAlbumArtist(artist);
}
示例5: setAlbum
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setAlbum(String album) {
changed = true;
if (album == null || album.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_ALBUM);
else
this.mp3.getId3v2Tag().setAlbum(album);
if (this.addId3v1Tag)
this.mp3.getId3v1Tag().setAlbum(album);
}
示例6: setYear
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setYear(String year) {
changed = true;
if (year == null || year.length() == 0)
{
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_YEAR);
this.mp3.getId3v2Tag().clearFrameSet(ID3v24Tag.ID_YEAR);
}
else
this.mp3.getId3v2Tag().setYear(year);
if (this.addId3v1Tag)
this.mp3.getId3v1Tag().setYear(year);
}
示例7: setTrack
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setTrack(String track) {
changed = true;
if (track == null || track.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_TRACK);
else
this.mp3.getId3v2Tag().setTrack(track);
if (this.addId3v1Tag)
this.mp3.getId3v1Tag().setTrack(track);
}
示例8: setComment
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setComment(String comment) {
changed = true;
if (comment == null || comment.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_COMMENT);
else
this.mp3.getId3v2Tag().setComment(comment);
if (this.addId3v1Tag)
this.mp3.getId3v1Tag().setComment(comment);
}
示例9: setComposer
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setComposer(String composer) {
changed = true;
if (composer == null || composer.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_COMPOSER);
else
this.mp3.getId3v2Tag().setComposer(composer);
}
示例10: setPublisher
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setPublisher(String publisher) {
changed = true;
if (publisher == null || publisher.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_PUBLISHER);
else
this.mp3.getId3v2Tag().setPublisher(publisher);
}
示例11: setOriginalArtist
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setOriginalArtist(String artist) {
changed = true;
if (artist == null || artist.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_ORIGINAL_ARTIST);
else
this.mp3.getId3v2Tag().setOriginalArtist(artist);
}
示例12: setCopyright
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setCopyright(String copyright) {
changed = true;
if (copyright == null || copyright.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_COPYRIGHT);
else
this.mp3.getId3v2Tag().setCopyright(copyright);
}
示例13: setURL
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setURL(String url) {
changed = true;
if (url == null || url.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_URL);
else
this.mp3.getId3v2Tag().setUrl(url);
}
示例14: setEncoder
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setEncoder(String encoder) {
changed = true;
if (encoder == null || encoder.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_ENCODER);
else
this.mp3.getId3v2Tag().setEncoder(encoder);
}
示例15: setImage
import com.mpatric.mp3agic.AbstractID3v2Tag; //导入依赖的package包/类
@Override
public void setImage(String filepath) throws IOException {
changed = true;
if (filepath == null || filepath.length() == 0)
this.mp3.getId3v2Tag().clearFrameSet(AbstractID3v2Tag.ID_IMAGE);
else {
String mime = "image/" + FileUtil.getFileExtension(filepath);
this.mp3.getId3v2Tag().setAlbumImage(FileUtil.readFileInBytes(filepath), mime);
}
}