本文整理汇总了Java中org.puredata.core.PdBase.sendMessage方法的典型用法代码示例。如果您正苦于以下问题:Java PdBase.sendMessage方法的具体用法?Java PdBase.sendMessage怎么用?Java PdBase.sendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.puredata.core.PdBase
的用法示例。
在下文中一共展示了PdBase.sendMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanup
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void cleanup() {
// let the screen blank again
runOnUiThread(new Runnable() {
@Override
public void run() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
});
// make sure to release all resources
if (pdService != null) {
pdService.stopAudio();
}
for(PdDroidPatchView view : patchviews)
{
view.getPatch().close();
}
PdBase.sendMessage("pd", "quit", "bang");
PdBase.release();
try {
unbindService(serviceConnection);
} catch (IllegalArgumentException e) {
// already unbound
pdService = null;
}
// release midi
usbMidiManager.destroy();
// release the lock on wifi multicasting
NetworkHelper.releaseWifiMulticast();
}
示例2: sendMessage
import org.puredata.core.PdBase; //导入方法依赖的package包/类
@ProtoMethod(description = "Sends a message to PdLib", example = "")
@ProtoMethodParam(params = {"recv", "value"})
public void sendMessage(String recv, String value) {
PdBase.sendMessage(recv, value);
}
示例3: evaluateMessage
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void evaluateMessage(String s) {
String dest = "freq", symbol = null;
boolean isAny = s.length() > 0 && s.charAt(0) == ';';
Scanner sc = new Scanner(isAny ? s.substring(1) : s);
if (isAny) {
if (sc.hasNext()) dest = sc.next();
else {
toast("Message not sent (empty recipient)");
return;
}
if (sc.hasNext()) symbol = sc.next();
else {
toast("Message not sent (empty symbol)");
}
}
List<Object> list = new ArrayList<Object>();
while (sc.hasNext()) {
if (sc.hasNextInt()) {
list.add(Float.valueOf(sc.nextInt()));
} else if (sc.hasNextFloat()) {
list.add(sc.nextFloat());
} else {
list.add(sc.next());
}
}
if (isAny) {
PdBase.sendMessage(dest, symbol, list.toArray());
} else {
switch (list.size()) {
case 0:
PdBase.sendBang(dest);
break;
case 1:
Object x = list.get(0);
if (x instanceof String) {
PdBase.sendSymbol(dest, (String) x);
} else {
PdBase.sendFloat(dest, (Float) x);
}
break;
default:
PdBase.sendList(dest, list.toArray());
break;
}
}
}
示例4: sendMessage
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private static void sendMessage(String actionTag, int pointerId, float x, float y) {
PdBase.sendMessage(TOUCH_SYMBOL, actionTag, pointerId + 1, x, y);
}
示例5: evaluateMessage
import org.puredata.core.PdBase; //导入方法依赖的package包/类
private void evaluateMessage(String s) {
String dest = "spl", symbol = null;
boolean isAny = s.length() > 0 && s.charAt(0) == ';';
Scanner sc = new Scanner(isAny ? s.substring(1) : s);
if (isAny) {
if (sc.hasNext()) dest = sc.next();
else {
toast("Message not sent (empty recipient)");
return;
}
if (sc.hasNext()) symbol = sc.next();
else {
toast("Message not sent (empty symbol)");
}
}
List<Object> list = new ArrayList<Object>();
while (sc.hasNext()) {
if (sc.hasNextInt()) {
list.add(Float.valueOf(sc.nextInt()));
} else if (sc.hasNextFloat()) {
list.add(sc.nextFloat());
} else {
list.add(sc.next());
}
}
if (isAny) {
PdBase.sendMessage(dest, symbol, list.toArray());
} else {
switch (list.size()) {
case 0:
PdBase.sendBang(dest);
break;
case 1:
Object x = list.get(0);
if (x instanceof String) {
PdBase.sendSymbol(dest, (String) x);
} else {
PdBase.sendFloat(dest, (Float) x);
}
break;
default:
PdBase.sendList(dest, list.toArray());
break;
}
}
}
示例6: sendMessage
import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public int sendMessage(String recv, String msg, Object... args) {
return PdBase.sendMessage(recv, msg, args);
}