1
package org.jaudiotagger.audio.asf.tag;
3
import java.util.HashMap;
6
* Field keys which need to be mapped for ASF files, or only specified for ASF.
8
* TODO These attributes and their v23 mapping that havent been added to enum yet
10
* WMA ID3v1 ID3v22 ID3v2324
12
* CopyrightURL WCP WCOP
15
* WM/AudioFileURL WAF WOAF
16
* WM/AudioSourceURL WAS WOAS
18
* WM/EncodingSettings TSS TSSE
19
* WM/EncodingTime TDEN
22
* WM/OriginalAlbumTitle TOT TOAL
23
* WM/OriginalArtist TOA TOPE
24
* WM/OriginalFilename TOF TOFN
25
* WM/OriginalLyricist TOL TOLY
26
* WM/OriginalReleaseYear TOR TORY
27
* WM/PlaylistDelay TDLY
28
* WM/RadioStationName TRN TRSN
29
* WM/RadioStationOwner TRO TRSO
32
* WM/UniqueFileIdentifier UFI UFID
33
* WM/UserWebURL WXX WXXX
35
* @author Christian Laireiter
37
public enum AsfFieldKey
39
//Keys are arbitary because these fields dont have 'keys' internally because they are stored in preset contents descriptor
40
AUTHOR("AUTHOR", false),
41
TITLE("TITLE", false),
42
RATING("RATING", false),
43
COPYRIGHT("COPYRIGHT", false),
44
DESCRIPTION("DESCRIPTION", false),
46
//keys are important because this is how values will be looked up by other applications
47
ALBUM("WM/AlbumTitle", false),
48
ALBUM_ARTIST("WM/AlbumArtist", true),
49
ALBUM_ARTIST_SORT("WM/AlbumArtistSortOrder", false),
50
ALBUM_SORT("WM/AlbumSortOrder", false),
51
AMAZON_ID("ASIN", false),
52
ARTIST_SORT("WM/ArtistSortOrder", false),
53
BARCODE("WM/Barcode", false),
54
BPM("WM/BeatsPerMinute", false),
55
CATALOG_NO("WM/CatalogNo", false),
56
CATEGORY("WM/Category", true),
57
COMPOSER("WM/Composer", true),
58
COMPOSER_SORT("WM/ComposerSort", false),
59
CONDUCTOR("WM/Conductor", true),
60
COVER_ART("WM/Picture", true),
61
COVER_ART_URL("WM/AlbumCoverURL", true),
62
DIRECTOR("WM/Director", true),
63
DISC_NO("WM/PartOfSet", false),
64
ENCODER("WM/ToolName", false),
65
ENCODED_BY("WM/EncodedBy", false),
66
GENRE("WM/Genre", true),
67
GENRE_ID("WM/GenreID", true),
68
GROUPING("WM/ContentGroupDescription", false),
69
INITIAL_KEY("WM/InitialKey", false),
70
IS_COMPILATION("WM/IsCompilation", false),
71
ISRC("WM/ISRC", false),
72
ISVBR("IsVBR", false),
73
LANGUAGE("WM/Language", true),
74
LYRICIST("WM/Writer", true),
75
LYRICS("WM/Lyrics", false),
76
LYRICS_SYNCHRONISED("WM/Lyrics_Synchronised", true),
77
MEDIA("WM/Media", false),
78
MOOD("WM/Mood", true),
79
MUSICBRAINZ_ARTISTID("MusicBrainz/Artist Id", false),
80
MUSICBRAINZ_DISC_ID("MusicBrainz/Disc Id", false),
81
MUSICBRAINZ_RELEASE_COUNTRY("MusicBrainz/Album Release Country", false),
82
MUSICBRAINZ_RELEASE_STATUS("MusicBrainz/Album Status", false),
83
MUSICBRAINZ_RELEASE_TYPE("MusicBrainz/Album Type", false),
84
MUSICBRAINZ_RELEASEARTISTID("MusicBrainz/Album Artist Id", false),
85
MUSICBRAINZ_RELEASEID("MusicBrainz/Album Id", false),
86
MUSICBRAINZ_TRACK_ID("MusicBrainz/Track Id", false),
87
MUSICIP_ID("MusicIP/PUID", false),
88
PRODUCER("WM/Producer", false),
89
RECORD_LABEL("WM/Publisher", false),
90
REMIXER("WM/ModifiedBy", false),
91
SUBTITLE("WM/SubTitle", false),
92
TITLE_SORT("WM/TitleSortOrder", false),
93
TRACK("WM/TrackNumber", false),
94
URL_DISCOGS_ARTIST_SITE("WM/DiscogsArtistUrl", false),
95
URL_DISCOGS_RELEASE_SITE("WM/DiscogsReleaseUrl", false),
96
URL_OFFICIAL_ARTIST_SITE("WM/AuthorURL", false),
97
URL_OFFICIAL_RELEASE_SITE("WM/OfficialReleaseUrl", false),
98
URL_PROMOTIONAL_SITE("WM/PromotionURL", true),
99
URL_WIKIPEDIA_ARTIST_SITE("WM/WikipediaArtistUrl", false),
100
URL_WIKIPEDIA_RELEASE_SITE("WM/WikipediaReleaseUrl", false),
101
YEAR("WM/Year", false),;
104
* Stores the {@link AsfFieldKey#fieldName} to the field key.
106
private final static HashMap<String, AsfFieldKey> FIELD_ID_MAP;
110
FIELD_ID_MAP = new HashMap<String, AsfFieldKey>(AsfFieldKey.values().length);
111
for (AsfFieldKey curr : AsfFieldKey.values())
113
FIELD_ID_MAP.put(curr.getFieldName(), curr);
119
* Searches for an ASF field key which represents the given id string.<br>
121
* @param fieldName the fieldname used for this key
122
* @return tjhe Enum that represents this field
124
public static AsfFieldKey getAsfFieldKey(String fieldName)
126
return FIELD_ID_MAP.get(fieldName);
130
* Tests whether the field is enabled for multiple values.<br>
132
* @param id field id to test.
133
* @return <code>true</code> if ASF implementation supports multiple values for the field.
135
public static boolean isMultiValued(String id)
137
boolean result = false; // For now, there is no support for multi values.
138
AsfFieldKey fieldKey = getAsfFieldKey(id);
139
if (fieldKey != null)
141
result = fieldKey.isMultiValued();
148
* If set, the field has a standard id assigned.
150
private String fieldName;
153
* If <code>true</code>, the field will be stored repeatedly if occurs so in tags.
155
private boolean multiValued;
158
* Creates an instance<br>
160
* @param asfFieldId standard field identifier.
161
* @param multiValue <code>true</code> if the this ASF field can have multiple values.
163
private AsfFieldKey(String asfFieldId, boolean multiValue)
165
this.fieldName = asfFieldId;
166
this.multiValued = multiValue;
171
* Returns the standard field id.
173
* @return the standard field id. (may be <code>null</code>)
175
public String getFieldName()
177
return this.fieldName;
182
* Returns <code>true</code> if this field can store multiple values.
184
* @return <code>true</code> if multiple values are supported for this field.
186
public boolean isMultiValued()
188
return this.multiValued;
195
public String toString()
197
return getFieldName();