本文整理汇总了Java中org.puredata.core.PdBase.sendList方法的典型用法代码示例。如果您正苦于以下问题:Java PdBase.sendList方法的具体用法?Java PdBase.sendList怎么用?Java PdBase.sendList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.puredata.core.PdBase
的用法示例。
在下文中一共展示了PdBase.sendList方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import org.puredata.core.PdBase; //导入方法依赖的package包/类
public static void send(int port, byte[] message)
{
if(message.length == 1)
{
int first = message[0] & 0xFF;
if(MidiCode.isRealtime(first))
{
PdBase.sendSysRealTime(port, first);
}
else
{
System.err.println("Unsupported non realtime one byte message : " + first);
}
}
else if(message.length == 3)
{
PdBase.sendList(PdClock.ClockMidiInputReceiver,
Integer.valueOf(message[0] & 0xFF),
Integer.valueOf(message[1] & 0xFF),
Integer.valueOf(message[2] & 0xFF));
}
else
{
System.err.println("Unsupported message length : " + message.length);
}
}
示例2: send
import org.puredata.core.PdBase; //导入方法依赖的package包/类
/** send a Pd atom-string 's' to a particular receiver 'dest' */
public static void send(String dest, String s)
{
List<Object> list = new ArrayList<Object>();
String[] bits = s.split(" ");
for (int i=0; i < bits.length; i++) {
try {
list.add(Float.parseFloat(bits[i]));
} catch (NumberFormatException e) {
list.add(bits[i]);
}
}
Object[] ol = list.toArray();
PdBase.sendList(dest, ol);
}
示例3: gotFilename
import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void gotFilename(String type, File baseDirectory, String newname) {
filename = newname;
String directoryPath = baseDirectory.getAbsolutePath();
List<Object> details = new ArrayList<Object>();
details.add(directoryPath);
details.add(filename);
details.add(extension);
Object[] ol = details.toArray();
PdBase.sendList(sendreceive + "-" + type + "-detail", ol);
PdBase.sendSymbol(sendreceive + "-" + type, directoryPath + "/" + filename + "." + extension);
}
示例4: 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;
}
}
}
示例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: sendList
import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public int sendList(String recv, Object... args) {
return PdBase.sendList(recv, args);
}
示例7: fire
import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void fire() {
PdBase.sendList(MISSILE, 300, 400);
}
示例8: shipHit
import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void shipHit() {
PdBase.sendList(SHIP, 1000, 50);
}
示例9: asteroidHit
import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void asteroidHit() {
PdBase.sendList(ASTEROID, 300, 30);
}