• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IoUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.puredata.core.utils.IoUtils的典型用法代码示例。如果您正苦于以下问题:Java IoUtils类的具体用法?Java IoUtils怎么用?Java IoUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IoUtils类属于org.puredata.core.utils包,在下文中一共展示了IoUtils类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: openPatch

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
/** Abre o Patch de PD, segundo o nome do patch e o caminho para obter o id do recurso raw no arquivo .zip
* 
* @param nome do patch '<nome>.pd'
* @param PathToIdResourse
* @return
*/
public int openPatch(final String patch, int PathToIdResourse) {
	final File dir = p5.getFilesDir();
	final File patchFile = new File(dir, patch);
	int out=-1;
	try {
		IoUtils.extractZipResource(p5.getResources().openRawResource(PathToIdResourse), dir, true);
		out = PdBase.openPatch(patchFile.getAbsolutePath());
		Log.d(TAG, "out" + out);
	} catch (final IOException e) {
		e.printStackTrace();
		Log.e(TAG, e.toString() + "; exiting now");
		finish();
	}
	return out;
}
 
开发者ID:brunorohde,项目名称:BITSLC,代码行数:22,代码来源:PureDataManager.java


示例2: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
			PdBase.setReceiver(receiver);			
			PdBase.subscribe("freq");			
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.pianotuner);
			patchFile = IoUtils.extractResource(in, "pinaotuner.pd", getCacheDir());
			PdBase.openPatch(patchFile);
	        PdBase.sendFloat("midinote", 69); 	//此处确保初始化时,按下按钮能听到标准音A发声
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:20,代码来源:Piano.java


示例3: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.wnoise);
			patchFile = IoUtils.extractResource(in, "wnoise.pd", getCacheDir());
			PdBase.openPatch(patchFile);
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:17,代码来源:Wnoise.java


示例4: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.sine);
			patchFile = IoUtils.extractResource(in, "sine.pd", getCacheDir());
			PdBase.openPatch(patchFile);
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:17,代码来源:Sine.java


示例5: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.triangle);
			patchFile = IoUtils.extractResource(in, "triangle.pd", getCacheDir());
			PdBase.openPatch(patchFile);
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:17,代码来源:Triangle.java


示例6: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
//			PdBase.sendFloat("midinote", 64);
//			InputStream in = res.openRawResource(R.raw.pnoise);
//			patchFile = IoUtils.extractResource(in, "pnoise.pd", getCacheDir());
//			PdBase.openPatch(patchFile);
			File dir = getFilesDir();
			IoUtils.extractZipResource(
					getResources().openRawResource(R.raw.pnoise), dir, true);
			File pFile = new File(dir, "pnoise.pd");
			PdBase.openPatch(pFile.getAbsolutePath());
		
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:23,代码来源:Pnoise.java


示例7: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
	Resources res = getResources();
	File patchFile = null;
	try {
		PdBase.setReceiver(reciever);
		PdBase.subscribe("android");
		InputStream in = res.openRawResource(R.raw.touch);
		patchFile = IoUtils.extractResource(in, "touch.pd",getCacheDir());
		PdBase.openPatch(patchFile);
		startAudio();
	} catch (IOException e) {
		Log.e(TAG, e.toString());
		finish();
	} finally {
		if (patchFile != null)
			patchFile.delete();
	}
}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:19,代码来源:Touch.java


示例8: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.sawtooth);
			patchFile = IoUtils.extractResource(in, "sawtooth.pd", getCacheDir());
			PdBase.openPatch(patchFile);
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:17,代码来源:Sawtooth.java


示例9: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("play");
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.metro);
			patchFile = IoUtils.extractResource(in, "metro.pd", getCacheDir());
			PdBase.openPatch(patchFile);
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:17,代码来源:Metro.java


示例10: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;				//import java.io.File
		try {
//			PdBase.setReceiver(receiver);
			PdBase.subscribe("android");
			InputStream in = res.openRawResource(R.raw.test);	//import java.io.InputStream
			patchFile = IoUtils.extractResource(in, "test.pd", getCacheDir());
			PdBase.openPatch(patchFile);
		} catch (IOException e) {			//import java.io.IOException
			Log.e(TAG, e.toString());		//import android.util.Log
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:17,代码来源:Test.java


示例11: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.sendBang("trigger");
			PdBase.sendBang("toggle");
//			PdBase.sendFloat("midinote", 64);
			InputStream in = res.openRawResource(R.raw.sweep);
			patchFile = IoUtils.extractResource(in, "sweep.pd", getCacheDir());
			PdBase.openPatch(patchFile);
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:18,代码来源:Sweep.java


示例12: initPd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initPd() {
		Resources res = getResources();
		File patchFile = null;
		try {
			PdBase.setReceiver(receiver);
			PdBase.subscribe("spl");
//			PdBase.sendBang("trigger");
			InputStream in = res.openRawResource(R.raw.spl);
			patchFile = IoUtils.extractResource(in, "spl.pd", getCacheDir());
			PdBase.openPatch(patchFile);
			startAudio();
		} catch (IOException e) {
			Log.e(TAG, e.toString());
			finish();
		} finally {
			if (patchFile != null) patchFile.delete();
		}
	}
 
开发者ID:fermiyoung,项目名称:musetoolkit,代码行数:19,代码来源:Spl.java


示例13: loadPatch

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
protected void loadPatch() throws IOException {

		if (pd == 0) {
			File dir = getFilesDir();
			IoUtils.extractZipResource(
					getResources().openRawResource(
							com.twobigears.circlesynth.R.raw.vnsequencer), dir,
					true);
			File patchFile = new File(dir, "vnsequencer.pd");
			pd = PdBase.openPatch(patchFile.getAbsolutePath());

			// send initial data to the patch from preferences
			initialisepatch();

		}
	}
 
开发者ID:twobigears,项目名称:Circle-Synth,代码行数:17,代码来源:SynthCircle.java


示例14: loadPatch

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
protected void loadPatch() throws IOException {
	
	
	if (pd == 0) {
		File dir = getFilesDir();
		IoUtils.extractZipResource(
				getResources().openRawResource(
						com.zackhagan.dotmatrix_a.R.raw.patch), dir,
				true);
		File patchFile = new File(dir, "beatbox4.pd");
		pd = PdBase.openPatch(patchFile.getAbsolutePath());


	}
}
 
开发者ID:zhagan,项目名称:dotMatrix-Android,代码行数:16,代码来源:Dm_beatbox.java


示例15: openPatch

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
public int openPatch(final String patch) {
	final File dir = this.getFilesDir();
	final File patchFile = new File(dir, patch);
	int out=-1;
	try {
		IoUtils.extractZipResource(this.getResources().openRawResource(processing.test.springs.R.raw.patch), dir, true);
		out = PdBase.openPatch(patchFile.getAbsolutePath());
	} catch (final IOException e) {
		e.printStackTrace();
		//Log.e(TAG, e.toString() + "; exiting now");
		finish();
	}
	return out;
}
 
开发者ID:b2renger,项目名称:Springs,代码行数:15,代码来源:Springs.java


示例16: initializePd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initializePd() throws IOException {
  AudioParameters.init(context);
  int sampleRate = Math.max(MIN_SAMPLE_RATE, AudioParameters.suggestSampleRate());
  int outChannels = AudioParameters.suggestOutputChannels();
  PdAudio.initAudio(sampleRate, 0, outChannels, 1, true);
  File dir = context.getFilesDir();
  File patchFile = new File(dir, "game_sounds.pd");
  InputStream patchStream = context.getResources().openRawResource(R.raw.patches);
  IoUtils.extractZipResource(patchStream, dir, true);

  PdBase.openPatch(patchFile.getAbsolutePath());
}
 
开发者ID:thillerson,项目名称:dynamic-sound-android,代码行数:13,代码来源:PdInterface.java


示例17: initializePd

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
private void initializePd() throws IOException {
  AudioParameters.init(context);
  int sampleRate = Math.max(MIN_SAMPLE_RATE, AudioParameters.suggestSampleRate());
  int outChannels = AudioParameters.suggestOutputChannels();
  PdAudio.initAudio(sampleRate, 0, outChannels, 1, true);
  File dir = context.getFilesDir();
  File patchFile = new File(dir, "Keyboard.pd");
  InputStream patchStream = context.getResources().openRawResource(R.raw.patches);
  IoUtils.extractZipResource(patchStream, dir, true);

  PdBase.openPatch(patchFile.getAbsolutePath());
}
 
开发者ID:thillerson,项目名称:dynamic-sound-android,代码行数:13,代码来源:PdInterface.java


示例18: loadPatch

import org.puredata.core.utils.IoUtils; //导入依赖的package包/类
protected void loadPatch() throws IOException {

		if (pd == 0) {
			File dir = getFilesDir();
			IoUtils.extractZipResource(
					getResources().openRawResource(
							com.twobigears.pdprocessingtemplate.R.raw.synth), dir,
					true);
			File patchFile = new File(dir, "synth.pd");
			pd = PdBase.openPatch(patchFile.getAbsolutePath());


		}
	}
 
开发者ID:twobigears,项目名称:Pd-Processing-Template,代码行数:15,代码来源:MainActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MultiTrackChunkSource类代码示例发布时间:2022-05-22
下一篇:
Java SchemaViolationException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap