package net.mgsx.pd;

public class PdConfiguration 
{
	/**
	 * Whether to completely disable Pd (for profiling purpose)
	 */
	public static boolean disabled = false;
	
	/**
	 * Whether to enable Pd in remote mode.
	 * Used with gdx-pd-network.pd patch to enable live patching (see gdx-pd live patching guide).
	 */
	public static boolean remoteEnabled = false;
	
	/**
	 * Host to use in remote mode. Can be host name ("localhost") or IP address ("192.160.0.13")
	 * or broadcast address ("225.0.0.37").
	 * see {@link PdAudioRemote}
	 */
	public static String remoteHost = "localhost";
	
	/**
	 * Port to use in remote mode to send messages to Pd.
	 */
	public static int remoteSendPort = 3000;
	
	/**
	 * Port to use in remote mode to send midi stream to Pd.
	 */
	public static int remoteMidiPort = 3001;
	
	/**
	 * Port to use in remote mode to receive messages from Pd.
	 */
	public static int remoteRecvPort = 3002;

	/**
	 * Whether to check all pd errors. 
	 * When true, any send methods will throw {@link net.mgsx.pd.utils.PdRuntimeException} if receiver
	 * doesn't exists.
	 * Default is true.
	 */
	public static boolean safe = true;
	
	
	/**
	 * input channels. Supported values are : 
	 * 0 (no input), 1 (mono microphone), 2 (stereo microphone).
	 * Default is 0 (no inputs) since microphone usage is not so usual and consume CPU.
	 */
	public int inputChannels = 0;
	
	/**
	 * output channels. Supported values are :
	 * 1 (mono playback), 2 (stereo playback).
	 * Default is 2 (stereo playback) for typical usage.
	 */
	public int outputChannels = 2;
	
	/**
	 * Sample rate in Hertz.
	 * Default is 44100 Hz (typical hardware)
	 */
	public int sampleRate = 44100;
	
	/**
	 * Buffer size in frames (stereo means 2 samples per frames, mono means 1 sample per frame).
	 * Default is 256 frames per buffer.
	 * Can be decreased to reduce latency or increased to avoid glitches.
	 */
	public int bufferSize = 256;
	
	/**
	 * Buffer count is number of pre-filled buffers.
	 * Overall latency in sample is bufferSize * bufferCount.
	 * Overall latency in miliseconds is 1000 * bufferSize * bufferCount / sampleRate.
	 * Default latency is about 52 ms.
	 */
	public int bufferCount = 9;
	
}

@@ -1790,19 +1790,18 @@
 ault is 
-25
 6
+4
  frames 
@@ -1917,11 +1917,10 @@
 e = 
-25
 6
+4
 ;%0A%09%0A
@@ -1974,16 +1974,103 @@
 uffers.%0A
+%09 * Default bufferSize and bufferCount are high to ensure most hardware compatibility.%0A
 %09 * Over
@@ -2204,25 +2204,52 @@
 leRate.%0A%09 * 
-D
+With 4096 samples (64x64), d
 efault laten
@@ -2264,10 +2264,10 @@
 out 
-52
+93
  ms.
@@ -2298,15 +2298,16 @@
 Count = 
-9
+64
 ;%0A%09%0A%7D%0A

change default audio buffer settings