changeset 44:388f9d062012

adapting to execellent new jmeSystem changes
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Dec 2011 12:18:55 -0600
parents 2f129118e2d6
children 5cd9e6c65a93
files src/com/aurellem/capture/AurellemSystemDelegate.java src/com/aurellem/capture/Capture.java src/com/aurellem/capture/audio/WaveFileWriter.java src/com/aurellem/capture/examples/Advanced.java
diffstat 4 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/com/aurellem/capture/AurellemSystemDelegate.java	Sat Dec 03 12:18:55 2011 -0600
     1.3 @@ -0,0 +1,14 @@
     1.4 +package com.aurellem.capture;
     1.5 +
     1.6 +import com.aurellem.capture.audio.AudioSendRenderer;
     1.7 +import com.jme3.audio.AudioRenderer;
     1.8 +import com.jme3.system.AppSettings;
     1.9 +import com.jme3.system.JmeDesktopSystem;
    1.10 +
    1.11 +public class AurellemSystemDelegate extends JmeDesktopSystem {
    1.12 +	
    1.13 +	public AudioRenderer newAudioRenderer(AppSettings settings) {
    1.14 +        initialize(settings);
    1.15 +        return new AudioSendRenderer();
    1.16 +    }	
    1.17 +}
    1.18 \ No newline at end of file
     2.1 --- a/src/com/aurellem/capture/Capture.java	Wed Nov 30 06:32:36 2011 -0700
     2.2 +++ b/src/com/aurellem/capture/Capture.java	Sat Dec 03 12:18:55 2011 -0600
     2.3 @@ -14,7 +14,7 @@
     2.4  import com.jme3.audio.AudioRenderer;
     2.5  import com.jme3.renderer.ViewPort;
     2.6  import com.jme3.scene.Spatial;
     2.7 -import com.jme3.system.AppSettings;
     2.8 +import com.jme3.system.JmeSystem;
     2.9  
    2.10  public class Capture {
    2.11  
    2.12 @@ -56,9 +56,9 @@
    2.13  
    2.14  	
    2.15  	public static void captureAudio(final Application app, final File file) throws IOException{
    2.16 -		AppSettings settings = new AppSettings(true);
    2.17 -		settings.setAudioRenderer("Send");
    2.18 -		app.setSettings(settings);
    2.19 +		
    2.20 +		JmeSystem.setSystemDelegate(new AurellemSystemDelegate());
    2.21 +				
    2.22  		final WaveFileWriter writer = new WaveFileWriter(file);
    2.23  
    2.24  		Callable<Object> thunk = new Callable<Object>(){
     3.1 --- a/src/com/aurellem/capture/audio/WaveFileWriter.java	Wed Nov 30 06:32:36 2011 -0700
     3.2 +++ b/src/com/aurellem/capture/audio/WaveFileWriter.java	Sat Dec 03 12:18:55 2011 -0600
     3.3 @@ -23,8 +23,6 @@
     3.4  	public WaveFileWriter(File targetFile) throws FileNotFoundException{
     3.5  		tos = new TNonSeekableDataOutputStream(
     3.6  				new FileOutputStream(targetFile));
     3.7 -		
     3.8 -
     3.9  	}
    3.10  
    3.11  	public void init(AudioFormat format){
     4.1 --- a/src/com/aurellem/capture/examples/Advanced.java	Wed Nov 30 06:32:36 2011 -0700
     4.2 +++ b/src/com/aurellem/capture/examples/Advanced.java	Sat Dec 03 12:18:55 2011 -0600
     4.3 @@ -67,7 +67,7 @@
     4.4  	private MotionTrack motionControl;
     4.5  		
     4.6  	public static void main(String[] args) {
     4.7 -		Logger.getLogger("com.jme3").setLevel(Level.OFF); 
     4.8 +		//Logger.getLogger("com.jme3").setLevel(Level.OFF); 
     4.9  		Advanced app = new Advanced();
    4.10  		AppSettings settings = new AppSettings(true);
    4.11  		settings.setAudioRenderer("Send");
    4.12 @@ -215,7 +215,7 @@
    4.13  		music.setDirectional(false);
    4.14  		music.setMaxDistance(200.0f);
    4.15  		music.setRefDistance(1f);
    4.16 -		music.setRolloffFactor(1f);
    4.17 +		//music.setRolloffFactor(1f);
    4.18  		music.setLooping(false);
    4.19  		audioRenderer.pauseSource(music); 
    4.20  	}