Moved opengl to CLI option
This commit is contained in:
@@ -315,12 +315,18 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
|
|
||||||
CLI.addParameter("debug", "", Boolean.class, "Enable debug output");
|
CLI.addParameter("debug", "", Boolean.class, "Enable debug output");
|
||||||
CLI.addParameter("trace", "", Boolean.class, "Enable function tracing");
|
CLI.addParameter("trace", "", Boolean.class, "Enable function tracing");
|
||||||
|
CLI.addParameter("opengl", "", Boolean.class, "Enable OpenGL graphical acceleration");
|
||||||
|
|
||||||
String[] argv = CLI.process(args);
|
String[] argv = CLI.process(args);
|
||||||
|
|
||||||
Debug.debugEnabled = CLI.isSet("debug");
|
Debug.debugEnabled = CLI.isSet("debug");
|
||||||
Debug.traceEnabled = CLI.isSet("trace");
|
Debug.traceEnabled = CLI.isSet("trace");
|
||||||
|
|
||||||
|
if (CLI.isSet("opengl")) {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
props.setProperty("sun.java2d.opengl", "true");
|
||||||
|
}
|
||||||
|
|
||||||
processQueue = new ArrayDeque<Runnable>();
|
processQueue = new ArrayDeque<Runnable>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1080,8 +1086,6 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
|
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
Properties props = System.getProperties();
|
|
||||||
props.setProperty("sun.java2d.opengl", "true");
|
|
||||||
try {
|
try {
|
||||||
config.load(AudiobookRecorder.class.getResourceAsStream("config.txt"));
|
config.load(AudiobookRecorder.class.getResourceAsStream("config.txt"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -522,6 +522,10 @@ public class Options extends JDialog {
|
|||||||
validFormats.add(new AudioFormat(96000f, 16, 2, true, false));
|
validFormats.add(new AudioFormat(96000f, 16, 2, true, false));
|
||||||
validFormats.add(new AudioFormat(96000f, 24, 1, true, false));
|
validFormats.add(new AudioFormat(96000f, 24, 1, true, false));
|
||||||
validFormats.add(new AudioFormat(96000f, 24, 2, true, false));
|
validFormats.add(new AudioFormat(96000f, 24, 2, true, false));
|
||||||
|
validFormats.add(new AudioFormat(192000f, 16, 1, true, false));
|
||||||
|
validFormats.add(new AudioFormat(192000f, 16, 2, true, false));
|
||||||
|
validFormats.add(new AudioFormat(192000f, 24, 1, true, false));
|
||||||
|
validFormats.add(new AudioFormat(192000f, 24, 2, true, false));
|
||||||
|
|
||||||
Mixer.Info[] info = AudioSystem.getMixerInfo();
|
Mixer.Info[] info = AudioSystem.getMixerInfo();
|
||||||
for (Mixer.Info i : info) {
|
for (Mixer.Info i : info) {
|
||||||
@@ -554,10 +558,11 @@ public class Options extends JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static KVPair[] getSampleRateList() {
|
static KVPair[] getSampleRateList() {
|
||||||
KVPair[] l = new KVPair[3];
|
KVPair[] l = new KVPair[4];
|
||||||
l[0] = new KVPair<String, String>("44100", "44100");
|
l[0] = new KVPair<String, String>("44100", "44100");
|
||||||
l[1] = new KVPair<String, String>("48000", "48000");
|
l[1] = new KVPair<String, String>("48000", "48000");
|
||||||
l[2] = new KVPair<String, String>("96000", "96000");
|
l[2] = new KVPair<String, String>("96000", "96000");
|
||||||
|
l[2] = new KVPair<String, String>("192000", "192000");
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -789,9 +794,10 @@ public class Options extends JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static KVPair[] getResolutionList() {
|
public static KVPair[] getResolutionList() {
|
||||||
KVPair[] pairs = new KVPair[2];
|
KVPair[] pairs = new KVPair[3];
|
||||||
pairs[0] = new KVPair<String, String>("16", "16 Bit");
|
pairs[0] = new KVPair<String, String>("16", "16 Bit");
|
||||||
pairs[1] = new KVPair<String, String>("24", "24 Bit");
|
pairs[1] = new KVPair<String, String>("24", "24 Bit");
|
||||||
|
pairs[1] = new KVPair<String, String>("32", "32 Bit");
|
||||||
return pairs;
|
return pairs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,10 @@ public class Sentence extends BookTreeNode implements Cacheable {
|
|||||||
try {
|
try {
|
||||||
running = true;
|
running = true;
|
||||||
recording = true;
|
recording = true;
|
||||||
byte[] buf = new byte[1024]; //AudiobookRecorder.window.microphone.getBufferSize()];
|
|
||||||
|
final int numFrames = 512;
|
||||||
|
final int bufSize = numFrames * format.getFrameSize();
|
||||||
|
byte[] buf = new byte[bufSize]; //AudiobookRecorder.window.microphone.getBufferSize()];
|
||||||
FileOutputStream fos = new FileOutputStream(tempFile);
|
FileOutputStream fos = new FileOutputStream(tempFile);
|
||||||
int len = 0;
|
int len = 0;
|
||||||
Microphone.flush();
|
Microphone.flush();
|
||||||
|
|||||||
Reference in New Issue
Block a user