Home
  Contact
  Short Vita
  Research
  Teaching
  LSDIS Lab
  Links

Project 3: MP3 File Collection

Due:    July 21, 2011

In this project you will create a simple, command line based program to view and play a collection of MP3 files.  You are asked to extend a provided LinkedList class, implement class MP3File, and also MyMP3Files, which is the main program for your project.  Your program will rely on a class to play an MP3 file and access the embedded tags in an MP3 file, such as title, author, album, and date.  A Java class to play an MP3 file along with the necessary jar files will be provided to you. 

NOTE:  Since this project involves dealing with MP3 files, you must only use legally obtained MP3 files (see an ethics note below).

In this project, you are also required to provide a suitable JUnit-based tester for your modified LinkedList class, as well as suitable JavaDoc comments for all of your classes.

Submit your project directory to cs1302a on odin, a directory called Project3 (using the submit command):

  • All the source code, i.e. .java files. Please do NOT include .class files.  A LinkedListTester class and javadoc comments are required. Of course, regular “program logic” comments are required in your source code, as well.  As usual, your source code should be well formatted.
  • A README file telling us how to compile your program and how to execute it.

Project description:

  1. Your program must be in package edu.uga.cs1302.mp3files.
  2. Modify the LinkedList class (available on odin in ~kochut/cs1302/LinkedList) to add the following methods:

    boolean add(E o)
    void    clear()
    int     indexOf(Object o)
    E       remove(int index) throws IndexOutOfBoundsException
    E       set(int index, E element) throws IndexOutOfBoundsException

    The meaning of the above methods should be the same as the same methods provided by java.util.LinkedList<E>.  Please, consult the Java SE API documentation, as needed. You must include JavaDoc comments for your methods.

  3. Create a class LinkedListTester which implements a suitable collection of JUnit-based test cases for your class.  The class should sufficiently test your class.  Please, develop a suitable testing plan.
  4. Create a class MP3File, which implements the following methods:

            MP3File()
            MP3File(String pathname)
    String  getPath()
    void    setPath(String pathname)
    String  getAuthor()
    void    setAuthor(String author)
    String  getAlbum()
    void    setAlbum(String album)
    String  getDate()
    void    setDate(String date)
    String  getTitle()
    void    setTitle(String title)
    String  toString()
    boolean equals()
    void    play()

    This class should encapsulate the information about an MP3 file.  The constructor with parameter (pathname) should access and set the suitable values of the MP3 tags (as listed in methods names).  An example program of how to access the tags is available on odin. The toString method should return a String with the author, title, album, and date. The play method should play the MP3 file – explanations will be given in class.

  5. Create a public class MyMP3Files in the default package, which should:
    • Prompt the user for a directory name; you may assume that the directory contains only MP3 files.
    • Read the file names from the given directory and create a LinkedList of MP3File objects, one for each MP3 file in the directory (you should check if the file has the .mp3 suffix).   The files in the list should be in the same order as the files in the directory.
    • Create an iterator for your list of MP3 files
    • Iterate over all files in the list and print the information about each file (using toString).
    • Iterate over all files again, starting from the beginning.  This time, for each file in the list, print the file information (using toString) and then pause, waiting for a user command.  Subsequently, if the user enters:
      • n, move to the next file, if present; otherwise print end of the list;
      • b, move to the previous file, if present; otherwise print top of the list;
      • i, print the information about the current file, including its path;
      • p, play the current file;
      • h, print a short help information about these commands;
      • q, quit the program.

      All reading should be from System.in and writing (excpet for playing the MP3 files) to System.out.

  6. Run javadoc to create the API documentation for your project in directory html, a subdirectory in your project directory Project3.

Things to note:

  • Ethics note: remember that you should not use illegally obtained MP3 files for your listening pleasure, or to test your program.  There are web sites that offer MP3 files for free (for example, www.acidplanet.com, or free music downloads from amazon.com).  Many bands and individual musicians offer free samples of their music, as well.  You should use only legally obtained music files -- read the legal statement of the site from which you are downloading files. Remember that even though the files may be free, that may not give you the right to share the files with others!
  • All of your classes must be in package edu.uga.cs1302.mp3files.
  • Your must use your modified LinkedList to store MP3File objects. 
  • You must provide suitable JavaDoc comments for your classes, methods, and constants.
  • Your design should be reasonably efficient, and in accordance with object oriented design principles (encapsulation, information hiding, inheritance, etc.).