Project 5 - myTunes

Due Friday, 12/2 - 5pm

For this project, you will implement an iTunes-like program that plays MP3s.

Requirements

    1. The absolute path of a directory will be passed as input to the program at the command line. A sample launch of the program would look as follows: java Driver /Users/srollins/mymusic
    2. At startup, the program will recursively traverse the given directory and build a list of all MP3 files that appear in the directory or any directory that is a descendant of the directory provided.
    3. The user may select from the following options:
      1. List all MP3s sorted by song title
      2. List all MP3s sorted by artist
      3. Play MP3 - if the user selects this option, you will need to also ask the user to select the MP3 he/she wishes to play
      4. Stop playback - a song is playing, stop playback. If no song is playing, do nothing.
      5. Exit the program

Implementation Details

    1. It is up to you to design this program. Refer to the Project 3 design for a starting point.
    2. Use jAudiotagger to read the ID3 tags of the MP3 files. This will allow you to extract the artist, album, and title of the song during startup.
    3. Use JLayer for playback. You can create a Player object from an InputStream and invoke the play method to begin playback. The close method stops playback.
    4. When invoking the play method to play a song, the method will not return until the song is finished playing. In order for your program to respond to other events during playback, you will need to create a new Thread that invokes the play method. A basic example of this is as follows:

player = new Player(is);

Thread t = new Thread() {

public void run() {

try {

player.play();

} catch(Exception e) {

e.printStackTrace();

}

}

};

t.start();

Extra Credit Options

Extra credit will only be awarded to students who have received approval to work on extra credit features. Before beginning work on extra credit, you must attend office hours and review your code, including all features specified above, with the professor.

    1. Export/Import Libraries - Allow the user to export the song list to a text file. The file must contain all information necessary to rebuild the song list without having to do a recursive traversal of the original directory.
    2. Playlists - Allow the user to create playlists of songs. The user may create a playlist, name the playlist, add songs to the playlist, view only the songs in a given playlist, and play all songs in the list.