diff src/com/aurellem/capture/Capture.java @ 49:121b6d7e4d3f

more friendly AppSettings handling
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Dec 2011 13:22:27 -0600
parents 388f9d062012
children 3dc1f15e1e13
line wrap: on
line diff
     1.1 --- a/src/com/aurellem/capture/Capture.java	Sat Dec 03 12:53:31 2011 -0600
     1.2 +++ b/src/com/aurellem/capture/Capture.java	Sat Dec 03 13:22:27 2011 -0600
     1.3 @@ -14,6 +14,7 @@
     1.4  import com.jme3.audio.AudioRenderer;
     1.5  import com.jme3.renderer.ViewPort;
     1.6  import com.jme3.scene.Spatial;
     1.7 +import com.jme3.system.AppSettings;
     1.8  import com.jme3.system.JmeSystem;
     1.9  
    1.10  public class Capture {
    1.11 @@ -37,7 +38,7 @@
    1.12  
    1.13  				ViewPort viewPort = 
    1.14  						app.getRenderManager()
    1.15 -						.createPostView("aurellem record", app.getCamera());
    1.16 +						.createPostView("aurellem video record", app.getCamera());
    1.17  
    1.18  				viewPort.setClearFlags(false, false, false);
    1.19  
    1.20 @@ -56,9 +57,15 @@
    1.21  
    1.22  	
    1.23  	public static void captureAudio(final Application app, final File file) throws IOException{
    1.24 -		
    1.25 +		AppSettings settings = null;
    1.26 +		if (app.getContext() != null){settings = app.getContext().getSettings();}
    1.27 +		if (settings == null){settings = new AppSettings(true);}
    1.28 +		settings.setAudioRenderer("Send");
    1.29 +		app.setSettings(settings);
    1.30 +
    1.31  		JmeSystem.setSystemDelegate(new AurellemSystemDelegate());
    1.32  				
    1.33 +		
    1.34  		final WaveFileWriter writer = new WaveFileWriter(file);
    1.35  
    1.36  		Callable<Object> thunk = new Callable<Object>(){
    1.37 @@ -73,6 +80,5 @@
    1.38  		};
    1.39  		
    1.40  		app.enqueue(thunk);
    1.41 -	}
    1.42 -	
    1.43 +	}		
    1.44  }