1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package entagged.audioformats.ogg;
20
21 import entagged.audioformats.generic.AbstractTag;
22 import entagged.audioformats.generic.TagField;
23 import entagged.audioformats.ogg.util.OggTagField;
24
25
26 public class OggTag extends AbstractTag {
27
28 private String vendor = "";
29
30 public static final String DEFAULT_VENDOR = "Entagged - The Musical Box";
31
32 protected TagField createAlbumField(String content) {
33 return new OggTagField("ALBUM", content);
34 }
35
36 protected TagField createArtistField(String content) {
37 return new OggTagField("ARTIST", content);
38 }
39
40 protected TagField createCommentField(String content) {
41 return new OggTagField("DESCRIPTION", content);
42 }
43
44 protected TagField createGenreField(String content) {
45 return new OggTagField("GENRE", content);
46 }
47
48 protected TagField createTitleField(String content) {
49 return new OggTagField("TITLE", content);
50 }
51
52 protected TagField createTrackField(String content) {
53 return new OggTagField("TRACKNUMBER", content);
54 }
55
56 protected TagField createYearField(String content) {
57 return new OggTagField("DATE", content);
58 }
59
60 protected String getAlbumId() {
61 return "ALBUM";
62 }
63
64 protected String getArtistId() {
65 return "ARTIST";
66 }
67
68 protected String getCommentId() {
69 return "DESCRIPTION";
70 }
71
72 protected String getGenreId() {
73 return "GENRE";
74 }
75
76 protected String getTitleId() {
77 return "TITLE";
78 }
79
80 protected String getTrackId() {
81 return "TRACKNUMBER";
82 }
83
84 public String getVendor() {
85 if( !this.vendor.trim().equals("") )
86 return vendor;
87
88 return DEFAULT_VENDOR;
89 }
90
91 protected String getYearId() {
92 return "DATE";
93 }
94
95 public void setVendor(String vendor) {
96 if(vendor == null) {
97 this.vendor = "";
98 return;
99 }
100 this.vendor = vendor;
101 }
102
103 protected boolean isAllowedEncoding(String enc) {
104 return enc.equals("UTF-8");
105 }
106
107 public String toString() {
108 return "OGG " + super.toString();
109 }
110 }
111