Package org.farng.mp3.lyrics3

Examples of org.farng.mp3.lyrics3.FieldBodyUnsupported


        modeExtension = copyObject.modeExtension;
        mpegVersion = copyObject.mpegVersion;
        frequency = copyObject.frequency;
        bitRate = copyObject.bitRate;
        mp3file = new File(copyObject.mp3file.getAbsolutePath());
        filenameTag = new FilenameTag(copyObject.filenameTag);
        id3v2tag = (AbstractID3v2) TagUtility.copyObject(copyObject.id3v2tag);
        lyrics3tag = (AbstractLyrics3) TagUtility.copyObject(copyObject.lyrics3tag);
        id3v1tag = (ID3v1) TagUtility.copyObject(copyObject.id3v1tag);
    }
View Full Code Here


     */
    public void testGetFrameAcrossTags() {
        MP3File mp3file = this.testMusicArray[0];
        AbstractID3v2 id3v2 = mp3file.getID3v2Tag();
        ID3v1 id3v1 = mp3file.getID3v1Tag();
        AbstractLyrics3 lyrics3 = mp3file.getLyrics3Tag();
        FilenameTag filename = mp3file.getFilenameTag();
        AbstractID3v2Frame frame = id3v2.getFrame("TIT2");
        assertEquals(2, mp3file.getFrameAcrossTags("TIT2").size());
        assertNull(lyrics3);
        assertTrue(filename != null);
View Full Code Here

        frame = new ID3v2_4Frame(frameBody);
        id3v2.setFrame(frame);

        // setup lyrics3v2
        Lyrics3v2Field field;
        AbstractLyrics3v2FieldBody fieldBody;
        fieldBody = new FieldBodyEAL(albumTitle);
        field = new Lyrics3v2Field(fieldBody);
        lyrics3.setField(field);

        // setup filename tag
View Full Code Here

        id3v2.setFrame(frame);

        // setup lyrics3v2
        Lyrics3v2Field field;
        AbstractLyrics3v2FieldBody fieldBody;
        fieldBody = new FieldBodyEAL(albumTitle);
        field = new Lyrics3v2Field(fieldBody);
        lyrics3.setField(field);

        // setup filename tag
        frameBody = new FrameBodyTALB((byte) 0, albumTitle);
View Full Code Here

        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());
View Full Code Here

        assertEquals(0, mp3.getUnsynchronizedFragments().size());
        id3v1.setTitle("different");
        assertEquals(1, mp3.getUnsynchronizedFragments().size());
        id3v1.setTitle("<song title>");
        assertEquals(0, mp3.getUnsynchronizedFragments().size());
        lyrics3.setField(new Lyrics3v2Field(new FieldBodyETT("different")));
        assertEquals(1, mp3.getUnsynchronizedFragments().size());
        lyrics3.setField(new Lyrics3v2Field(new FieldBodyETT("<song title>")));
        assertEquals(0, mp3.getUnsynchronizedFragments().size());
        body = new FrameBodyTIT2((byte) 0, "different");
        frame = new ID3v2_4Frame(body);
        id3v2.setFrame(frame);
        assertEquals(1, mp3.getUnsynchronizedFragments().size());
View Full Code Here

        final String id = field.getIdentifier();
        final String value;
        if (id.equals("IND")) {
            throw new InvalidTagException("Cannot create ID3v2.40 frame from Lyrics3 indications field.");
        } else if (id.equals("LYR")) {
            final FieldBodyLYR lyric = (FieldBodyLYR) field.getBody();
            ObjectLyrics3Line line;
            final Iterator iterator = lyric.iterator();
            final FrameBodySYLT sync;
            final FrameBodyUSLT unsync;
            final boolean hasTimeStamp = lyric.hasTimeStamp();

            // we'll create only one frame here.
            // if there is any timestamp at all, we will create a sync'ed frame.
            sync = new FrameBodySYLT((byte) 0, "ENG", (byte) 2, (byte) 1, "");
            unsync = new FrameBodyUSLT((byte) 0, "ENG", "", "");
View Full Code Here

        ID3v1_1 copyTag = new ID3v1_1(tag);
        assertEquals(copyTag, tag);
    }

    public void testLyrics3v1() {
        Lyrics3v1 tag = new Lyrics3v1();
        try {
            tag.getSongTitle();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.getLeadArtist();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.getAlbumTitle();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.getYearReleased();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.getSongComment();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.getSongGenre();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.getTrackNumberOnAlbum();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        assertEquals("", tag.getSongLyric());
        try {
            tag.getAuthorComposer();
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        tag = new Lyrics3v1();
        try {
            tag.setSongTitle(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.setLeadArtist(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.setAlbumTitle(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.setYearReleased(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.setSongComment(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.setSongGenre(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        try {
            tag.setTrackNumberOnAlbum(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        tag.setSongLyric(songLyric);
        try {
            tag.setAuthorComposer(null);
            fail("Did not throw UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
        }
        assertEquals(songLyric, tag.getSongLyric());

        // run again because it's a different case
        tag.setSongLyric(songLyric);
        assertEquals(songLyric, tag.getSongLyric());
        ID3v2_4 convertTag = new ID3v2_4(tag);
        Lyrics3v1 newTag = new Lyrics3v1(convertTag);
        assertEquals(tag, newTag);
        assertEquals(newTag.getSongLyric(), tag.getSongLyric());
        Lyrics3v1 copyTag = new Lyrics3v1(tag);
        assertEquals(copyTag, tag);
    }
View Full Code Here

        } catch (TagNotFoundException ex) {
            // maybe a different version
        }
        try {
            if (lyrics3tag == null) {
                lyrics3tag = new Lyrics3v1(newFile);
            }
        } catch (TagNotFoundException ex) {
            //it's ok to be null
        }
        newFile.close();
View Full Code Here

        AbstractID3v2Frame frame = id3v2.getFrame("TIT2");
        assertEquals(2, mp3file.getFrameAcrossTags("TIT2").size());
        assertNull(lyrics3);
        assertTrue(filename != null);
        assertFalse(filename.hasFrame("TIT2"));
        lyrics3 = new Lyrics3v2();
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
        } catch (TagException ex) {
            fail(ex.getMessage());
        }
        mp3file.setLyrics3Tag(lyrics3);
        assertEquals(3, mp3file.getFrameAcrossTags("TIT2").size());
        filename.setFrame(frame);
        assertEquals(4, mp3file.getFrameAcrossTags("TIT2").size());
        mp3file.setFilenameTag(null);
        assertEquals(3, mp3file.getFrameAcrossTags("TIT2").size());
        mp3file.setID3v2Tag(null);
        assertEquals(2, mp3file.getFrameAcrossTags("TIT2").size());
        mp3file.setID3v1Tag(null);
        assertEquals(1, mp3file.getFrameAcrossTags("TIT2").size());
        mp3file.setLyrics3Tag(null);
        assertEquals(0, mp3file.getFrameAcrossTags("TIT2").size());

        // test nulls
        assertNull(mp3file.getFrameAcrossTags(null));
        assertNull(mp3file.getFrameAcrossTags(""));

        // test all different fields
        List frameList;
        final String testString = "Test String";
        mp3file = new MP3File();
        frame = new ID3v2_4Frame(new FrameBodyTIT2((byte) 0, testString));
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        id3v1.setTitle(testString);
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
        } catch (TagException ex) {
            fail("This should not happen. " + ex.getMessage());
        }
        filename.setFrame(frame);

        // different nulls
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(0, frameList.size());
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(1, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(1, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(1, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(1, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(2, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(2, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(2, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(2, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(2, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(2, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(null);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(null);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(null);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }
        mp3file = new MP3File();
        mp3file.setID3v1Tag(null);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // TEST each frame
        // TIT1
        mp3file = new MP3File();
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TIT2");
        assertEquals(4, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // TPE1
        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) {
            fail("This should not happen. " + ex.getMessage());
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TPE1");
        assertEquals(4, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // TALB
        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyTALB((byte) 0, testString));
        id3v1.setAlbum(testString);
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
        } catch (TagException ex) {
            fail("This should not happen. " + ex.getMessage());
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TALB");
        assertEquals(4, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // TDRC
        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyTDRC((byte) 0, "1992"));
        id3v1.setYear("1992");
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
            fail("Somehow created a TDRC (year) Lyrics3v2 Field");
        } catch (TagException ex) {
            // correct behavior
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TDRC");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // COMM
        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyCOMM((byte) 0, "ENG", "", testString));
        id3v1.setComment(testString);
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
        } catch (TagException ex) {
            fail("This should not happen. " + ex.getMessage());
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("COMM");
        assertEquals(4, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // TCON
        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyTCON((byte) 0, "(42) Soul"));
        id3v1.setGenre((byte) 42);
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
            fail("Somehow created a TCON (genre) Lyrics3v2 Field");
        } catch (TagException ex) {
            // correct behavior
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TCON");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // TRCK
        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");
        } catch (TagException ex) {
            // correct behavior
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("TRCK");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // SYLT
        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodySYLT((byte) 0, "ENG", (byte) 0, (byte) 0, "description"));
        ((FrameBodySYLT) frame.getBody()).addLyric(0, testString);
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
        } catch (TagException ex) {
            fail("This should not happen. " + ex.getMessage());
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("SYLT");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // USLT
        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyUSLT((byte) 0, "ENG", "", testString));
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
        } catch (TagException ex) {
            fail("This should not happen. " + ex.getMessage());
        }
        filename.setFrame(frame);
        mp3file.setID3v1Tag(id3v1);
        mp3file.setID3v2Tag(id3v2);
        mp3file.setLyrics3Tag(lyrics3);
        mp3file.setFilenameTag(filename);
        frameList = mp3file.getFrameAcrossTags("USLT");
        assertEquals(3, frameList.size());
        for (int i = 0; i < frameList.size(); i++) {
            assertEquals(frame, frameList.get(i));
        }

        // TCOM
        mp3file = new MP3File();
        id3v1 = new ID3v1_1();
        id3v2 = new ID3v2_4();
        lyrics3 = new Lyrics3v2();
        filename = FilenameTagBuilder.createEmptyFilenameTag();
        frame = new ID3v2_4Frame(new FrameBodyTCOM((byte) 0, testString));
        id3v2.setFrame(frame);
        try {
            ((Lyrics3v2) lyrics3).setField(new Lyrics3v2Field(frame));
View Full Code Here

TOP

Related Classes of org.farng.mp3.lyrics3.FieldBodyUnsupported

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.