Manager.MIDI_DEVICE_LOCATOR : Manager « javax.microedition.media « Java by API






Manager.MIDI_DEVICE_LOCATOR

 

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;
import javax.microedition.media.Manager;
import javax.microedition.media.Player;
import javax.microedition.media.control.MIDIControl;
import javax.microedition.midlet.MIDlet;

public class MIDICapabilitiesMIDlet extends MIDlet {

  public void startApp() {
    try {
      Player p = Manager.createPlayer(Manager.MIDI_DEVICE_LOCATOR);
      p.prefetch();
      MIDIControl mControl = (MIDIControl) p
          .getControl("javax.microedition.media.control.MIDIControl");

      String msg = mControl.isBankQuerySupported() ? "MIDIControl is fully supported"
          : "Minimum MIDIControl is provided";

      Display.getDisplay(this).setCurrent(new Alert("Message", msg, null, AlertType.INFO));

    } catch (Exception e) {
      System.err.println(e);
    }
  }

  public void pauseApp() {
  }

  public void destroyApp(boolean unconditional) {
  }
}

   
  








Related examples in the same category

1.Manager.TONE_DEVICE_LOCATOR
2.Manager: createPlayer(InputStream arg0, String arg1) throws IOException, MediaException
3.Manager: getSupportedContentTypes(String protocol)
4.Manager: getSupportedProtocols(String content_type)
5.Manager: playTone(int note, int duration, int volume) throws MediaException