本文整理汇总了Java中javax.sound.midi.ControllerEventListener类的典型用法代码示例。如果您正苦于以下问题:Java ControllerEventListener类的具体用法?Java ControllerEventListener怎么用?Java ControllerEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ControllerEventListener类属于javax.sound.midi包,在下文中一共展示了ControllerEventListener类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeControllerEventListener
import javax.sound.midi.ControllerEventListener; //导入依赖的package包/类
@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();
}
}
示例2: addControllerEventListener
import javax.sound.midi.ControllerEventListener; //导入依赖的package包/类
@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();
}
}
示例3: ControllerListElement
import javax.sound.midi.ControllerEventListener; //导入依赖的package包/类
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;
}
示例4: addControllerEventListener
import javax.sound.midi.ControllerEventListener; //导入依赖的package包/类
public int[] addControllerEventListener(ControllerEventListener listener,
int[] controllers)
{
// TODO Auto-generated method stub
return null;
}
示例5: removeControllerEventListener
import javax.sound.midi.ControllerEventListener; //导入依赖的package包/类
public int[] removeControllerEventListener(ControllerEventListener listener,
int[] controllers)
{
// TODO Auto-generated method stub
return null;
}
示例6: addControllerEventListener
import javax.sound.midi.ControllerEventListener; //导入依赖的package包/类
public int[] addControllerEventListener(ControllerEventListener listener, int[] controllers) {
// TODO Auto-generated method stub
return null;
}
示例7: removeControllerEventListener
import javax.sound.midi.ControllerEventListener; //导入依赖的package包/类
public int[] removeControllerEventListener(ControllerEventListener listener, int[] controllers) {
// TODO Auto-generated method stub
return null;
}