Commit 11508051 authored by Dr. Michael Petter's avatar Dr. Michael Petter

dialog for hidden experimental values to configure

parent 7a35d1f6
......@@ -75,6 +75,7 @@
<copy todir="${dist}"><fileset dir="${lib}"></fileset></copy>
<copy todir="${dist}"><fileset dir="${native}"></fileset></copy>
<copy todir="${dist}" file="run.sh" />
<copy todir="${dist}" file="experimental.sh" />
<copy todir="${dist}"><fileset dir="linuxscripts"></fileset></copy>
<zip destfile="./ttt.zip" basedir="." includes="dist/*" update="true"/>
</target>
......
#!/bin/bash
java -Dswing.plaf.metal.controlFont="DejaVu Sans Mono Book-20" -cp ttt.jar ttt.Experimental
\ No newline at end of file
......@@ -105,8 +105,13 @@ import ttt.record.LectureProfileDialog;
import ttt.record.Recording;
public class TTT extends JFrame {
static final String version = "09.05.2019";
static final String version = "16.05.2019";
public static void debug(Object out) {
if (debug) System.out.println(out);
}
public static void verbose(Object out) {
if (debug||verbose) System.out.println(out);
}
public static boolean debug = !true;
public static boolean verbose = true;
......
......@@ -177,7 +177,7 @@ public class Exec {
public int exec(String[] cmd) throws Exception {
String cmdline="";
for (String s:cmd) cmdline+=s+" ";
if (TTT.debug) System.out.println(" ... issuing command "+cmdline);
TTT.debug(" ... issuing command "+cmdline);
process = new ProcessBuilder(cmd).start();
//process = Runtime.getRuntime().exec(cmd);
......
// TeleTeachingTool - Presentation Recording With Automated Indexing
//
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universitt Mnchen
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universit�t M�nchen
//
// This file is part of TeleTeachingTool.
//
......@@ -25,15 +25,47 @@
package ttt.audio;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Control;
import javax.sound.sampled.LineListener;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.TargetDataLine;
import javax.sound.sampled.Control.Type;
import javax.swing.JFrame;
import ttt.Experimental;
import ttt.TTT;
import javax.sound.sampled.DataLine;
public class TargetDataLineMonitor implements TargetDataLine {
public class TargetDataLineMonitor implements TargetDataLine {
private static final AudioFormat[] audioFormats = {
new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 22050.0F, 16, 1, 2, 22050.0F, false),
new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 11025.0F, 16, 1, 2, 11025.0F, false),
new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100.0F, 16, 1, 2, 44100.0F, false),
new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, 8000.0F, false) };
public static void main(String[] args) throws Exception {
TTT.setDebug(true);
JFrame frame = new JFrame("Audio Volume Meter");
AudioMonitorPanel amp = new AudioMonitorPanel(true);
frame.add(amp);
frame.pack();
frame.setVisible(true);
for (int i = 0; i < audioFormats.length; i++) {
DataLine.Info info = new DataLine.Info(TargetDataLine.class, audioFormats[i]);
if (AudioSystem.isLineSupported(info)) {
// try {
TargetDataLineMonitor targetDataLine = new TargetDataLineMonitor((TargetDataLine) AudioSystem.getLine(info),
amp);
targetDataLine.open(audioFormats[i], targetDataLine.getBufferSize());
break;
}
}
}
public TargetDataLineMonitor(TargetDataLine targetDataLine, AudioMonitorPanel volumeLevelComponent) {
this.targetDataLine = targetDataLine;
this.volumeLevelComponent = volumeLevelComponent;
......@@ -60,8 +92,11 @@ public class TargetDataLineMonitor implements TargetDataLine {
if (volumeLevelComponent != null)
volumeLevelComponent.setPeakPercentage(meanSampleValue * 2);
ttt.TTT.debug("Sample: "+meanSampleValue*100);
if (meanSampleValue<0.00000001) mutecounter++;
// (meanSampleValue<0.00000001) -- means absolute silence
double threshold=Double.parseDouble(Experimental.Code.MICTHRESHOLD.get());
if (meanSampleValue<threshold) mutecounter++;
if (mutecounter>250){
mutecounter=0;
volumeLevelComponent.warnMuted();
......
......@@ -98,7 +98,7 @@ public class PodcastCreator {
break;
case "-debug":
TTT.verbose=true;
TTT.debug=true;
TTT.setDebug(true);
break;
case "-crop":
String [] crop = args[i].split("\\+");
......@@ -285,9 +285,8 @@ public class PodcastCreator {
outMovieTmpFile.delete();
windowImageFile.delete();
}
if(TTT.verbose){
System.out.println("Unable to create window movie using ffmpeg:");
System.out.println(exec.getListenerStream());}
TTT.verbose("Unable to create window movie using ffmpeg:");
TTT.verbose(exec.getListenerStream());
throw new IOException("unable to create window movie using ffmpeg");
}
if (ShowProgressmonitor & !batch && progressMonitor.isCanceled()) {
......@@ -306,12 +305,12 @@ public class PodcastCreator {
return false;
}
if (outMovieFile.length() == 0) {
if (TTT.debug) {
System.out.println(outMovieFile.getAbsolutePath() + " has size "+outMovieFile.length());
System.out.println("First frame assumed; skipping concatenation");
System.out.println(windowMovieFile.getAbsolutePath() + " has size "+windowMovieFile.length());
TTT.debug(outMovieFile.getAbsolutePath() + " has size "+outMovieFile.length());
TTT.debug("First frame assumed; skipping concatenation");
TTT.debug(windowMovieFile.getAbsolutePath() + " has size "+windowMovieFile.length());
}
//the first window movie can be renamed directly to output movie.
//NOTE: MP4Box uses fps=1 for the container format when vFrames=1 whereby the container frame rate and codec frame rate can differ when using frameRate != 1. That causes a wrong synchronized video and audio stream
outMovieTmpFile.delete(); //For renaming files on a windows system, the destination file may not exist
......@@ -339,10 +338,10 @@ public class PodcastCreator {
}
String cmdline="";
for (String s:line) cmdline+=s+" ";
if(TTT.verbose){
System.out.println("Unable join slide movies using the command:");
System.out.println(cmdline);
System.out.println(exec.getListenerStream());}
TTT.verbose("Unable join slide movies using the command:");
TTT.verbose(cmdline);
TTT.verbose(exec.getListenerStream());
throw new IOException("unable join slide movies using \n"+cmdline);
}
}
......@@ -351,7 +350,7 @@ public class PodcastCreator {
if (i < recording.messages.size()) {
outMovieFile.delete();
outMovieTmpFile.renameTo(outMovieFile);
if (TTT.debug) System.out.println("renamed tmp to outfile");
TTT.debug("renamed tmp to outfile");
}
}
if (!TTT.debug) {
......
......@@ -175,12 +175,9 @@ public class Messages {
in.close();
}
if (TTT.verbose)
System.out.println(" " + messages.size() + " messages loaded.");
TTT.verbose(" " + messages.size() + " messages loaded.");
if (TTT.debug)
if (TTT.verbose)
System.out.println("raw framebuffer usage would be " + (long) total * recording.prefs.bytesPerPixel
TTT.debug("raw framebuffer usage would be " + (long) total * recording.prefs.bytesPerPixel
/ 1024 / 1024 + " Mbytes messages (" + (total / 1024 / 1024) + " megapixels)");
// delete all annotations at beginning (if needed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment