Package net.sf.jmp3renamer.datamanager

Examples of net.sf.jmp3renamer.datamanager.DataSet


        List<MyFile> files = FileManager.getInstance().getFiles();

        for (int i = 0; i < files.size(); i++) {
            MyFile file = files.get(i);
            String oldname = file.getName();
            DataSet dataset = MagicCookieBaker.evaluateCookie(regex, oldname);
            if (dataset != null) {
                datasets.add(dataset);
            }
        }
        DataManager.getInstance().setDatasets(datasets);
View Full Code Here


        List<DataSet> datasets = new LinkedList<DataSet>();
        List<MyFile> files = FileManager.getInstance().getFiles();
        int size = files.size();
        for(int i=0; i<files.size(); i++) {
            MyFile file = (MyFile)files.get(i);
            DataSet dataset = FileManager.getInstance().getMetaData(file);
            if(dataset != null) {
                dataset.setRegex(Main.getProperty("filename"));
                datasets.add(dataset);
            }
            int value = (int) (((float)(i+1)/(float)size) * 100);
            progress.setValue(value);
        }
View Full Code Here

      if(action == RowObserver.REMOVEALL) {
        DataManager.getInstance().setDatasets(new LinkedList<DataSet>());
      } else if(action == RowObserver.INSERT) {
        Main.getGUI().setCursor(new Cursor(Cursor.WAIT_CURSOR));
        MyFile file = (MyFile)o;
              DataSet dataset = FileManager.getInstance().getMetaData(file);
              if(dataset != null) {
                  dataset.setRegex(Main.getProperty("filename"));
                  DataManager.getInstance().addRow(dataset);
              }
              Main.getGUI().setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
      }
    }
View Full Code Here

                return;
            }

            Vector<DataSet> datasets = new Vector<DataSet>(count);
            for (int i = 0; i < count; i++) {
                DataSet dataset = new DataSet();
                dataset.setTrack(Integer.toString(i + 1));
                datasets.add(dataset);
            }
            DataManager.getInstance().setDatasets(datasets);
        }
    }
View Full Code Here

            JSONArray tracks = album.getJSONArray("tracks");
            for (int i = 0; i < tracks.length(); i++) {
                JSONObject track = tracks.getJSONObject(i);

                DataSet ds = new DataSet();

                // set the album title
                ds.setAlbum(a.getTitle());

                // set the artist
                ds.setArtist(track.getString("artist"));

                // set the track number
                ds.setTrack(track.getString("trackNum"));

                // set the title
                ds.setTitle(track.getString("name"));

                // release date
                ds.setYear(rdioAlbum.getYear());

                // set compilation flag
                ds.setPartOfCompilation(rdioAlbum.isCompilation());

                datasets.add(ds);
            }
        }
    }
View Full Code Here

            }
        });
    }

    public DataSet getNextDataSet() {
        DataSet dataset = new DataSet();
        dataset.setAlbum(wrapper.getTitle());
        dataset.setArtist(wrapper.getArtist());
        dataset.setYear(wrapper.getYear());

        return dataset;
    }
View Full Code Here

    public void update(Observable obs, Object object) {
    if(obs == DataManager.getInstance()) {
        @SuppressWarnings("unchecked")
      Vector<DataSet> datasets = (Vector<DataSet>) object;
      for (Iterator<DataSet> iter = datasets.iterator(); iter.hasNext();) {
        DataSet dataset = iter.next();
        if( !"".equals(dataset.getArtist()) ) {
          tArtist.setText(dataset.getArtist());
        }
        if( !"".equals(dataset.getAlbum()) ) {
          tAlbum.setText(dataset.getAlbum());
        }
      }
    }
  }
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.