public class MixTapeModel
extends java.lang.Object
| Constructor and Description | 
|---|
| MixTapeModel()Constructor for objects of type MixTapeModel | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addSong(Song newSong)Add a new song to the song pool. | 
| boolean | addToMix(int position)Move a song from the pool to the playlist. | 
| void | clearPool()Clear the songs in the song pool. | 
| java.util.Vector<Song> | getPlayList()Return the list of songs in the playlist. | 
| TimeDuration | getRemainingTime()Determine the time available, i.e., total playlist time subtracted
 from current tape length. | 
| java.util.Vector<Song> | getSongPool()Return the list of songs in the pool. | 
| TimeDuration | getTapeLength()Accessor to current tape length. | 
| TimeDuration | getTotalTime()Determine the total time of the songs in the playlist. | 
| void | importFile(java.io.File songFile)Load the song pool from a plain text file. | 
| void | loadM3U(java.io.File m3uFile)Load the song pool from an M3U file. | 
| void | removeFromMix(int position)Move a song from the playlist to the pool | 
| void | save(java.io.File saveFile)Write the playlist to a text file. | 
| boolean | setTapeLength(int desiredMinutes)Set the maximum length of time for the playlist. | 
public java.util.Vector<Song> getSongPool()
public java.util.Vector<Song> getPlayList()
public void loadM3U(java.io.File m3uFile)
m3uFile - a file containing an m3u format playlist.public void importFile(java.io.File songFile)
songFile - a file containing a playlist in a simple text format.public void save(java.io.File saveFile)
saveFile - the name of the file to contain the output playlistpublic void addSong(Song newSong)
newSong - Song to be added to the list of songs in the poolpublic boolean setTapeLength(int desiredMinutes)
desiredMinutes - how many minutes are available on the recording mediapublic TimeDuration getTapeLength()
public void clearPool()
public boolean addToMix(int position)
position - the zero-based index of the song to be moved.public void removeFromMix(int position)
position - the zero-based index of the song to be moved.public TimeDuration getTotalTime()
public TimeDuration getRemainingTime()