本文整理汇总了Java中org.puredata.core.PdListener类的典型用法代码示例。如果您正苦于以下问题:Java PdListener类的具体用法?Java PdListener怎么用?Java PdListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PdListener类属于org.puredata.core包,在下文中一共展示了PdListener类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addListener
import org.puredata.core.PdListener; //导入依赖的package包/类
@Override
public void addListener(String source, PdListener listener) {
Array<PdListener> listeners = this.listeners.get(source);
if(listeners == null){
Collection<Object> args = new ArrayList<Object>();
args.add(1);
OSCMessage msg = new OSCMessage("/subscribe/" + source, args);
try {
sender.send(msg);
} catch (IOException e) {
throw new PdRuntimeException(e);
}
this.listeners.put(source, listeners = new Array<PdListener>());
}
listeners.add(listener);
}
示例2: addListener
import org.puredata.core.PdListener; //导入依赖的package包/类
@Override
public void addListener(String source, PdListener listener) {
Array<PdListener> contextualListeners = listeners.get(source);
if(contextualListeners == null){
PdBase.subscribe(source);
listeners.put(source, contextualListeners = new Array<PdListener>());
}
contextualListeners.add(listener);
}
示例3: removeListener
import org.puredata.core.PdListener; //导入依赖的package包/类
@Override
public void removeListener(String source, PdListener listener) {
Array<PdListener> contextualListeners = listeners.get(source);
if(contextualListeners != null){
contextualListeners.removeValue(listener, true);
if(contextualListeners.size <= 0){
PdBase.unsubscribe(source);
listeners.remove(source);
}
}
}
示例4: removeListener
import org.puredata.core.PdListener; //导入依赖的package包/类
@Override
public void removeListener(String source, PdListener listener) {
Array<PdListener> listeners = this.listeners.get(source);
if(listeners != null){
listeners.removeValue(listener, true);
}
}
示例5: WavePreview
import org.puredata.core.PdListener; //导入依赖的package包/类
public WavePreview(Subpatch subpatch) {
super(subpatch);
PdHelper.addListener(array.name + ".change", new PdListener.Adapter(){
@Override
public void receiveBang(String source) {
PdBase.readArray(array.buffer, 0, array.name, 0, array.buffer.length);
parent.threadSafeInvalidate();
}
});
}
示例6: initPd
import org.puredata.core.PdListener; //导入依赖的package包/类
protected void initPd() throws IOException {
// Configure the audio glue
int sampleRate = AudioParameters.suggestSampleRate();
// reducing sample rate based on no. of cores
if (getNumCores() == 1)
sampleRate = sampleRate / 4;
else
sampleRate = sampleRate / 2;
pdService.initAudio(sampleRate, 0, 2, 10.0f);
pdService.startAudio(new Intent(this, SynthCircle.class),
R.drawable.notif_icon, "CircleSynth", "Return to Circle Synth");
dispatcher = new PdUiDispatcher();
PdBase.setReceiver(dispatcher);
dispatcher.addListener("scan", new PdListener.Adapter() {
@Override
public void receiveFloat(String source, final float x) {
scanline = x;
detect();
sendPdValue();
}
});
}
示例7: addListener
import org.puredata.core.PdListener; //导入依赖的package包/类
@Override
public void addListener(String source, PdListener listener) {
}
示例8: removeListener
import org.puredata.core.PdListener; //导入依赖的package包/类
@Override
public void removeListener(String source, PdListener listener) {
}
示例9: addListener
import org.puredata.core.PdListener; //导入依赖的package包/类
public static void addListener(String symbol, PdListener listener)
{
dispatcher.addListener(symbol, listener);
}
示例10: addListener
import org.puredata.core.PdListener; //导入依赖的package包/类
/**
* add listener for symbol
* @param source name of the symbol for which receive events.
* @param listener
* @throws PdRuntimeException on error
*/
public void addListener(String source, PdListener listener);
示例11: removeListener
import org.puredata.core.PdListener; //导入依赖的package包/类
/**
* remove previously added listener
* @param source
* @param listener
*/
public void removeListener(String source, PdListener listener);