Package com.tulskiy.musique.gui.model

Examples of com.tulskiy.musique.gui.model.FieldValues


    public FieldValues getTagFieldValues(FieldKey key) {
      return tagFields.get(key);
    }

    public FieldValues getTagFieldValuesSafe(FieldKey key) {
      FieldValues result = getTagFieldValues(key);

      if (result == null) {
        result = new FieldValues();
      }
     
      return result;
    }
View Full Code Here


        // TODO skipping, should be handled in its own way
      }
      // handle common cases
      else {
        if (INTERNED_FIELDS.contains(key)) {
          FieldValues valuesOptimized = new FieldValues();
          for (int i = 0; i < values.size(); i++) {
            String value = values.get(i);
          valuesOptimized.add(value == null ? null : value.intern());
          }
            tagFields.put(key, valuesOptimized);
        }
        else {
            tagFields.put(key, values);
View Full Code Here

        }
      }
    }
   
    public void setTagFieldValues(FieldKey key, String value) {
      setTagFieldValues(key, new FieldValues(value));
    }
View Full Code Here

    public void setTagFieldValues(FieldKey key, String value) {
      setTagFieldValues(key, new FieldValues(value));
    }
   
    public void addTagFieldValues(FieldKey key, FieldValues values) {
      FieldValues existingValues = getTagFieldValuesSafe(key);
      existingValues.add(values);
      setTagFieldValues(key, existingValues);
    }
View Full Code Here

      existingValues.add(values);
      setTagFieldValues(key, existingValues);
    }
   
    public void addTagFieldValues(FieldKey key, String value) {
      FieldValues existingValues = getTagFieldValuesSafe(key);
      existingValues.add(value);
      setTagFieldValues(key, existingValues);
    }
View Full Code Here

      existingValues.add(value);
      setTagFieldValues(key, existingValues);
    }
   
    public String getFirstTagFieldValue(FieldKey key) {
      FieldValues values = getTagFieldValues(key);
     
      if (!FieldValues.isEmptyEx(values)) {
        return values.get(0);
      }
     
      return null;
    }
View Full Code Here

        removeEmptyTagField(key);
      }
    }
   
    public void removeEmptyTagFieldValues(FieldKey key) {
      FieldValues values = getTagFieldValues(key);
      if (values != null) {
        for (int i = 0; i < values.size(); i++) {
          String value = values.get(i);
          if (Util.isEmpty(value)) {
            values.remove(i);
          }
        }
      }
    }
View Full Code Here

        tag.deleteField(FieldKey.DISC_NO);
      }
    }

    private void handleGenreFields(Tag tag, Track track) throws FieldDataInvalidException, KeyNotFoundException {
      FieldValues genres = track.getTrackData().getGenres();
      if (genres != null && !genres.isEmpty()) {
        Mp4Tag mp4Tag = (Mp4Tag) tag;
       
        mp4Tag.deleteField(Mp4FieldKey.GENRE);
        mp4Tag.deleteField(Mp4FieldKey.GENRE_CUSTOM);
       
      for (int i = 0; i < genres.size(); i++) {
        String genre = genres.get(i);
          if (!Util.isEmpty(genre)) {
            mp4Tag.addField(FieldKey.GENRE, genre);
          }
        }
      }
View Full Code Here

            ID3v1Tag id3v1Tag = (ID3v1Tag) tag;
            TrackData trackData = track.getTrackData();
            for (FieldKey key : FieldKey.values()) {
                String val = id3v1Tag.getFirst(key);
                if (!Util.isEmpty(val)) {
                    FieldValues tagFieldValues = trackData.getTagFieldValues(key);
                    if (tagFieldValues == null || tagFieldValues.isEmpty())
                        trackData.setTagFieldValues(key, val);
                }
            }
        }
    }
View Full Code Here

            Assert.assertTrue(actual.contains(value));
        }
    }

    private void addMulti(TrackData trackData, FieldKey key, String[] values) {
        trackData.addTagFieldValues(key, new FieldValues(Arrays.asList(values)));
    }
View Full Code Here

TOP

Related Classes of com.tulskiy.musique.gui.model.FieldValues

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.