/**
 * PlayerTheaded Test
 * @author Philip Peng
 * 
 * Just tests the PlayerTheaded class
 * 
 * Created by Philip Peng
 * Last updated: 2007/10/12
 * 
 * Licensed under GNU GPL (Version 3):
 * http://www.gnu.org/licenses/gpl.txt
 * 
 */

//import java.util.Scanner;

public class PlayerThreadedTest {

	public static void main(String[] args) throws java.io.FileNotFoundException {
		
		// Ask for file name
		//System.out.println("Type in location to song file:");
		//Scanner input = new Scanner(System.in);
		//String file = input.nextLine();
		String file = "foobar.mp3";
		
		try {
			
			// Instantiate new PlayerThreaded
			PlayerThreaded foobar = new PlayerThreaded(file);
			
			// Start PlayerThreaded
			foobar.play();
			
			// Start playback
			System.out.println("========================================");
			System.out.println("Starting playback of " + file);
			System.out.println("========================================");
			
			/*
			// Print progress
			while (!foobar.isComplete()) {
				System.out.println(foobar.getPosition());
			}
			*/
			
			Thread.sleep(3000);
			foobar.pause();
			System.out.println("paused2");
			Thread.sleep(3000);
			foobar.resume();
			System.out.println("resumed2");
			Thread.sleep(3000);
			foobar.pause();
			System.out.println("paused2");
			Thread.sleep(3000);
			foobar.resume();
			System.out.println("resumed2");
			Thread.sleep(3000);
			foobar.pause();
			System.out.println("paused2");
			Thread.sleep(3000);
			foobar.resume();
			System.out.println("resumed2");
			Thread.sleep(3000);
			foobar.pause();
			System.out.println("paused2");
			Thread.sleep(3000);
			foobar.resume();
			System.out.println("resumed2");
			Thread.sleep(3000);
			foobar.pause();
			System.out.println("paused2");
			Thread.sleep(3000);
			foobar.resume();
			System.out.println("resumed2");
			
			// Finish playback
			System.out.println("========================================");
			System.out.println("Finished playback of " + file);
			System.out.println("========================================");
			
		} catch( Exception e ) {
			e.printStackTrace();
		}
		

	}

}
