package com.haxademic.demo.audio;

import com.haxademic.core.app.PAppletHax;
import com.haxademic.core.constants.AppSettings;
import com.haxademic.core.draw.context.DrawUtil;
import com.haxademic.core.file.FileUtil;

public class Demo_WaveformAudioRender
extends PAppletHax {
	public static void main(String args[]) { PAppletHax.main(Thread.currentThread().getStackTrace()[1].getClassName()); }

	protected void overridePropsFile() {
		p.appConfig.setProperty( AppSettings.FPS, 30 );
		p.appConfig.setProperty( AppSettings.WIDTH, 1280 );
		p.appConfig.setProperty( AppSettings.HEIGHT, 720 );
		p.appConfig.setProperty( AppSettings.SMOOTHING, AppSettings.SMOOTH_HIGH );
		p.appConfig.setProperty( AppSettings.RENDERING_MOVIE, true );
		p.appConfig.setProperty( AppSettings.RENDER_AUDIO, true );
		p.appConfig.setProperty( AppSettings.RENDER_AUDIO_FILE, FileUtil.getFile("audio/cacheflowe_bigger_loop.wav") );
	}

	public void setupFirstFrame() {
		p.background(0);
	}
	
	public void drawApp() {
		DrawUtil.feedback(p.g, 0, 0.2f, 10f);

		// draw waveform
		p.stroke(255);
		p.strokeWeight(3);
		p.noFill();
		float startX = 0;
		float spacing = p.width / 512f;
		p.beginShape();
		for (int i = 0; i < _waveformData._waveform.length; i++ ) {
			float curY = p.height * 0.5f + _waveformData._waveform[i] * 300f;
			p.vertex(startX + i * spacing, curY);
		}
		p.endShape();
	}
}

@@ -123,57 +123,8 @@
 gs;%0A
-import com.haxademic.core.draw.context.DrawUtil;%0A
 impo
@@ -540,85 +540,8 @@
  );%0A
-%09%09p.appConfig.setProperty( AppSettings.SMOOTHING, AppSettings.SMOOTH_HIGH );%0A
 %09%09p.
@@ -778,16 +778,17 @@
 ) );%0A%09%7D%0A
+%09
 %0A%09public
@@ -797,23 +797,15 @@
 oid 
-setupFirstFrame
+drawApp
 () %7B
@@ -827,78 +827,8 @@
 (0);
-%0A%09%7D%0A%09%0A%09public void drawApp() %7B%0A%09%09DrawUtil.feedback(p.g, 0, 0.2f, 10f);
 %0A%0A%09%09

Remove feedback