00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 package org.xbmc.android.jsonrpc.api.model;
00022
00023 import android.os.Parcel;
00024 import android.os.Parcelable;
00025 import java.util.ArrayList;
00026 import java.util.Arrays;
00027 import java.util.HashSet;
00028 import java.util.List;
00029 import java.util.Set;
00030 import org.codehaus.jackson.JsonNode;
00031 import org.codehaus.jackson.node.ArrayNode;
00032 import org.codehaus.jackson.node.ObjectNode;
00033
00034 public final class AudioModel {
00035
00042 public static class AlbumDetail extends MediaDetail {
00043 public final static String API_TYPE = "Audio.Details.Album";
00044
00045
00046 public static final String ALBUMID = "albumid";
00047 public static final String ALBUMLABEL = "albumlabel";
00048 public static final String DESCRIPTION = "description";
00049 public static final String MOOD = "mood";
00050 public static final String PLAYCOUNT = "playcount";
00051 public static final String STYLE = "style";
00052 public static final String THEME = "theme";
00053 public static final String TYPE = "type";
00054
00055
00056 public final Integer albumid;
00057 public final String albumlabel;
00058 public final String description;
00059 public final List<String> mood;
00060 public final Integer playcount;
00061 public final List<String> style;
00062 public final List<String> theme;
00063 public final String type;
00064
00069 public AlbumDetail(JsonNode node) {
00070 super(node);
00071 albumid = parseInt(node, ALBUMID);
00072 albumlabel = parseString(node, ALBUMLABEL);
00073 description = parseString(node, DESCRIPTION);
00074 mood = getStringArray(node, MOOD);
00075 playcount = parseInt(node, PLAYCOUNT);
00076 style = getStringArray(node, STYLE);
00077 theme = getStringArray(node, THEME);
00078 type = parseString(node, TYPE);
00079 }
00080
00081 @Override
00082 public JsonNode toJsonNode() {
00083 final ObjectNode node = (ObjectNode)super.toJsonNode();
00084 node.put(ALBUMID, albumid);
00085 node.put(ALBUMLABEL, albumlabel);
00086 node.put(DESCRIPTION, description);
00087 final ArrayNode moodArray = OM.createArrayNode();
00088 for (String item : mood) {
00089 moodArray.add(item);
00090 }
00091 node.put(MOOD, moodArray);
00092 node.put(PLAYCOUNT, playcount);
00093 final ArrayNode styleArray = OM.createArrayNode();
00094 for (String item : style) {
00095 styleArray.add(item);
00096 }
00097 node.put(STYLE, styleArray);
00098 final ArrayNode themeArray = OM.createArrayNode();
00099 for (String item : theme) {
00100 themeArray.add(item);
00101 }
00102 node.put(THEME, themeArray);
00103 node.put(TYPE, type);
00104 return node;
00105 }
00106
00112 static List<AlbumDetail> getAudioModelAlbumDetailList(JsonNode node, String key) {
00113 if (node.has(key)) {
00114 final ArrayNode a = (ArrayNode)node.get(key);
00115 final List<AlbumDetail> l = new ArrayList<AlbumDetail>(a.size());
00116 for (int i = 0; i < a.size(); i++) {
00117 l.add(new AlbumDetail((JsonNode)a.get(i)));
00118 }
00119 return l;
00120 }
00121 return new ArrayList<AlbumDetail>(0);
00122 }
00123
00129 @Override
00130 public void writeToParcel(Parcel parcel, int flags) {
00131 super.writeToParcel(parcel, flags);
00132 parcel.writeValue(albumid);
00133 parcel.writeValue(albumlabel);
00134 parcel.writeValue(description);
00135 parcel.writeInt(mood.size());
00136 for (String item : mood) {
00137 parcel.writeValue(item);
00138 }
00139 parcel.writeValue(playcount);
00140 parcel.writeInt(style.size());
00141 for (String item : style) {
00142 parcel.writeValue(item);
00143 }
00144 parcel.writeInt(theme.size());
00145 for (String item : theme) {
00146 parcel.writeValue(item);
00147 }
00148 parcel.writeValue(type);
00149 }
00150
00154 protected AlbumDetail(Parcel parcel) {
00155 super(parcel);
00156 albumid = parcel.readInt();
00157 albumlabel = parcel.readString();
00158 description = parcel.readString();
00159 final int moodSize = parcel.readInt();
00160 mood = new ArrayList<String>(moodSize);
00161 for (int i = 0; i < moodSize; i++) {
00162 mood.add(parcel.readString());
00163 }
00164 playcount = parcel.readInt();
00165 final int styleSize = parcel.readInt();
00166 style = new ArrayList<String>(styleSize);
00167 for (int i = 0; i < styleSize; i++) {
00168 style.add(parcel.readString());
00169 }
00170 final int themeSize = parcel.readInt();
00171 theme = new ArrayList<String>(themeSize);
00172 for (int i = 0; i < themeSize; i++) {
00173 theme.add(parcel.readString());
00174 }
00175 type = parcel.readString();
00176 }
00177
00181 public static final Parcelable.Creator<AlbumDetail> CREATOR = new Parcelable.Creator<AlbumDetail>() {
00182 @Override
00183 public AlbumDetail createFromParcel(Parcel parcel) {
00184 return new AlbumDetail(parcel);
00185 }
00186 @Override
00187 public AlbumDetail[] newArray(int n) {
00188 return new AlbumDetail[n];
00189 }
00190 };
00191
00192 @Override
00193 public int describeContents() {
00194 return 0;
00195 }
00196 }
00197
00204 public static class ArtistDetail extends BaseDetail {
00205 public final static String API_TYPE = "Audio.Details.Artist";
00206
00207
00208 public static final String ARTIST = "artist";
00209 public static final String ARTISTID = "artistid";
00210 public static final String BORN = "born";
00211 public static final String COMPILATIONARTIST = "compilationartist";
00212 public static final String DESCRIPTION = "description";
00213 public static final String DIED = "died";
00214 public static final String DISBANDED = "disbanded";
00215 public static final String FORMED = "formed";
00216 public static final String INSTRUMENT = "instrument";
00217 public static final String MOOD = "mood";
00218 public static final String MUSICBRAINZARTISTID = "musicbrainzartistid";
00219 public static final String STYLE = "style";
00220 public static final String YEARSACTIVE = "yearsactive";
00221
00222
00223 public final String artist;
00224 public final Integer artistid;
00225 public final String born;
00226 public final Boolean compilationartist;
00227 public final String description;
00228 public final String died;
00229 public final String disbanded;
00230 public final String formed;
00231 public final List<String> instrument;
00232 public final List<String> mood;
00233 public final String musicbrainzartistid;
00234 public final List<String> style;
00235 public final List<String> yearsactive;
00236
00241 public ArtistDetail(JsonNode node) {
00242 super(node);
00243 artist = node.get(ARTIST).getTextValue();
00244 artistid = parseInt(node, ARTISTID);
00245 born = parseString(node, BORN);
00246 compilationartist = parseBoolean(node, COMPILATIONARTIST);
00247 description = parseString(node, DESCRIPTION);
00248 died = parseString(node, DIED);
00249 disbanded = parseString(node, DISBANDED);
00250 formed = parseString(node, FORMED);
00251 instrument = getStringArray(node, INSTRUMENT);
00252 mood = getStringArray(node, MOOD);
00253 musicbrainzartistid = parseString(node, MUSICBRAINZARTISTID);
00254 style = getStringArray(node, STYLE);
00255 yearsactive = getStringArray(node, YEARSACTIVE);
00256 }
00257
00258 @Override
00259 public JsonNode toJsonNode() {
00260 final ObjectNode node = (ObjectNode)super.toJsonNode();
00261 node.put(ARTIST, artist);
00262 node.put(ARTISTID, artistid);
00263 node.put(BORN, born);
00264 node.put(COMPILATIONARTIST, compilationartist);
00265 node.put(DESCRIPTION, description);
00266 node.put(DIED, died);
00267 node.put(DISBANDED, disbanded);
00268 node.put(FORMED, formed);
00269 final ArrayNode instrumentArray = OM.createArrayNode();
00270 for (String item : instrument) {
00271 instrumentArray.add(item);
00272 }
00273 node.put(INSTRUMENT, instrumentArray);
00274 final ArrayNode moodArray = OM.createArrayNode();
00275 for (String item : mood) {
00276 moodArray.add(item);
00277 }
00278 node.put(MOOD, moodArray);
00279 node.put(MUSICBRAINZARTISTID, musicbrainzartistid);
00280 final ArrayNode styleArray = OM.createArrayNode();
00281 for (String item : style) {
00282 styleArray.add(item);
00283 }
00284 node.put(STYLE, styleArray);
00285 final ArrayNode yearsactiveArray = OM.createArrayNode();
00286 for (String item : yearsactive) {
00287 yearsactiveArray.add(item);
00288 }
00289 node.put(YEARSACTIVE, yearsactiveArray);
00290 return node;
00291 }
00292
00298 static List<ArtistDetail> getAudioModelArtistDetailList(JsonNode node, String key) {
00299 if (node.has(key)) {
00300 final ArrayNode a = (ArrayNode)node.get(key);
00301 final List<ArtistDetail> l = new ArrayList<ArtistDetail>(a.size());
00302 for (int i = 0; i < a.size(); i++) {
00303 l.add(new ArtistDetail((JsonNode)a.get(i)));
00304 }
00305 return l;
00306 }
00307 return new ArrayList<ArtistDetail>(0);
00308 }
00309
00315 @Override
00316 public void writeToParcel(Parcel parcel, int flags) {
00317 super.writeToParcel(parcel, flags);
00318 parcel.writeValue(artist);
00319 parcel.writeValue(artistid);
00320 parcel.writeValue(born);
00321 parcel.writeInt(compilationartist ? 1 : 0);
00322 parcel.writeValue(description);
00323 parcel.writeValue(died);
00324 parcel.writeValue(disbanded);
00325 parcel.writeValue(formed);
00326 parcel.writeInt(instrument.size());
00327 for (String item : instrument) {
00328 parcel.writeValue(item);
00329 }
00330 parcel.writeInt(mood.size());
00331 for (String item : mood) {
00332 parcel.writeValue(item);
00333 }
00334 parcel.writeValue(musicbrainzartistid);
00335 parcel.writeInt(style.size());
00336 for (String item : style) {
00337 parcel.writeValue(item);
00338 }
00339 parcel.writeInt(yearsactive.size());
00340 for (String item : yearsactive) {
00341 parcel.writeValue(item);
00342 }
00343 }
00344
00348 protected ArtistDetail(Parcel parcel) {
00349 super(parcel);
00350 artist = parcel.readString();
00351 artistid = parcel.readInt();
00352 born = parcel.readString();
00353 compilationartist = parcel.readInt() == 1;
00354 description = parcel.readString();
00355 died = parcel.readString();
00356 disbanded = parcel.readString();
00357 formed = parcel.readString();
00358 final int instrumentSize = parcel.readInt();
00359 instrument = new ArrayList<String>(instrumentSize);
00360 for (int i = 0; i < instrumentSize; i++) {
00361 instrument.add(parcel.readString());
00362 }
00363 final int moodSize = parcel.readInt();
00364 mood = new ArrayList<String>(moodSize);
00365 for (int i = 0; i < moodSize; i++) {
00366 mood.add(parcel.readString());
00367 }
00368 musicbrainzartistid = parcel.readString();
00369 final int styleSize = parcel.readInt();
00370 style = new ArrayList<String>(styleSize);
00371 for (int i = 0; i < styleSize; i++) {
00372 style.add(parcel.readString());
00373 }
00374 final int yearsactiveSize = parcel.readInt();
00375 yearsactive = new ArrayList<String>(yearsactiveSize);
00376 for (int i = 0; i < yearsactiveSize; i++) {
00377 yearsactive.add(parcel.readString());
00378 }
00379 }
00380
00384 public static final Parcelable.Creator<ArtistDetail> CREATOR = new Parcelable.Creator<ArtistDetail>() {
00385 @Override
00386 public ArtistDetail createFromParcel(Parcel parcel) {
00387 return new ArtistDetail(parcel);
00388 }
00389 @Override
00390 public ArtistDetail[] newArray(int n) {
00391 return new ArtistDetail[n];
00392 }
00393 };
00394
00395 @Override
00396 public int describeContents() {
00397 return 0;
00398 }
00399 }
00400
00407 public static class BaseDetail extends MediaModel.BaseDetail {
00408 public final static String API_TYPE = "Audio.Details.Base";
00409
00410
00411 public static final String GENRE = "genre";
00412
00413
00414 public final List<String> genre;
00415
00420 public BaseDetail(JsonNode node) {
00421 super(node);
00422 genre = getStringArray(node, GENRE);
00423 }
00424
00425 @Override
00426 public JsonNode toJsonNode() {
00427 final ObjectNode node = (ObjectNode)super.toJsonNode();
00428 final ArrayNode genreArray = OM.createArrayNode();
00429 for (String item : genre) {
00430 genreArray.add(item);
00431 }
00432 node.put(GENRE, genreArray);
00433 return node;
00434 }
00435
00441 static List<BaseDetail> getAudioModelBaseDetailList(JsonNode node, String key) {
00442 if (node.has(key)) {
00443 final ArrayNode a = (ArrayNode)node.get(key);
00444 final List<BaseDetail> l = new ArrayList<BaseDetail>(a.size());
00445 for (int i = 0; i < a.size(); i++) {
00446 l.add(new BaseDetail((JsonNode)a.get(i)));
00447 }
00448 return l;
00449 }
00450 return new ArrayList<BaseDetail>(0);
00451 }
00452
00458 @Override
00459 public void writeToParcel(Parcel parcel, int flags) {
00460 super.writeToParcel(parcel, flags);
00461 parcel.writeInt(genre.size());
00462 for (String item : genre) {
00463 parcel.writeValue(item);
00464 }
00465 }
00466
00470 protected BaseDetail(Parcel parcel) {
00471 super(parcel);
00472 final int genreSize = parcel.readInt();
00473 genre = new ArrayList<String>(genreSize);
00474 for (int i = 0; i < genreSize; i++) {
00475 genre.add(parcel.readString());
00476 }
00477 }
00478
00482 public static final Parcelable.Creator<BaseDetail> CREATOR = new Parcelable.Creator<BaseDetail>() {
00483 @Override
00484 public BaseDetail createFromParcel(Parcel parcel) {
00485 return new BaseDetail(parcel);
00486 }
00487 @Override
00488 public BaseDetail[] newArray(int n) {
00489 return new BaseDetail[n];
00490 }
00491 };
00492
00493 @Override
00494 public int describeContents() {
00495 return 0;
00496 }
00497 }
00498
00505 public static class MediaDetail extends BaseDetail {
00506 public final static String API_TYPE = "Audio.Details.Media";
00507
00508
00509 public static final String ARTIST = "artist";
00510 public static final String ARTISTID = "artistid";
00511 public static final String DISPLAYARTIST = "displayartist";
00512 public static final String GENREID = "genreid";
00513 public static final String MUSICBRAINZALBUMARTISTID = "musicbrainzalbumartistid";
00514 public static final String MUSICBRAINZALBUMID = "musicbrainzalbumid";
00515 public static final String RATING = "rating";
00516 public static final String TITLE = "title";
00517 public static final String YEAR = "year";
00518
00519
00520 public final List<String> artist;
00521 public final List<Integer> artistid;
00522 public final String displayartist;
00523 public final List<Integer> genreid;
00524 public final String musicbrainzalbumartistid;
00525 public final String musicbrainzalbumid;
00526 public final Integer rating;
00527 public final String title;
00528 public final Integer year;
00529
00534 public MediaDetail(JsonNode node) {
00535 super(node);
00536 artist = getStringArray(node, ARTIST);
00537 artistid = getIntegerArray(node, ARTISTID);
00538 displayartist = parseString(node, DISPLAYARTIST);
00539 genreid = getIntegerArray(node, GENREID);
00540 musicbrainzalbumartistid = parseString(node, MUSICBRAINZALBUMARTISTID);
00541 musicbrainzalbumid = parseString(node, MUSICBRAINZALBUMID);
00542 rating = parseInt(node, RATING);
00543 title = parseString(node, TITLE);
00544 year = parseInt(node, YEAR);
00545 }
00546
00547 @Override
00548 public JsonNode toJsonNode() {
00549 final ObjectNode node = (ObjectNode)super.toJsonNode();
00550 final ArrayNode artistArray = OM.createArrayNode();
00551 for (String item : artist) {
00552 artistArray.add(item);
00553 }
00554 node.put(ARTIST, artistArray);
00555 final ArrayNode artistidArray = OM.createArrayNode();
00556 for (Integer item : artistid) {
00557 artistidArray.add(item);
00558 }
00559 node.put(ARTISTID, artistidArray);
00560 node.put(DISPLAYARTIST, displayartist);
00561 final ArrayNode genreidArray = OM.createArrayNode();
00562 for (Integer item : genreid) {
00563 genreidArray.add(item);
00564 }
00565 node.put(GENREID, genreidArray);
00566 node.put(MUSICBRAINZALBUMARTISTID, musicbrainzalbumartistid);
00567 node.put(MUSICBRAINZALBUMID, musicbrainzalbumid);
00568 node.put(RATING, rating);
00569 node.put(TITLE, title);
00570 node.put(YEAR, year);
00571 return node;
00572 }
00573
00579 static List<MediaDetail> getAudioModelMediaDetailList(JsonNode node, String key) {
00580 if (node.has(key)) {
00581 final ArrayNode a = (ArrayNode)node.get(key);
00582 final List<MediaDetail> l = new ArrayList<MediaDetail>(a.size());
00583 for (int i = 0; i < a.size(); i++) {
00584 l.add(new MediaDetail((JsonNode)a.get(i)));
00585 }
00586 return l;
00587 }
00588 return new ArrayList<MediaDetail>(0);
00589 }
00590
00596 @Override
00597 public void writeToParcel(Parcel parcel, int flags) {
00598 super.writeToParcel(parcel, flags);
00599 parcel.writeInt(artist.size());
00600 for (String item : artist) {
00601 parcel.writeValue(item);
00602 }
00603 parcel.writeInt(artistid.size());
00604 for (Integer item : artistid) {
00605 parcel.writeValue(item);
00606 }
00607 parcel.writeValue(displayartist);
00608 parcel.writeInt(genreid.size());
00609 for (Integer item : genreid) {
00610 parcel.writeValue(item);
00611 }
00612 parcel.writeValue(musicbrainzalbumartistid);
00613 parcel.writeValue(musicbrainzalbumid);
00614 parcel.writeValue(rating);
00615 parcel.writeValue(title);
00616 parcel.writeValue(year);
00617 }
00618
00622 protected MediaDetail(Parcel parcel) {
00623 super(parcel);
00624 final int artistSize = parcel.readInt();
00625 artist = new ArrayList<String>(artistSize);
00626 for (int i = 0; i < artistSize; i++) {
00627 artist.add(parcel.readString());
00628 }
00629 final int artistidSize = parcel.readInt();
00630 artistid = new ArrayList<Integer>(artistidSize);
00631 for (int i = 0; i < artistidSize; i++) {
00632 artistid.add(parcel.readInt());
00633 }
00634 displayartist = parcel.readString();
00635 final int genreidSize = parcel.readInt();
00636 genreid = new ArrayList<Integer>(genreidSize);
00637 for (int i = 0; i < genreidSize; i++) {
00638 genreid.add(parcel.readInt());
00639 }
00640 musicbrainzalbumartistid = parcel.readString();
00641 musicbrainzalbumid = parcel.readString();
00642 rating = parcel.readInt();
00643 title = parcel.readString();
00644 year = parcel.readInt();
00645 }
00646
00650 public static final Parcelable.Creator<MediaDetail> CREATOR = new Parcelable.Creator<MediaDetail>() {
00651 @Override
00652 public MediaDetail createFromParcel(Parcel parcel) {
00653 return new MediaDetail(parcel);
00654 }
00655 @Override
00656 public MediaDetail[] newArray(int n) {
00657 return new MediaDetail[n];
00658 }
00659 };
00660
00661 @Override
00662 public int describeContents() {
00663 return 0;
00664 }
00665 }
00666
00673 public static class SongDetail extends MediaDetail {
00674 public final static String API_TYPE = "Audio.Details.Song";
00675
00676
00677 public static final String ALBUM = "album";
00678 public static final String ALBUMARTIST = "albumartist";
00679 public static final String ALBUMARTISTID = "albumartistid";
00680 public static final String ALBUMID = "albumid";
00681 public static final String COMMENT = "comment";
00682 public static final String DISC = "disc";
00683 public static final String DURATION = "duration";
00684 public static final String FILE = "file";
00685 public static final String LASTPLAYED = "lastplayed";
00686 public static final String LYRICS = "lyrics";
00687 public static final String MUSICBRAINZARTISTID = "musicbrainzartistid";
00688 public static final String MUSICBRAINZTRACKID = "musicbrainztrackid";
00689 public static final String PLAYCOUNT = "playcount";
00690 public static final String SONGID = "songid";
00691 public static final String TRACK = "track";
00692
00693
00694 public final String album;
00695 public final List<String> albumartist;
00696 public final List<Integer> albumartistid;
00697 public final Integer albumid;
00698 public final String comment;
00699 public final Integer disc;
00700 public final Integer duration;
00701 public final String file;
00702 public final String lastplayed;
00703 public final String lyrics;
00704 public final String musicbrainzartistid;
00705 public final String musicbrainztrackid;
00706 public final Integer playcount;
00707 public final Integer songid;
00708 public final Integer track;
00709
00714 public SongDetail(JsonNode node) {
00715 super(node);
00716 album = parseString(node, ALBUM);
00717 albumartist = getStringArray(node, ALBUMARTIST);
00718 albumartistid = getIntegerArray(node, ALBUMARTISTID);
00719 albumid = parseInt(node, ALBUMID);
00720 comment = parseString(node, COMMENT);
00721 disc = parseInt(node, DISC);
00722 duration = parseInt(node, DURATION);
00723 file = parseString(node, FILE);
00724 lastplayed = parseString(node, LASTPLAYED);
00725 lyrics = parseString(node, LYRICS);
00726 musicbrainzartistid = parseString(node, MUSICBRAINZARTISTID);
00727 musicbrainztrackid = parseString(node, MUSICBRAINZTRACKID);
00728 playcount = parseInt(node, PLAYCOUNT);
00729 songid = parseInt(node, SONGID);
00730 track = parseInt(node, TRACK);
00731 }
00732
00733 @Override
00734 public JsonNode toJsonNode() {
00735 final ObjectNode node = (ObjectNode)super.toJsonNode();
00736 node.put(ALBUM, album);
00737 final ArrayNode albumartistArray = OM.createArrayNode();
00738 for (String item : albumartist) {
00739 albumartistArray.add(item);
00740 }
00741 node.put(ALBUMARTIST, albumartistArray);
00742 final ArrayNode albumartistidArray = OM.createArrayNode();
00743 for (Integer item : albumartistid) {
00744 albumartistidArray.add(item);
00745 }
00746 node.put(ALBUMARTISTID, albumartistidArray);
00747 node.put(ALBUMID, albumid);
00748 node.put(COMMENT, comment);
00749 node.put(DISC, disc);
00750 node.put(DURATION, duration);
00751 node.put(FILE, file);
00752 node.put(LASTPLAYED, lastplayed);
00753 node.put(LYRICS, lyrics);
00754 node.put(MUSICBRAINZARTISTID, musicbrainzartistid);
00755 node.put(MUSICBRAINZTRACKID, musicbrainztrackid);
00756 node.put(PLAYCOUNT, playcount);
00757 node.put(SONGID, songid);
00758 node.put(TRACK, track);
00759 return node;
00760 }
00761
00767 static List<SongDetail> getAudioModelSongDetailList(JsonNode node, String key) {
00768 if (node.has(key)) {
00769 final ArrayNode a = (ArrayNode)node.get(key);
00770 final List<SongDetail> l = new ArrayList<SongDetail>(a.size());
00771 for (int i = 0; i < a.size(); i++) {
00772 l.add(new SongDetail((JsonNode)a.get(i)));
00773 }
00774 return l;
00775 }
00776 return new ArrayList<SongDetail>(0);
00777 }
00778
00784 @Override
00785 public void writeToParcel(Parcel parcel, int flags) {
00786 super.writeToParcel(parcel, flags);
00787 parcel.writeValue(album);
00788 parcel.writeInt(albumartist.size());
00789 for (String item : albumartist) {
00790 parcel.writeValue(item);
00791 }
00792 parcel.writeInt(albumartistid.size());
00793 for (Integer item : albumartistid) {
00794 parcel.writeValue(item);
00795 }
00796 parcel.writeValue(albumid);
00797 parcel.writeValue(comment);
00798 parcel.writeValue(disc);
00799 parcel.writeValue(duration);
00800 parcel.writeValue(file);
00801 parcel.writeValue(lastplayed);
00802 parcel.writeValue(lyrics);
00803 parcel.writeValue(musicbrainzartistid);
00804 parcel.writeValue(musicbrainztrackid);
00805 parcel.writeValue(playcount);
00806 parcel.writeValue(songid);
00807 parcel.writeValue(track);
00808 }
00809
00813 protected SongDetail(Parcel parcel) {
00814 super(parcel);
00815 album = parcel.readString();
00816 final int albumartistSize = parcel.readInt();
00817 albumartist = new ArrayList<String>(albumartistSize);
00818 for (int i = 0; i < albumartistSize; i++) {
00819 albumartist.add(parcel.readString());
00820 }
00821 final int albumartistidSize = parcel.readInt();
00822 albumartistid = new ArrayList<Integer>(albumartistidSize);
00823 for (int i = 0; i < albumartistidSize; i++) {
00824 albumartistid.add(parcel.readInt());
00825 }
00826 albumid = parcel.readInt();
00827 comment = parcel.readString();
00828 disc = parcel.readInt();
00829 duration = parcel.readInt();
00830 file = parcel.readString();
00831 lastplayed = parcel.readString();
00832 lyrics = parcel.readString();
00833 musicbrainzartistid = parcel.readString();
00834 musicbrainztrackid = parcel.readString();
00835 playcount = parcel.readInt();
00836 songid = parcel.readInt();
00837 track = parcel.readInt();
00838 }
00839
00843 public static final Parcelable.Creator<SongDetail> CREATOR = new Parcelable.Creator<SongDetail>() {
00844 @Override
00845 public SongDetail createFromParcel(Parcel parcel) {
00846 return new SongDetail(parcel);
00847 }
00848 @Override
00849 public SongDetail[] newArray(int n) {
00850 return new SongDetail[n];
00851 }
00852 };
00853
00854 @Override
00855 public int describeContents() {
00856 return 0;
00857 }
00858 }
00859
00863 public interface AlbumFields {
00864
00865 public final String TITLE = "title";
00866 public final String DESCRIPTION = "description";
00867 public final String ARTIST = "artist";
00868 public final String GENRE = "genre";
00869 public final String THEME = "theme";
00870 public final String MOOD = "mood";
00871 public final String STYLE = "style";
00872 public final String TYPE = "type";
00873 public final String ALBUMLABEL = "albumlabel";
00874 public final String RATING = "rating";
00875 public final String YEAR = "year";
00876 public final String MUSICBRAINZALBUMID = "musicbrainzalbumid";
00877 public final String MUSICBRAINZALBUMARTISTID = "musicbrainzalbumartistid";
00878 public final String FANART = "fanart";
00879 public final String THUMBNAIL = "thumbnail";
00880 public final String PLAYCOUNT = "playcount";
00881 public final String GENREID = "genreid";
00882 public final String ARTISTID = "artistid";
00883 public final String DISPLAYARTIST = "displayartist";
00884
00885 public final static Set<String> values = new HashSet<String>(Arrays.asList(TITLE, DESCRIPTION, ARTIST, GENRE, THEME, MOOD, STYLE, TYPE, ALBUMLABEL, RATING, YEAR, MUSICBRAINZALBUMID, MUSICBRAINZALBUMARTISTID, FANART, THUMBNAIL, PLAYCOUNT, GENREID, ARTISTID, DISPLAYARTIST));
00886 }
00887
00891 public interface ArtistFields {
00892
00893 public final String INSTRUMENT = "instrument";
00894 public final String STYLE = "style";
00895 public final String MOOD = "mood";
00896 public final String BORN = "born";
00897 public final String FORMED = "formed";
00898 public final String DESCRIPTION = "description";
00899 public final String GENRE = "genre";
00900 public final String DIED = "died";
00901 public final String DISBANDED = "disbanded";
00902 public final String YEARSACTIVE = "yearsactive";
00903 public final String MUSICBRAINZARTISTID = "musicbrainzartistid";
00904 public final String FANART = "fanart";
00905 public final String THUMBNAIL = "thumbnail";
00906 public final String COMPILATIONARTIST = "compilationartist";
00907
00908 public final static Set<String> values = new HashSet<String>(Arrays.asList(INSTRUMENT, STYLE, MOOD, BORN, FORMED, DESCRIPTION, GENRE, DIED, DISBANDED, YEARSACTIVE, MUSICBRAINZARTISTID, FANART, THUMBNAIL, COMPILATIONARTIST));
00909 }
00910
00914 public interface SongFields {
00915
00916 public final String TITLE = "title";
00917 public final String ARTIST = "artist";
00918 public final String ALBUMARTIST = "albumartist";
00919 public final String GENRE = "genre";
00920 public final String YEAR = "year";
00921 public final String RATING = "rating";
00922 public final String ALBUM = "album";
00923 public final String TRACK = "track";
00924 public final String DURATION = "duration";
00925 public final String COMMENT = "comment";
00926 public final String LYRICS = "lyrics";
00927 public final String MUSICBRAINZTRACKID = "musicbrainztrackid";
00928 public final String MUSICBRAINZARTISTID = "musicbrainzartistid";
00929 public final String MUSICBRAINZALBUMID = "musicbrainzalbumid";
00930 public final String MUSICBRAINZALBUMARTISTID = "musicbrainzalbumartistid";
00931 public final String PLAYCOUNT = "playcount";
00932 public final String FANART = "fanart";
00933 public final String THUMBNAIL = "thumbnail";
00934 public final String FILE = "file";
00935 public final String ALBUMID = "albumid";
00936 public final String LASTPLAYED = "lastplayed";
00937 public final String DISC = "disc";
00938 public final String GENREID = "genreid";
00939 public final String ARTISTID = "artistid";
00940 public final String DISPLAYARTIST = "displayartist";
00941 public final String ALBUMARTISTID = "albumartistid";
00942
00943 public final static Set<String> values = new HashSet<String>(Arrays.asList(TITLE, ARTIST, ALBUMARTIST, GENRE, YEAR, RATING, ALBUM, TRACK, DURATION, COMMENT, LYRICS, MUSICBRAINZTRACKID, MUSICBRAINZARTISTID, MUSICBRAINZALBUMID, MUSICBRAINZALBUMARTISTID, PLAYCOUNT, FANART, THUMBNAIL, FILE, ALBUMID, LASTPLAYED, DISC, GENREID, ARTISTID, DISPLAYARTIST, ALBUMARTISTID));
00944 }
00945 }