View Javadoc

1   /*
2    * Entagged Audio Tag library
3    * Copyright (c) 2003-2005 Raphaël Slinckx <raphael@slinckx.net>
4    * 
5    * This library is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU Lesser General Public
7    * License as published by the Free Software Foundation; either
8    * version 2.1 of the License, or (at your option) any later version.
9    *  
10   * This library is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   * Lesser General Public License for more details.
14   * 
15   * You should have received a copy of the GNU Lesser General Public
16   * License along with this library; if not, write to the Free Software
17   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18   */
19  package entagged.audioformats.ape;
20  
21  import entagged.audioformats.ape.util.ApeTagTextField;
22  import entagged.audioformats.generic.AbstractTag;
23  import entagged.audioformats.generic.TagField;
24  
25  public class ApeTag extends AbstractTag {
26  	
27  	protected String getArtistId() {
28  	    return "Artist";
29  	}
30      protected String getAlbumId() {
31  	    return "Album";
32  	}
33      protected String getTitleId() {
34  	    return "Title";
35  	}
36      protected String getTrackId() {
37  	    return "Track";
38  	}
39      protected String getYearId() {
40  	    return "Year";
41  	}
42      protected String getCommentId() {
43  	    return "Comment";
44  	}
45      protected String getGenreId() {
46  	    return "Genre";
47  	}
48      
49      protected TagField createArtistField(String content) {
50          return new ApeTagTextField("Artist", content);
51      }
52      protected TagField createAlbumField(String content) {
53          return new ApeTagTextField("Album", content);
54      }
55      protected TagField createTitleField(String content) {
56          return new ApeTagTextField("Title", content);
57      }
58      protected TagField createTrackField(String content) {
59          return new ApeTagTextField("Track", content);
60      }
61      protected TagField createYearField(String content) {
62          return new ApeTagTextField("Year", content);
63      }
64      protected TagField createCommentField(String content) {
65          return new ApeTagTextField("Comment", content);
66      }
67      protected TagField createGenreField(String content) {
68          return new ApeTagTextField("Genre", content);
69      }
70      
71      protected boolean isAllowedEncoding(String enc) {
72          return enc.equals("UTF-8");
73      }
74      
75  	public String toString() {
76  		return "APE "+super.toString();
77  	}
78  }
79