当前位置: 首页>>代码示例>>Java>>正文


Java PdBase.sendList方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:b2renger,项目名称:PdDroidPublisher,代码行数:27,代码来源:PdMidiOutput.java

示例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);
}
 
开发者ID:b2renger,项目名称:PdDroidPublisher,代码行数:18,代码来源:PdHelper.java

示例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);
}
 
开发者ID:b2renger,项目名称:PdDroidPublisher,代码行数:12,代码来源:LoadSave.java

示例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;
			}
		}
	
}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:48,代码来源:Piano.java

示例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;
			}
		}
	
}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:48,代码来源:Spl.java

示例6: sendList

import org.puredata.core.PdBase; //导入方法依赖的package包/类
@Override
public int sendList(String recv, Object... args) {
	return PdBase.sendList(recv, args);
	}
 
开发者ID:manhluong,项目名称:pd-for-libgdx,代码行数:5,代码来源:GdxPDAndroid.java

示例7: fire

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void fire() {
 PdBase.sendList(MISSILE, 300, 400);
}
 
开发者ID:thillerson,项目名称:dynamic-sound-android,代码行数:4,代码来源:PdInterface.java

示例8: shipHit

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void shipHit() {
 PdBase.sendList(SHIP, 1000, 50);
}
 
开发者ID:thillerson,项目名称:dynamic-sound-android,代码行数:4,代码来源:PdInterface.java

示例9: asteroidHit

import org.puredata.core.PdBase; //导入方法依赖的package包/类
public void asteroidHit() {
 PdBase.sendList(ASTEROID, 300, 30);
}
 
开发者ID:thillerson,项目名称:dynamic-sound-android,代码行数:4,代码来源:PdInterface.java


注:本文中的org.puredata.core.PdBase.sendList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。