Java 类javax.sound.midi.ControllerEventListener 实例源码

项目:openjdk-jdk10    文件:RealTimeSequencer.java   
@Override
public int[] removeControllerEventListener(ControllerEventListener listener, int[] controllers) {
    synchronized(controllerEventListeners) {
        ControllerListElement cve = null;
        boolean flag = false;
        for (int i=0; i < controllerEventListeners.size(); i++) {
            cve = controllerEventListeners.get(i);
            if (cve.listener.equals(listener)) {
                cve.removeControllers(controllers);
                flag = true;
                break;
            }
        }
        if (!flag) {
            return new int[0];
        }
        if (controllers == null) {
            int index = controllerEventListeners.indexOf(cve);
            if (index >= 0) {
                controllerEventListeners.remove(index);
            }
            return new int[0];
        }
        return cve.getControllers();
    }
}
项目:openjdk-jdk10    文件:RealTimeSequencer.java   
@Override
public int[] addControllerEventListener(ControllerEventListener listener, int[] controllers) {
    synchronized(controllerEventListeners) {

        // first find the listener.  if we have one, add the controllers
        // if not, create a new element for it.
        ControllerListElement cve = null;
        boolean flag = false;
        for(int i=0; i < controllerEventListeners.size(); i++) {

            cve = controllerEventListeners.get(i);

            if (cve.listener.equals(listener)) {
                cve.addControllers(controllers);
                flag = true;
                break;
            }
        }
        if (!flag) {
            cve = new ControllerListElement(listener, controllers);
            controllerEventListeners.add(cve);
        }

        // and return all the controllers this listener is interested in
        return cve.getControllers();
    }
}
项目:openjdk-jdk10    文件:RealTimeSequencer.java   
private ControllerListElement(ControllerEventListener listener, int[] controllers) {

            this.listener = listener;
            if (controllers == null) {
                controllers = new int[128];
                for (int i = 0; i < 128; i++) {
                    controllers[i] = i;
                }
            }
            this.controllers = controllers;
        }
项目:javify    文件:AlsaMidiSequencerDevice.java   
public int[] addControllerEventListener(ControllerEventListener listener,
                                        int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}
项目:javify    文件:AlsaMidiSequencerDevice.java   
public int[] removeControllerEventListener(ControllerEventListener listener,
                                           int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}
项目:jvm-stm    文件:AlsaMidiSequencerDevice.java   
public int[] addControllerEventListener(ControllerEventListener listener,
                                        int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}
项目:jvm-stm    文件:AlsaMidiSequencerDevice.java   
public int[] removeControllerEventListener(ControllerEventListener listener,
                                           int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}
项目:frinika    文件:FrinikaSequencer.java   
public int[] addControllerEventListener(ControllerEventListener listener, int[] controllers) {
    // TODO Auto-generated method stub
    return null;
}
项目:frinika    文件:FrinikaSequencer.java   
public int[] removeControllerEventListener(ControllerEventListener listener, int[] controllers) {
    // TODO Auto-generated method stub
    return null;
}
项目:JamVM-PH    文件:AlsaMidiSequencerDevice.java   
public int[] addControllerEventListener(ControllerEventListener listener,
                                        int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}
项目:JamVM-PH    文件:AlsaMidiSequencerDevice.java   
public int[] removeControllerEventListener(ControllerEventListener listener,
                                           int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}
项目:classpath    文件:AlsaMidiSequencerDevice.java   
public int[] addControllerEventListener(ControllerEventListener listener,
                                        int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}
项目:classpath    文件:AlsaMidiSequencerDevice.java   
public int[] removeControllerEventListener(ControllerEventListener listener,
                                           int[] controllers)
{
  // TODO Auto-generated method stub
  return null;
}