Package org.farng.mp3.id3

Examples of org.farng.mp3.id3.AbstractID3


        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

    }

    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

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

        ((FrameBodySYLT) mp3file.getFilenameTag().getFrame("SYLT").getBody()).getLyric().equals(testString);
        mp3file.setID3v1Tag(new ID3v1_1());
        mp3file.setID3v2Tag(new ID3v2_4());
        mp3file.setLyrics3Tag(new Lyrics3v2());
        mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
        frameBody = new FrameBodyUSLT();
        ((FrameBodyUSLT) frameBody).setLyric(testString);
        frame.setBody(frameBody);
        mp3file.setFrameAcrossTags(frame);
        assertEquals(0, (new ID3v2_4(mp3file.getID3v1Tag())).getFrameCount());
        ((FrameBodyUSLT) ((ID3v2_4Frame) mp3file.getID3v2Tag().getFrameOfType("USLT").next()).getBody()).getLyric()
View Full Code Here

            text = body.getLyric();
        }
        if (text == null) {
            frame = getFrame("USLT");
            if (frame != null) {
                FrameBodyUSLT body = (FrameBodyUSLT) frame.getBody();
                text = body.getLyric();
            }
        }
        return text.trim();
    }
View Full Code Here

    }

    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

        setUp();
        File testFile = this.testMusicArray[0].getMp3file();
        MP3File mp3file = this.testMusicArray[0];
        ID3v2_4 tag = null;
        ID3v2_4Frame wcopFrame = null;
        FrameBodyWCOP wcopFrameBody = null;
        tag = new ID3v2_4(mp3file.getID3v2Tag());
        System.err.println("The tag is: " + tag);
        wcopFrame = new ID3v2_4Frame(tag.getFrame("WCOP"));
        wcopFrameBody = new FrameBodyWCOP("http://creativecommons.org");
        wcopFrameBody.setUrlLink("http://creativecommons.org");
        wcopFrame.setBody(wcopFrameBody);
        System.err.println("The wcop frame is: " + wcopFrame.toString());
        tag.setFrame(wcopFrame);
        mp3file.setID3v2Tag(tag);
        System.err.println("The WCOP frame contains: " + ((FrameBodyWCOP) wcopFrame.getBody()).getUrlLink());
        mp3file.save(testFile.toString(), TagConstant.MP3_FILE_SAVE_OVERWRITE);
        mp3file.save();
        mp3file = new MP3File(testFile);
        tag = new ID3v2_4(mp3file.getID3v2Tag());
        System.err.println("The tag is: " + tag);

        // run again
        wcopFrame = new ID3v2_4Frame(tag.getFrame("WCOP"));
        wcopFrameBody = new FrameBodyWCOP("http://creativecommons.org");
        wcopFrameBody.setUrlLink("http://creativecommons.org");
        wcopFrame.setBody(wcopFrameBody);
        System.err.println("The wcop frame is: " + wcopFrame.toString());
        tag.setFrame(wcopFrame);
        mp3file.setID3v2Tag(tag);
        System.err.println("The WCOP frame contains: " + ((FrameBodyWCOP) wcopFrame.getBody()).getUrlLink());
View Full Code Here

        }
    }

    private void precisaCriar() {
        //  if (mp3File.hasID3v1Tag()) {
        ID3v1 id = new ID3v1();
        id.setSongTitle(jTextField_Titulo.getText());
        id.setAlbumTitle(jTextField_Album.getText());
        id.setLeadArtist(jTextField_Interp.getText());
//         id.setSongGenre((String)(jComboBoxGenero.getSelectedItem()));
        id.setYearReleased(jTextField_ano.getText());
        id.setSongComment(jTextField_Comentario.getText());
        mp3File.setID3v1Tag(id);
        alterarMusica();
        try {
            mp3File.save(TagConstant.MP3_FILE_SAVE_APPEND);
            // }
View Full Code Here

TOP

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

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.