Package net.sf.jmp3renamer.datamanager

Examples of net.sf.jmp3renamer.datamanager.DataSet


      if (DoubleFinder.getProperty("use_md5").equals("true")) {
        String md5 = MD5.calculate(element);
        dataset.setMd5sum(md5);
      }
      if (DoubleFinder.getProperty("use_tag").equals("true")) {
        DataSet tag = FileManager.getInstance().getMetaData(element);
        if(tag != null) {
            dataset.setTag(tag);
        }
      }
     
View Full Code Here


     * @param regex
     *            Your magic cookie regex
     * @return a preview according to your regex
     */
    public static String createPreview(String regex) {
        DataSet dataset = new DataSet();
        dataset.setTitle("Title");
        dataset.setArtist("Artist");
        dataset.setAlbum("Album");
        dataset.setComment("Comment");
        dataset.setComposer("Composer");
        dataset.setCopyright("Copyright");
        dataset.setEncodedBy("Encoder");
        dataset.setGenre("Genre");
        dataset.setOrigArtist("Orig. Artist");
        dataset.setTrack("01");
        dataset.setUrl("http://sf.net/projects/jmp3renamer");
        dataset.setYear("2004");
        dataset.setPartOfSet("1");

        dataset.setRegex(regex);
        return evaluateDataSet(dataset);
    }
View Full Code Here

        mc.setValue(m.group(i));
      }
    }
       
    // create a dataset from the extracted data
        DataSet dataset = new DataSet();
        for (MagicCookie mc : cookies) {
      if(mc.getCookie().equals(COOKIE_ARTIST)) {
        dataset.setArtist(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_ARTIST_FC)) {
        dataset.setArtist(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_TRACK)) {
        dataset.setTrack(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_TITLE)) {
        dataset.setTitle(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_ALBUM)) {
        dataset.setAlbum(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_GENRE)) {
        dataset.setGenre(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_YEAR)) {
        dataset.setYear(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_ORIG_ARTIST)) {
        dataset.setOrigArtist(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_COPYRIGHT)) {
        dataset.setCopyright(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_COMPOSER)) {
        dataset.setComposer(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_ENCODED_BY)) {
        dataset.setEncodedBy(mc.getValue());
      } else if(mc.getCookie().equals(COOKIE_DISC_NO)) {
        dataset.setPartOfSet(mc.getValue());
      }
    }
        return dataset;
    }
View Full Code Here

            logger.error(I18N.translate("error.save_settings"), e);
        }
    }

    public DataSet getMetaData(File file) {
        DataSet dataset = new DataSet();
        try {
            AudioFile af = AudioFileIO.read(file);
            Tag tag = af.getTag();
            dataset.setAlbum(tag.getFirstAlbum());
            dataset.setArtist(tag.getFirstArtist());
            dataset.setTitle(tag.getFirstTitle());
            dataset.setComment(tag.getFirstComment());
            dataset.setTrack(tag.getFirstTrack());
            dataset.setYear(tag.getFirstYear());
            dataset.setGenre(tag.getFirstGenre());
        } catch (CannotReadException e) {
            logger.error(I18N.translate("error.load_metadata"), e);
        }
        return dataset;
    }
View Full Code Here

            logger.error(I18N.translate("error.save_settings"), e);
        }
    }

    public DataSet getMetaData(File file) {
        DataSet dataset = null;
        try {
            if (new Boolean(Mp3.getProperty("readV1")).booleanValue()) {
                dataset = readV1(dataset, file);
            }
            if (new Boolean(Mp3.getProperty("readV2")).booleanValue()) {
View Full Code Here

        return dataset;
    }

    private DataSet readV1(DataSet dataset, File file) {
        if (dataset == null) {
            dataset = new DataSet();
        }
        RandomAccessFile raf = null;
        try {
            raf = new RandomAccessFile(file, "r");
            Id3v1Tag tag = new Id3v1TagReader().read(raf);
View Full Code Here

        return null;
    }

    private DataSet readV2(DataSet dataset, File file) {
        if (dataset == null) {
            dataset = new DataSet();
        }

        RandomAccessFile raf = null;
        try {
            raf = new RandomAccessFile(file, "r");
View Full Code Here

            }
        }
    }
   
    private void moveRow(List<DataSet> datasets, int row, int to) {
        DataSet temp = datasets.get(to);
        datasets.set(to, datasets.get(row));

        if (row > to) {
            for (int i = row - 1; i > to; i--) {
                datasets.set(i + 1, datasets.get(i));
View Full Code Here

    private void setDatasets(final Vector<DataSet> datasets) {
        DefaultTableModel model = (DefaultTableModel) dbtable.getModel();
        model.setRowCount(0);
        Enumeration<DataSet> enumeration = datasets.elements();
        while (enumeration.hasMoreElements()) {
            DataSet dataset = enumeration.nextElement();
            Vector<DataSet> row = new Vector<DataSet>();
            row.addElement(dataset);
            model.addRow(row);
        }
    }
View Full Code Here

        }
    }

    private void addRow() {
        DefaultTableModel model = (DefaultTableModel) dbtable.getModel();
        DataSet dataset = new DataSet();
        if(dbtable.getRowCount() > 0) {
            DataSet row0 = (DataSet)model.getValueAt(0,0);
            dataset.setAlbum(row0.getAlbum());
            dataset.setArtist(row0.getArtist());
            dataset.setComment(row0.getComment());
            dataset.setComposer(row0.getComposer());
            dataset.setCopyright(row0.getCopyright());
            dataset.setEncodedBy(row0.getEncodedBy());
            dataset.setGenre(row0.getGenre());
            dataset.setUrl(row0.getUrl());
            dataset.setYear(row0.getYear());
        }
        DataManager.getInstance().addRow(dataset);
    }
View Full Code Here

TOP

Related Classes of net.sf.jmp3renamer.datamanager.DataSet

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.