Package org.farng.mp3.id3

Examples of org.farng.mp3.id3.ID3v1


    }

    public void setSongTitle(String songTitle) {
        AbstractID3v2Frame field = getFrame("TIT2");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyTIT2((byte) 0, songTitle.trim()));
            setFrame(field);
        } else {
            ((FrameBodyTIT2) field.getBody()).setText(songTitle.trim());
        }
    }
View Full Code Here


                         this.testMusicArray[i].getMp3StartByte());
        }
        MP3File mp3file = new MP3File(new File(this.testMusicDirectory, this.testMusic[1]));
        ID3v2_4 tag = new ID3v2_4();
        ID3v2_4Frame frame = new ID3v2_4Frame();
        FrameBodyTPE1 body = new FrameBodyTPE1((byte) 0, "text");

        //        // save and re-read this to set file/tag alter preservation tags to
        // correct
        //        // values;
        //        mp3file.save();
View Full Code Here

        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyTPE1((byte) 0, testString));
        id3v1.setArtist(testString);
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
        } catch (TagException ex) {
View Full Code Here

        assertEquals(1, mp3.getUnsynchronizedFragments().size());

        // test two differences
        id3v1.setArtist("<song artist>");
        assertEquals(1, mp3.getUnsynchronizedFragments().size());
        body = new FrameBodyTPE1((byte) 0, "different");
        frame = new ID3v2_4Frame();
        frame.setBody(body);
        filename.setFrame(frame);
        assertEquals(2, mp3.getUnsynchronizedFragments().size());
        body = new FrameBodyTPE1((byte) 0, "<song artist>");
        frame = new ID3v2_4Frame();
        frame.setBody(body);
        filename.setFrame(frame);
        assertEquals(1, mp3.getUnsynchronizedFragments().size());
        lyrics3.setField(new Lyrics3v2Field(new FieldBodyEAR("different")));
        assertEquals(2, mp3.getUnsynchronizedFragments().size());
        lyrics3.setField(new Lyrics3v2Field(new FieldBodyEAR("<song artist>")));
        assertEquals(1, mp3.getUnsynchronizedFragments().size());
        body = new FrameBodyTPE1((byte) 0, "different");
        frame = new ID3v2_4Frame(body);
        id3v2.setFrame(frame);
        assertEquals(2, mp3.getUnsynchronizedFragments().size());
        body = new FrameBodyTPE1((byte) 0, "<song artist>");
        frame = new ID3v2_4Frame(body);
        id3v2.setFrame(frame);
        assertEquals(1, mp3.getUnsynchronizedFragments().size());
        mp3.getMp3file().delete();
    }
View Full Code Here

        ((FrameBodyTIT2) mp3file.getFilenameTag().getFrame("TIT2").getBody()).getText().equals(testString);
        mp3file.setID3v1Tag(new ID3v1_1());
        mp3file.setID3v2Tag(new ID3v2_4());
        mp3file.setLyrics3Tag(new Lyrics3v2());
        mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
        frameBody = new FrameBodyTPE1();
        ((FrameBodyTPE1) frameBody).setText(testString);
        frame.setBody(frameBody);
        mp3file.setFrameAcrossTags(frame);
        mp3file.getID3v1Tag().getArtist().equals(testString);
        ((FrameBodyTPE1) mp3file.getID3v2Tag().getFrame("TPE1").getBody()).getText().equals(testString);
View Full Code Here

    public String getLeadArtist() {
        String text = null;
        AbstractID3v2Frame frame = getFrame("TPE1");
        if (frame != null) {
            FrameBodyTPE1 body = (FrameBodyTPE1) frame.getBody();
            text = body.getText();
        }
        return text.trim();
    }
View Full Code Here

    }

    public void setLeadArtist(String leadArtist) {
        AbstractID3v2Frame field = getFrame("TPE1");
        if (field == null) {
            field = new ID3v2_3Frame(new FrameBodyTPE1((byte) 0, leadArtist.trim()));
            setFrame(field);
        } else {
            ((FrameBodyTPE1) field.getBody()).setText(leadArtist.trim());
        }
    }
View Full Code Here

        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyTRCK((byte) 0, "42"));
        ((ID3v1_1) id3v1).setTrack((byte) 42);
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
            fail("Somehow created a TRCK (track) Lyrics3v2 Field");
View Full Code Here

        ((FrameBodyTCON) mp3file.getFilenameTag().getFrame("TCON").getBody()).getText().equals("42");
        mp3file.setID3v1Tag(new ID3v1_1());
        mp3file.setID3v2Tag(new ID3v2_4());
        mp3file.setLyrics3Tag(new Lyrics3v2());
        mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
        frameBody = new FrameBodyTRCK();
        ((FrameBodyTRCK) frameBody).setText("42");
        frame.setBody(frameBody);
        mp3file.setFrameAcrossTags(frame);
        assertEquals(42, ((ID3v1_1) mp3file.getID3v1Tag()).getTrack());
        ((FrameBodyTRCK) mp3file.getID3v2Tag().getFrame("TRCK").getBody()).getText().equals("42");
View Full Code Here

    public String getTrackNumberOnAlbum() {
        String text = null;
        AbstractID3v2Frame frame = getFrame("TRCK");
        if (frame != null) {
            FrameBodyTRCK body = (FrameBodyTRCK) frame.getBody();
            text = body.getText();
        }
        return text.trim();
    }
View Full Code Here

TOP

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

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.