Assignment 1 for CSE 373 (Winter 2010)
Curly Queue Juke Boxes
Due Thursday, January 14 at 7:00 PM via Catalyst CollectIt.
CSE 373: Data Structures and Algorithms
The University of Washington, Seattle, Winter 2010
Overview: In this assignment you will create an MP3 player application that handles a queue of MP3 files to be played in a particular manner.
Resources Provided: You'll start with the following resources:
0. Detailed description of the assignment.
1. A Java-callable library called JLayer for processing MP3 files.
2. A "Visual Data Structure Applet" for a default data structure, which is a 2D array.
3. A Java file "VisualStackApplet.java" that shows how to adapt the Visual Data Structure Applet for a custom data structure, in this case a stack.
Your program will inherit the following behavior: scrollable display area, textual command processor, buttons to control the overall execution of commands.
Here is a copy and pastable version of a simple demo of using JLayer to play an MP3 file.
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.advanced.AdvancedPlayer;

public class MySimpleMP3Player {

    public static void main(String[] args) {
        BufferedInputStream bis=null;
        AdvancedPlayer player=null; 
        try {
            bis = new BufferedInputStream(new FileInputStream("Bach.mp3"));
        }
        catch (IOException e) {
            System.out.println("Problem accessing file.");
        }
        try {
            player = new AdvancedPlayer(bis);
            player.play();
        }
        catch (JavaLayerException e) {
            System.out.println("Problem playing file.");
        }
        player.close();
    }
}
Turnin Instructions: Turn in the file CurlyQueueJukebox.java corresponding to Step 10 in the Development Sequence described in the assignment. This file should contain the applet class which will demonstrate your solution. If you completed Step 11 for extra credit, also turn in AdvancedCurlyQueueJukebox.java. Turn in all the supporting Java files needed by these classes so that we can compile your code. Do NOT turn in any .class files, mp3 files, eclipse project files, or the JLayer jar file. Your classes should all be in the default package (don't specify a package name at the top of your files). Note that we will be running your applet with various input commands designed to test whether your code meets the requirements.

Click Here To Submit.