Mercurial > jmeCapture
changeset 45:5cd9e6c65a93
system is shaping up
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Dec 2011 12:44:23 -0600 |
parents | 388f9d062012 |
children | fc71e797f4fa |
files | src/com/aurellem/capture/examples/Advanced.java src/com/aurellem/capture/examples/HelloVideo.java src/com/aurellem/capture/examples/HelloVideoRecording.java src/com/aurellem/capture/examples/HeloAudioRecording.java |
diffstat | 4 files changed, 49 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/src/com/aurellem/capture/examples/Advanced.java Sat Dec 03 12:18:55 2011 -0600 1.2 +++ b/src/com/aurellem/capture/examples/Advanced.java Sat Dec 03 12:44:23 2011 -0600 1.3 @@ -5,13 +5,12 @@ 1.4 import java.io.IOException; 1.5 import java.lang.reflect.Field; 1.6 import java.nio.ByteBuffer; 1.7 -import java.util.logging.Level; 1.8 -import java.util.logging.Logger; 1.9 1.10 import javax.sound.sampled.AudioFormat; 1.11 1.12 import org.tritonus.share.sampled.FloatSampleTools; 1.13 1.14 +import com.aurellem.capture.AurellemSystemDelegate; 1.15 import com.aurellem.capture.Capture; 1.16 import com.aurellem.capture.IsoTimer; 1.17 import com.aurellem.capture.audio.CompositeSoundProcessor; 1.18 @@ -34,7 +33,7 @@ 1.19 import com.jme3.scene.shape.Box; 1.20 import com.jme3.scene.shape.Sphere; 1.21 import com.jme3.system.AppSettings; 1.22 -import com.jme3.system.Natives; 1.23 +import com.jme3.system.JmeSystem; 1.24 1.25 1.26 /** 1.27 @@ -90,6 +89,7 @@ 1.28 Advanced app = new Advanced(); 1.29 AppSettings settings = new AppSettings(true); 1.30 settings.setAudioRenderer("Send"); 1.31 + JmeSystem.setSystemDelegate(new AurellemSystemDelegate()); 1.32 app.setSettings(settings); 1.33 app.setShowSettings(false); 1.34 app.setPauseOnLostFocus(false); 1.35 @@ -220,11 +220,6 @@ 1.36 audioRenderer.pauseSource(music); 1.37 } 1.38 1.39 - 1.40 - 1.41 - 1.42 - 1.43 - 1.44 public class Dancer implements SoundProcessor { 1.45 Geometry entity; 1.46 float scale = 2; 1.47 @@ -274,7 +269,6 @@ 1.48 1.49 rf.registerSoundProcessor(auxListener, 1.50 new CompositeSoundProcessor(new Dancer(ear), aux)); 1.51 - 1.52 } 1.53 } 1.54
2.1 --- a/src/com/aurellem/capture/examples/HelloVideo.java Sat Dec 03 12:18:55 2011 -0600 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,22 +0,0 @@ 2.4 -package com.aurellem.capture.examples; 2.5 - 2.6 -import java.io.File; 2.7 -import java.io.IOException; 2.8 - 2.9 -import jme3test.helloworld.HelloLoop; 2.10 - 2.11 -import com.aurellem.capture.IsoTimer; 2.12 -import com.aurellem.capture.Capture; 2.13 -import com.jme3.app.SimpleApplication; 2.14 - 2.15 -public class HelloVideo { 2.16 - 2.17 - public static void main(String[] ignore) throws IOException { 2.18 - SimpleApplication app = new HelloLoop(); 2.19 - File video = File.createTempFile("helloVideo", ".avi"); 2.20 - app.setTimer(new IsoTimer(60)); 2.21 - Capture.captureVideo(app, video); 2.22 - app.start(); 2.23 - System.out.println(video.getCanonicalPath()); 2.24 - } 2.25 -}
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/src/com/aurellem/capture/examples/HelloVideoRecording.java Sat Dec 03 12:44:23 2011 -0600 3.3 @@ -0,0 +1,22 @@ 3.4 +package com.aurellem.capture.examples; 3.5 + 3.6 +import java.io.File; 3.7 +import java.io.IOException; 3.8 + 3.9 +import jme3test.helloworld.HelloLoop; 3.10 + 3.11 +import com.aurellem.capture.IsoTimer; 3.12 +import com.aurellem.capture.Capture; 3.13 +import com.jme3.app.SimpleApplication; 3.14 + 3.15 +public class HelloVideoRecording { 3.16 + 3.17 + public static void main(String[] ignore) throws IOException { 3.18 + SimpleApplication app = new HelloLoop(); 3.19 + File video = File.createTempFile("helloVideo", ".avi"); 3.20 + app.setTimer(new IsoTimer(60)); 3.21 + Capture.captureVideo(app, video); 3.22 + app.start(); 3.23 + System.out.println(video.getCanonicalPath()); 3.24 + } 3.25 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/src/com/aurellem/capture/examples/HeloAudioRecording.java Sat Dec 03 12:44:23 2011 -0600 4.3 @@ -0,0 +1,24 @@ 4.4 +package com.aurellem.capture.examples; 4.5 + 4.6 +import java.io.File; 4.7 +import java.io.IOException; 4.8 + 4.9 +import jme3test.helloworld.HelloAudio; 4.10 + 4.11 +import com.aurellem.capture.Capture; 4.12 +import com.aurellem.capture.IsoTimer; 4.13 +import com.jme3.app.Application; 4.14 + 4.15 +public class HeloAudioRecording { 4.16 + 4.17 + public static void main(String[] ignore) throws IOException{ 4.18 + Application app = new HelloAudio(); 4.19 + File audio = File.createTempFile("JME-simple-audio", ".wav"); 4.20 + app.setTimer(new IsoTimer(60)); 4.21 + Capture.captureAudio(app, audio); 4.22 + app.start(); 4.23 + System.out.println(audio.getCanonicalPath()); 4.24 + 4.25 + } 4.26 + 4.27 +}