package com.haxademic.demo.media.audio.analysis;

import com.haxademic.core.app.PAppletHax;
import com.haxademic.core.app.config.AppSettings;
import com.haxademic.core.media.audio.analysis.AudioInputBeads;
import com.haxademic.core.media.audio.analysis.AudioInputESS;
import com.haxademic.core.media.audio.analysis.AudioInputMinim;
import com.haxademic.core.media.audio.analysis.AudioInputProcessingSound;
import com.haxademic.core.media.audio.analysis.AudioStreamData;

import krister.Ess.AudioInput;

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

	protected AudioInputESS audioInputESS;
	protected AudioInputMinim audioInputMinim;
	protected AudioInputBeads audioInputBeads;
	protected AudioInputProcessingSound audioInputProcessingSound;
	
	protected void overridePropsFile() {
		p.appConfig.setProperty( AppSettings.WIDTH, 600);
		p.appConfig.setProperty( AppSettings.HEIGHT, 600);
	}

	public void setupFirstFrame() {
		audioInputESS = new AudioInputESS();
		audioInputMinim = new AudioInputMinim();
		audioInputBeads = new AudioInputBeads();
		// audioInputProcessingSound = new AudioInputProcessingSound();
	}
	
	public void drawApp() {
		background(0);
		
		// ESS
		if(audioInputESS != null) audioInputESS.update(p.g);
		
		// Minim
		p.g.translate(AudioStreamData.debugW, 0);
		if(audioInputMinim != null) audioInputMinim.update(p.g);

		// Beads
		p.g.translate(-AudioStreamData.debugW, AudioStreamData.debugH);
		if(audioInputBeads != null) audioInputBeads.update(p.g);

		// Processing sound lib
		p.g.translate(AudioStreamData.debugW, 0);
		if(audioInputProcessingSound != null) audioInputProcessingSound.update(p.g);
	}
	
	////////////////////////////
	// ESS-sepecific callback
	////////////////////////////
	
	public void audioInputData(AudioInput theInput) {
		audioInputESS.audioInputCallback(theInput);
	}

}


@@ -392,21 +392,16 @@
 ocessing
-Sound
 ;%0Aimport
@@ -424,44 +424,23 @@
 ore.
-media.audio.analysis.AudioStreamData
+system.JavaInfo
 ;%0A%0Ai
@@ -828,21 +828,16 @@
 ocessing
-Sound
  audioIn
@@ -849,21 +849,16 @@
 ocessing
-Sound
 ;%0A%09%0A%09pro
@@ -909,33 +909,32 @@
 fig.setProperty(
- 
 AppSettings.WIDT
@@ -968,17 +968,16 @@
 roperty(
- 
 AppSetti
@@ -988,17 +988,17 @@
 HEIGHT, 
-6
+3
 00);%0A%09%7D%0A
@@ -1029,24 +1029,57 @@
 Frame() %7B%0A%09%09
+JavaInfo.printAudioInfo();%0A%0A%09    
 audioInputES
@@ -1099,24 +1099,26 @@
 InputESS();%0A
+//
 %09%09audioInput
@@ -1148,16 +1148,18 @@
 inim();%0A
+//
 %09%09audioI
@@ -1193,21 +1193,20 @@
 eads();%0A
+//
 %09%09
-// 
 audioInp
@@ -1217,21 +1217,16 @@
 ocessing
-Sound
  = new A
@@ -1244,21 +1244,16 @@
 ocessing
-Sound
 ();%0A%09%7D%0A%09
@@ -1299,20 +1299,8 @@
 0);%0A
-%09%09%0A%09%09// ESS%0A
 %09%09if
@@ -1354,66 +1354,8 @@
 g);%0A
-%09%09%0A%09%09// Minim%0A%09%09p.g.translate(AudioStreamData.debugW, 0);%0A
 %09%09if
@@ -1413,213 +1413,64 @@
 g);%0A
-%0A%09%09// Beads%0A%09%09p.g.translate(-AudioStreamData.debugW, AudioStreamData.debugH);%0A%09%09if(audioInputBeads != null) audioInputBeads.update(p.g);%0A%0A%09%09// Processing sound lib%0A%09%09p.g.translate(AudioStreamData.debugW, 0
+%09%09if(audioInputBeads != null) audioInputBeads.update(p.g
 );%0A%09
@@ -1493,21 +1493,16 @@
 ocessing
-Sound
  != null
@@ -1527,13 +1527,8 @@
 sing
-Sound
 .upd
@@ -1598,16 +1598,210 @@
 callback
+!%0A%09// Since this isn't going through the AudioLineIn wrapper via PAppletHax callback, %0A%09// we need to implement this callback here and direct the PApplet update to the local AudioInputESS object
 %0A%09//////

Update Demo_AudioInputAllLibraries.java