Commit c4050ca1 authored by petter's avatar petter
Browse files

Fixed the "clicking on slides in index does not set the correct slide" -bug

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@135 0463f305-d864-43cb-8a47-61cf597d4139
parent 8282741b
...@@ -104,7 +104,7 @@ import ttt.record.LectureProfileDialog; ...@@ -104,7 +104,7 @@ import ttt.record.LectureProfileDialog;
import ttt.record.Recording; import ttt.record.Recording;
public class TTT extends JFrame { public class TTT extends JFrame {
static final String version = "17.06.2013"; static final String version = "18.06.2013";
public static boolean debug = !true; public static boolean debug = !true;
public static boolean verbose = true; public static boolean verbose = true;
......
...@@ -243,7 +243,8 @@ public class AudioVideoPlayer { ...@@ -243,7 +243,8 @@ public class AudioVideoPlayer {
// set playback to new time // set playback to new time
public void setTime(int time) { public void setTime(int time) {
// linear sync of audio preplay
// linear sync of audio preplay
if (recording.desktop_replay_factor_sync) if (recording.desktop_replay_factor_sync)
player.setMediaTime(new Time((long) ((time + replayOffset) / replayRatio) * 1000000l)); player.setMediaTime(new Time((long) ((time + replayOffset) / replayRatio) * 1000000l));
else else
......
...@@ -290,12 +290,14 @@ public class IndexViewer extends JPanel implements TimeChangedListener { ...@@ -290,12 +290,14 @@ public class IndexViewer extends JPanel implements TimeChangedListener {
JOptionPane.showMessageDialog(null, searchable, "Searchbase of index #" + (index + 1), JOptionPane.showMessageDialog(null, searchable, "Searchbase of index #" + (index + 1),
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
} }
} }
public void mouseReleased(MouseEvent event) {} public void mouseReleased(MouseEvent event) {}
// index entry selected -> jump to index timestamp // index entry selected -> jump to index timestamp
public void valueChanged(ListSelectionEvent event) { public void valueChanged(ListSelectionEvent event) {
// Ignore extra messages. // Ignore extra messages.
if (event.getValueIsAdjusting()) if (event.getValueIsAdjusting())
return; return;
...@@ -304,7 +306,9 @@ public class IndexViewer extends JPanel implements TimeChangedListener { ...@@ -304,7 +306,9 @@ public class IndexViewer extends JPanel implements TimeChangedListener {
if (!list.isSelectionEmpty()) { if (!list.isSelectionEmpty()) {
// jump to selected index entry // jump to selected index entry
int selectedRow = list.getMinSelectionIndex(); int selectedRow = list.getMinSelectionIndex();
recording.pause();
recording.setTime((((IndexEntry) list.getModel().getElementAt(selectedRow))).getTimestamp()); recording.setTime((((IndexEntry) list.getModel().getElementAt(selectedRow))).getTimestamp());
recording.play();
} }
list.clearSelection(); list.clearSelection();
} }
......
...@@ -166,6 +166,7 @@ public class hOCRHandler extends DefaultHandler { ...@@ -166,6 +166,7 @@ public class hOCRHandler extends DefaultHandler {
top = Integer.parseInt(coords[1]); top = Integer.parseInt(coords[1]);
right = Integer.parseInt(coords[2]); right = Integer.parseInt(coords[2]);
bottom = Integer.parseInt(coords[3]); bottom = Integer.parseInt(coords[3]);
System.out.println("Durch!"+left+"/q"+top);
} }
if (localName.equals("div") && attrs.getValue("class").equals("ocr_page")) { if (localName.equals("div") && attrs.getValue("class").equals("ocr_page")) {
......
...@@ -365,9 +365,9 @@ public class Messages { ...@@ -365,9 +365,9 @@ public class Messages {
// finished if gathered everything needed for keyframe or if reached current playback time // finished if gathered everything needed for keyframe or if reached current playback time
if (i == recording.next_message if (i == recording.next_message
|| (coveredCounter == full && deleteAll && cursor && cursorPosition && whiteboard)) || (coveredCounter == full && deleteAll && cursor && cursorPosition && whiteboard)){
break; break;
}
// clear whiteboard at beginning // clear whiteboard at beginning
if (i == 0 && !whiteboard) if (i == 0 && !whiteboard)
collected.add(0, new WhiteboardMessage(0, 0, recording.prefs)); collected.add(0, new WhiteboardMessage(0, 0, recording.prefs));
...@@ -391,8 +391,8 @@ public class Messages { ...@@ -391,8 +391,8 @@ public class Messages {
recording.next_message = newNext != -1 ? newNext : 0; recording.next_message = newNext != -1 ? newNext : 0;
// t = System.currentTimeMillis() - t; // t = System.currentTimeMillis() - t;
// System.out.print("\t" + Constants.getStringFromTime((int) t)); //System.out.print("\t" + Constants.getStringFromTime((int) time));
// System.out.println("\t"+collected.size() + "\t(" + totalCounter + ")\t" //System.out.println("\t"+collected.size() + "\t(" + totalCounter + ")\t"
// + Constants.getStringFromTime(time - collected.get(0).getTimestamp()) + " " // + Constants.getStringFromTime(time - collected.get(0).getTimestamp()) + " "
// + ((collected.size() > 0 && time - collected.get(0).getTimestamp() > 120000)) + "\t- "); // + ((collected.size() > 0 && time - collected.get(0).getTimestamp() > 120000)) + "\t- ");
} }
......
...@@ -666,9 +666,12 @@ public class Recording extends MessageProducerAdapter implements Runnable, ...@@ -666,9 +666,12 @@ public class Recording extends MessageProducerAdapter implements Runnable,
public int timeset; public int timeset;
// set playback time /**
// performs visible scrolling while adjusting * set playback time
// also sets audio/video player if not adjusting * performs visible scrolling while adjusting
* also sets audio/video player if not adjusting
* @param time
*/
public void setTime(int time) { public void setTime(int time) {
time = sync(time); time = sync(time);
...@@ -693,8 +696,9 @@ public class Recording extends MessageProducerAdapter implements Runnable, ...@@ -693,8 +696,9 @@ public class Recording extends MessageProducerAdapter implements Runnable,
graphicsContext.refresh(); graphicsContext.refresh();
// synchronize audio/video // synchronize audio/video
// only if not adjusting, because synchronizing is slow // only if not adjusting, because synchronizing is slow
if (!adjusting && audioVideoPlayer != null) if (!adjusting && audioVideoPlayer != null){
setAudioVideoPlayerTime(time); setAudioVideoPlayerTime(time);
}
// t = System.currentTimeMillis() - t; // t = System.currentTimeMillis() - t;
// System.out.println(Constants.getStringFromTime((int) t)); // System.out.println(Constants.getStringFromTime((int) t));
......
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