import java.io.IOException;

import jcontrol.io.Display;
import jcontrol.io.Resource;
import jcontrol.toolkit.iMelody;

/**
 * This example loads a melody from the flash memory 
 * and plays it using the <code>class iMelody</code>.
 */
public class MelodyExample {
  Display lcd;
  
  public MelodyExample() {
    lcd = new Display();
    lcd.drawString("Now playing:",40,10);
    lcd.drawString("The Entertainer",30,30);
    
    try {
      // load song from flash memory
      Resource r = new Resource("Entertainer.imy");

      // create iMelody instance
      iMelody im = new iMelody(r);
      
      // start playing
      new Thread(im).start();
                
    } catch (IOException e) {}
  }

  public static void main(String[] args) {
    new MelodyExample();
  } 
}
