Commit 173d6309 authored by ludwig's avatar ludwig
Browse files

changes for editor2. added methods etc.

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@78 0463f305-d864-43cb-8a47-61cf597d4139
parent 3b027cab
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<classpathentry kind="lib" path="lib/swing-layout-1.0.2.jar"/> <classpathentry kind="lib" path="lib/swing-layout-1.0.2.jar"/>
<classpathentry kind="lib" path="lib/jmf-2.1.1e.jar"/> <classpathentry kind="lib" path="lib/jmf-2.1.1e.jar"/>
<classpathentry kind="lib" path="lib/mp3plugin.jar"/> <classpathentry kind="lib" path="lib/mp3plugin.jar"/>
<classpathentry kind="lib" path="lib/v4l4j.jar"/> <classpathentry kind="lib" path="lib/v4l4j.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="TTT/native/linux32"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/lti-civil.jar"/> <classpathentry kind="lib" path="lib/lti-civil.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
...@@ -82,6 +82,10 @@ public class PlaybackControls extends GradientPanel implements TimeChangedListen ...@@ -82,6 +82,10 @@ public class PlaybackControls extends GradientPanel implements TimeChangedListen
volumeSlider.dispose(); volumeSlider.dispose();
} }
public int getTimeSliderValue(){
return timeSlider.getValue();
}
Icon playIcon, pauseIcon, stopIcon, nextIcon, previousIcon, volumeOnIcon, volumeOffIcon, saveIcon, findIcon, Icon playIcon, pauseIcon, stopIcon, nextIcon, previousIcon, volumeOnIcon, volumeOffIcon, saveIcon, findIcon,
movieIcon; movieIcon;
boolean timerChangedSlider; boolean timerChangedSlider;
......
...@@ -344,13 +344,19 @@ public class Player extends JInternalFrame { ...@@ -344,13 +344,19 @@ public class Player extends JInternalFrame {
}); });
} }
private PlaybackControls playbackControls;
public PlaybackControls getPlaybackControls(){
return playbackControls;
}
// File Playback // File Playback
public Player(String file) throws IOException { public Player(String file) throws IOException {
Recording recording = new Recording(file); Recording recording = new Recording(file);
closeables.add(recording); closeables.add(recording);
GraphicsContext graphicsContext = recording.getGraphicsContext(); GraphicsContext graphicsContext = recording.getGraphicsContext();
PlaybackControls playbackControls = recording.getPlaybackControls(); playbackControls = recording.getPlaybackControls();
// add display // add display
JPanel pane = new JPanel(new BorderLayout()); JPanel pane = new JPanel(new BorderLayout());
......
// TeleTeachingTool - Presentation Recording With Automated Indexing // TeleTeachingTool - Presentation Recording With Automated Indexing
// //
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universitt Mnchen // Copyright (C) 2003-2008 Peter Ziewer - Technische Universitt Mnchen
// //
// This file is part of TeleTeachingTool. // This file is part of TeleTeachingTool.
// //
...@@ -65,6 +65,14 @@ public class Messages { ...@@ -65,6 +65,14 @@ public class Messages {
return messages.get(i); return messages.get(i);
} }
public void setmessages(ArrayList<Message> list){
messages = list;
}
public ArrayList<Message> getMessages(){
return messages;
}
/******************************************************************************************************************* /*******************************************************************************************************************
* read messages * * read messages *
******************************************************************************************************************/ ******************************************************************************************************************/
...@@ -392,7 +400,7 @@ public class Messages { ...@@ -392,7 +400,7 @@ public class Messages {
synchronized public void setTime_full_frame_check_regarding_stripes(int time) { synchronized public void setTime_full_frame_check_regarding_stripes(int time) {
// long t = System.currentTimeMillis(); // long t = System.currentTimeMillis();
// if not set newly, this causes a call of stop() in run() beacuse end of recording reached // if not set newly, this causes a call of stop() in run() because end of recording reached
int newNext = messages.size(); int newNext = messages.size();
int totalCounter = 0; int totalCounter = 0;
......
...@@ -88,6 +88,18 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio ...@@ -88,6 +88,18 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio
this(filename, true); this(filename, true);
} }
public Messages getMessages(){
return messages;
}
public void setfileDesktop(File name){
fileDesktop = name;
}
public void setMessages(ArrayList<Message> list){
messages.setmessages(list);
}
public Recording(String filename, boolean loadAudioVideoStreams) throws IOException { public Recording(String filename, boolean loadAudioVideoStreams) throws IOException {
// read // read
read(filename); read(filename);
...@@ -384,6 +396,14 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio ...@@ -384,6 +396,14 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio
// list of extensions // list of extensions
private ArrayList<byte[]> extensions = new ArrayList<byte[]>(); private ArrayList<byte[]> extensions = new ArrayList<byte[]>();
public ArrayList<byte[]> getExtensions(){
return extensions;
}
public void setExtensions(ArrayList<byte[]> ext){
extensions = ext;
}
private void readExtensions(DataInputStream in) throws IOException { private void readExtensions(DataInputStream in) throws IOException {
// new format without total length of all extensions // new format without total length of all extensions
int len; int len;
...@@ -813,12 +833,22 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio ...@@ -813,12 +833,22 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio
// original recording flag - used for first backup name // original recording flag - used for first backup name
private boolean original = true; private boolean original = true;
public void store() { /**
* Save the recording in a new file
*
* @param OutputFile saves the recording into this file
*/
public boolean store(File OutputFile){
fileDesktop = OutputFile;
return store();
}
public boolean store() {
// TODO: Progress Monitor (leave EventDispatchingThread) // TODO: Progress Monitor (leave EventDispatchingThread)
// ProgressMonitor progressMonitor = null; // ProgressMonitor progressMonitor = null;
try { try {
// progressMonitor = new ProgressMonitor(TTT.getInstance(), "Writing...", null, 0, messages.size());
// backup ttt file // backup ttt file
File renameFile = null; File renameFile = null;
...@@ -854,11 +884,13 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio ...@@ -854,11 +884,13 @@ public class Recording extends MessageProducerAdapter implements Runnable, Actio
// write body // write body
messages.writeMessages(out); messages.writeMessages(out);
return true;
} catch (Exception e) { } catch (Exception e) {
JOptionPane.showMessageDialog(null, "Writing failed.", "Error:", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(null, "Writing failed.", "Error:", JOptionPane.ERROR_MESSAGE);
System.out.println("Error: Writing failed. " + e.getMessage()); System.out.println("Error: Writing failed. " + e.getMessage());
e.printStackTrace(); e.printStackTrace();
return false;
} }
// if (progressMonitor != null) // if (progressMonitor != null)
// progressMonitor.close(); // progressMonitor.close();
......
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