Package org.farng.mp3.id3

Examples of org.farng.mp3.id3.AbstractID3v2Frame


            ((FrameBodyTALB) field.getBody()).setText(albumTitle.trim());
        }
    }

    public void setYearReleased(String yearReleased) {
        AbstractID3v2Frame field = getFrame("TDRC");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyTDRC((byte) 0, yearReleased.trim()));
            setFrame(field);
        } else {
            ((FrameBodyTDRC) field.getBody()).setText(yearReleased.trim());
        }
    }
View Full Code Here


            ((FrameBodyTDRC) field.getBody()).setText(yearReleased.trim());
        }
    }

    public void setSongComment(String songComment) {
        AbstractID3v2Frame field = getFrame("COMM");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyCOMM((byte) 0, "ENG", "", songComment.trim()));
            setFrame(field);
        } else {
            ((FrameBodyCOMM) field.getBody()).setText(songComment.trim());
        }
    }
View Full Code Here

            ((FrameBodyCOMM) field.getBody()).setText(songComment.trim());
        }
    }

    public void setSongGenre(String songGenre) {
        AbstractID3v2Frame field = getFrame("TCON");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyTCON((byte) 0, songGenre.trim()));
            setFrame(field);
        } else {
            ((FrameBodyTCON) field.getBody()).setText(songGenre.trim());
        }
    }
View Full Code Here

            ((FrameBodyTCON) field.getBody()).setText(songGenre.trim());
        }
    }

    public void setTrackNumberOnAlbum(String trackNumberOnAlbum) {
        AbstractID3v2Frame field = getFrame("TRCK");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyTRCK((byte) 0, trackNumberOnAlbum.trim()));
            setFrame(field);
        } else {
            ((FrameBodyTRCK) field.getBody()).setText(trackNumberOnAlbum.trim());
        }
    }
View Full Code Here

            ((FrameBodyTRCK) field.getBody()).setText(trackNumberOnAlbum.trim());
        }
    }

    public void setSongLyric(String songLyrics) {
        AbstractID3v2Frame field = getFrame("SYLT");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyUSLT((byte) 0, "ENG", "", songLyrics.trim()));
            setFrame(field);
        } else {
            ((FrameBodyUSLT) field.getBody()).setLyric(songLyrics.trim());
        }
    }
View Full Code Here

            ((FrameBodyUSLT) field.getBody()).setLyric(songLyrics.trim());
        }
    }

    public void setAuthorComposer(String authorComposer) {
        AbstractID3v2Frame field = getFrame("TCOM");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyTCOM((byte) 0, authorComposer.trim()));
            setFrame(field);
        } else {
            ((FrameBodyTCOM) field.getBody()).setText(authorComposer.trim());
        }
    }
View Full Code Here

    public boolean isSubsetOf(final AbstractMP3Tag abstractMP3Tag) {
        final AbstractID3v2 subset = new ID3v2_4(this);
        final AbstractID3v2 superset = new ID3v2_4(abstractMP3Tag);
        final Iterator iterator = subset.iterator();
        while (iterator.hasNext()) {
            final AbstractID3v2Frame subsetFrame = (AbstractID3v2Frame) iterator.next();
            final String identifier = subsetFrame.getIdentifier();
            final AbstractID3v2Frame supersetFrame = superset.getFrame(identifier);
            if (supersetFrame == null) {
                return false;
            }
            if (!subsetFrame.isSubsetOf(supersetFrame)) {
                return false;
View Full Code Here

                tag = (ID3v2_4) matchTag;
            } else {
                tag = new ID3v2_4(matchTag);
            }
            final Iterator iterator = tag.iterator();
            AbstractID3v2Frame frame;
            AbstractID3v2FrameBody body;
            String matchString = null;
            final String lowerCaseToken = token.toLowerCase();
            while (iterator.hasNext()) {
                frame = (ID3v2_4Frame) iterator.next();
                body = (AbstractID3v2FrameBody) frame.getBody();
                //todo add support for more tag matches. only doing text
                //      information and URL links right now because i'm lazy
                if (body instanceof AbstractFrameBodyTextInformation) {
                    matchString = ((AbstractFrameBodyTextInformation) body).getText();
                    if (matchString != null) {
View Full Code Here

        mp3.setLyrics3Tag(lyrics3);
        mp3.setMp3file(new File(albumTitle));
        FilenameTag filename = FilenameTagBuilder.createFilenameTagFromMP3File(mp3);
        mp3.setFilenameTag(filename);
        AbstractID3v2Frame frame;
        AbstractID3v2FrameBody body;

        // test nulls;
        assertEquals(0, mp3.getUnsynchronizedFragments().size());

        // test equals
View Full Code Here

        // setup id3v1
        id3v1.setAlbum(albumTitle);

        // setup id3v2
        AbstractID3v2Frame frame;
        AbstractID3v2FrameBody frameBody;
        frameBody = new FrameBodyTALB((byte) 0, albumTitle);
        frame = new ID3v2_4Frame(frameBody);
        id3v2.setFrame(frame);

        // setup lyrics3v2
View Full Code Here

TOP

Related Classes of org.farng.mp3.id3.AbstractID3v2Frame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.