Commit c4050ca1 authored by petter's avatar petter

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