public void executeJavaMethod(String command, String params)
    {
        System.out.println("<- " + command + "(" + params + ")");
        int id = -1;
        
        if(command.equals("get-devices"))
        {
            talkToJavaScript("get-devices", _midiSystem.getDevicesXML());
        }
        else if(command.equals("midi-in"))
        {
            id = Integer.parseInt(params);
            talkToJavaScript("midi-in",_midiSystem.setMidiIn(id));
        }
        else if(command.equals("midi-out"))
        {
            id = Integer.parseInt(params);
            talkToJavaScript("midi-out", _midiSystem.setMidiOut(id));
        }
        else if(command.equals("midi-in-out"))
        {
            String[] ids = params.split(",");
            talkToJavaScript("midi-in-out", _midiSystem.setMidiInOut(Integer.parseInt(ids[0]),Integer.parseInt(ids[1])));
        }
        else if(command.equals("as3-midi-event"))
        {
            String result = _midiSystem.processMidiEvent(params);
            if(!result.equals(""))
            {
                talkToJavaScript("as3-midi-event", result);
            }
        }
    }