1 /*
2  * aTunes
3  * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors
4  *
5  * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors
6  *
7  * http://www.atunes.org
8  * http://sourceforge.net/projects/atunes
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  */
20 
21 package net.sourceforge.atunes.model;
22 
23 import java.util.List;
24 
25 /**
26  * Metadata filled by user to rip a CD
27  * @author alex
28  *
29  */
30 public class CDMetadata {
31 
32     private String albumArtist;
33     private String album;
34     private int year;
35     private String genre;
36     private int disc;
37     private List<Integer> tracks;
38     private List<String> trackNames;
39     private List<String> artistNames;
40     private List<String> composerNames;
41 	/**
42 	 * @return the albumArtist
43 	 */
getAlbumArtist()44 	public String getAlbumArtist() {
45 		return albumArtist;
46 	}
47 	/**
48 	 * @param albumArtist the albumArtist to set
49 	 */
setAlbumArtist(String albumArtist)50 	public void setAlbumArtist(String albumArtist) {
51 		this.albumArtist = albumArtist;
52 	}
53 	/**
54 	 * @return the album
55 	 */
getAlbum()56 	public String getAlbum() {
57 		return album;
58 	}
59 	/**
60 	 * @param album the album to set
61 	 */
setAlbum(String album)62 	public void setAlbum(String album) {
63 		this.album = album;
64 	}
65 	/**
66 	 * @return the year
67 	 */
getYear()68 	public int getYear() {
69 		return year;
70 	}
71 	/**
72 	 * @param year the year to set
73 	 */
setYear(int year)74 	public void setYear(int year) {
75 		this.year = year;
76 	}
77 	/**
78 	 * @return the genre
79 	 */
getGenre()80 	public String getGenre() {
81 		return genre;
82 	}
83 	/**
84 	 * @param genre the genre to set
85 	 */
setGenre(String genre)86 	public void setGenre(String genre) {
87 		this.genre = genre;
88 	}
89 	/**
90 	 * @return the disc
91 	 */
getDisc()92 	public int getDisc() {
93 		return disc;
94 	}
95 	/**
96 	 * @param disc the disc to set
97 	 */
setDisc(int disc)98 	public void setDisc(int disc) {
99 		this.disc = disc;
100 	}
101 	/**
102 	 * @return the tracks
103 	 */
getTracks()104 	public List<Integer> getTracks() {
105 		return tracks;
106 	}
107 	/**
108 	 * @param tracks the tracks to set
109 	 */
setTracks(List<Integer> tracks)110 	public void setTracks(List<Integer> tracks) {
111 		this.tracks = tracks;
112 	}
113 	/**
114 	 * @return the trackNames
115 	 */
getTrackNames()116 	public List<String> getTrackNames() {
117 		return trackNames;
118 	}
119 	/**
120 	 * @param trackNames the trackNames to set
121 	 */
setTrackNames(List<String> trackNames)122 	public void setTrackNames(List<String> trackNames) {
123 		this.trackNames = trackNames;
124 	}
125 	/**
126 	 * @return the artistNames
127 	 */
getArtistNames()128 	public List<String> getArtistNames() {
129 		return artistNames;
130 	}
131 	/**
132 	 * @param artistNames the artistNames to set
133 	 */
setArtistNames(List<String> artistNames)134 	public void setArtistNames(List<String> artistNames) {
135 		this.artistNames = artistNames;
136 	}
137 	/**
138 	 * @return the composerNames
139 	 */
getComposerNames()140 	public List<String> getComposerNames() {
141 		return composerNames;
142 	}
143 	/**
144 	 * @param composerNames the composerNames to set
145 	 */
setComposerNames(List<String> composerNames)146 	public void setComposerNames(List<String> composerNames) {
147 		this.composerNames = composerNames;
148 	}
149 
150     /**
151      * @param trackNumber
152      * @return Title for given track number
153      */
getTitle(int trackNumber)154     public String getTitle(int trackNumber) {
155     	return getTrackNames() != null && getTrackNames().size() >= trackNumber ? getTrackNames().get(trackNumber - 1) : null;
156     }
157 
158     /**
159      * @param trackNumber
160      * @return Artist for given track number
161      */
getArtist(int trackNumber)162     public String getArtist(int trackNumber) {
163     	return getArtistNames().size() > trackNumber - 1 ? getArtistNames().get(trackNumber - 1) : null;
164     }
165 
166     /**
167      * @param trackNumber
168      * @return
169      */
getComposer(int trackNumber)170     public String getComposer(int trackNumber) {
171     	return getComposerNames().size() > trackNumber - 1 ? getComposerNames().get(trackNumber - 1) : null;
172     }
173 }
174