mirror of
https://github.com/processing/processing4.git
synced 2026-05-06 02:46:42 +02:00
tweaking MovieMaker now that it's back in
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package processing.app.tools;
|
||||
/*
|
||||
* The majority of this code is
|
||||
* Nearly all of this code is
|
||||
* Copyright © 2010-2011 Werner Randelshofer, Immensee, Switzerland.
|
||||
* All rights reserved.
|
||||
* (However, he should not be held responsible for the current mess of a hack
|
||||
@@ -58,7 +58,7 @@ import processing.app.Editor;
|
||||
* Hacked from Werner Randelshofer's QuickTimeWriter demo. The original version
|
||||
* can be found <a href="http://www.randelshofer.ch/blog/2010/10/writing-quicktime-movies-in-pure-java/">here</a>.
|
||||
*/
|
||||
public class MovieMakerFrame extends JFrame implements Tool {
|
||||
public class MovieMaker extends JFrame implements Tool {
|
||||
private JFileChooser imageFolderChooser;
|
||||
private JFileChooser soundFileChooser;
|
||||
private JFileChooser movieFileChooser;
|
||||
@@ -129,7 +129,7 @@ public class MovieMakerFrame extends JFrame implements Tool {
|
||||
}
|
||||
|
||||
// Get Preferences
|
||||
prefs = Preferences.userNodeForPackage(MovieMakerFrame.class);
|
||||
prefs = Preferences.userNodeForPackage(MovieMaker.class);
|
||||
imageFolderField.setText(prefs.get("movie.imageFolder", ""));
|
||||
soundFileField.setText(prefs.get("movie.soundFile", ""));
|
||||
widthField.setText("" + prefs.getInt("movie.width", 640));
|
||||
@@ -214,14 +214,14 @@ public class MovieMakerFrame extends JFrame implements Tool {
|
||||
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
// setVisible(false);
|
||||
System.exit(0);
|
||||
setVisible(false);
|
||||
// System.exit(0);
|
||||
}
|
||||
});
|
||||
registerWindowCloseKeys(getRootPane(), new ActionListener() {
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
// setVisible(false);
|
||||
System.exit(0);
|
||||
setVisible(false);
|
||||
// System.exit(0);
|
||||
}
|
||||
});
|
||||
setTitle("QuickTime Movie Maker");
|
||||
@@ -393,13 +393,13 @@ public class MovieMakerFrame extends JFrame implements Tool {
|
||||
FormListener() {}
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
if (evt.getSource() == chooseImageFolderButton) {
|
||||
MovieMakerFrame.this.chooseImageFolder(evt);
|
||||
MovieMaker.this.chooseImageFolder(evt);
|
||||
}
|
||||
else if (evt.getSource() == chooseSoundFileButton) {
|
||||
MovieMakerFrame.this.chooseSoundFile(evt);
|
||||
MovieMaker.this.chooseSoundFile(evt);
|
||||
}
|
||||
else if (evt.getSource() == createMovieButton) {
|
||||
MovieMakerFrame.this.createMovie(evt);
|
||||
MovieMaker.this.createMovie(evt);
|
||||
}
|
||||
// else if (evt.getSource() == fastStartCompressedRadio) {
|
||||
// MovieMaker.this.streamingRadioPerformed(evt);
|
||||
@@ -591,7 +591,7 @@ public class MovieMakerFrame extends JFrame implements Tool {
|
||||
if (o instanceof Throwable) {
|
||||
Throwable t = (Throwable) o;
|
||||
t.printStackTrace();
|
||||
JOptionPane.showMessageDialog(MovieMakerFrame.this, "<html>Creating the QuickTime Movie failed.<br>" + (t.getMessage() == null ? t.toString() : t.getMessage()), "Sorry", JOptionPane.ERROR_MESSAGE);
|
||||
JOptionPane.showMessageDialog(MovieMaker.this, "<html>Creating the QuickTime Movie failed.<br>" + (t.getMessage() == null ? t.toString() : t.getMessage()), "Sorry", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
createMovieButton.setEnabled(true);
|
||||
}
|
||||
@@ -608,7 +608,7 @@ public class MovieMakerFrame extends JFrame implements Tool {
|
||||
/** variable frame rate. */
|
||||
private void writeVideoOnlyVFR(File movieFile, File[] imgFiles, int width, int height, double fps, QuickTimeWriter.VideoFormat videoFormat, /*boolean passThrough,*/ String streaming) throws IOException {
|
||||
File tmpFile = streaming.equals("none") ? movieFile : new File(movieFile.getPath() + ".tmp");
|
||||
ProgressMonitor p = new ProgressMonitor(MovieMakerFrame.this, "Creating " + movieFile.getName(), "Creating Output File...", 0, imgFiles.length);
|
||||
ProgressMonitor p = new ProgressMonitor(MovieMaker.this, "Creating " + movieFile.getName(), "Creating Output File...", 0, imgFiles.length);
|
||||
Graphics2D g = null;
|
||||
BufferedImage img = null;
|
||||
BufferedImage prevImg = null;
|
||||
@@ -745,7 +745,7 @@ public class MovieMakerFrame extends JFrame implements Tool {
|
||||
File tmpFile = streaming.equals("none") ? movieFile : new File(movieFile.getPath() + ".tmp");
|
||||
|
||||
int length = (int) Math.min(Integer.MAX_VALUE, audioFile.length()); // file length is used for a rough progress estimate. This will only work for uncompressed audio.
|
||||
ProgressMonitor p = new ProgressMonitor(MovieMakerFrame.this, "Creating " + movieFile.getName(), "Initializing...", 0, length);
|
||||
ProgressMonitor p = new ProgressMonitor(MovieMaker.this, "Creating " + movieFile.getName(), "Initializing...", 0, length);
|
||||
AudioInputStream audioIn = null;
|
||||
QuickTimeWriter qtOut = null;
|
||||
|
||||
@@ -814,7 +814,7 @@ public class MovieMakerFrame extends JFrame implements Tool {
|
||||
|
||||
private void writeVideoAndAudio(File movieFile, File[] imgFiles, File audioFile, int width, int height, double fps, QuickTimeWriter.VideoFormat videoFormat, /*boolean passThrough,*/ String streaming) throws IOException {
|
||||
File tmpFile = streaming.equals("none") ? movieFile : new File(movieFile.getPath() + ".tmp");
|
||||
ProgressMonitor p = new ProgressMonitor(MovieMakerFrame.this, "Creating " + movieFile.getName(), "Creating Output File...", 0, imgFiles.length);
|
||||
ProgressMonitor p = new ProgressMonitor(MovieMaker.this, "Creating " + movieFile.getName(), "Creating Output File...", 0, imgFiles.length);
|
||||
AudioInputStream audioIn = null;
|
||||
QuickTimeWriter qtOut = null;
|
||||
BufferedImage imgBuffer = null;
|
||||
|
||||
7
todo.txt
7
todo.txt
@@ -38,10 +38,9 @@ X if no selection, attempt to expand the selection for Find in Reference
|
||||
X add cmd-shift-O to "Open Examples" on OS X with no window open
|
||||
X go through vida examples to make sure extra imports are not being used
|
||||
o do command line to run through all examples?
|
||||
|
||||
_ remove Quaqua
|
||||
_ http://code.google.com/p/processing/issues/detail?id=1509
|
||||
_ remove separate launch of QT movie creator
|
||||
X remove Quaqua
|
||||
X http://code.google.com/p/processing/issues/detail?id=1509
|
||||
X remove separate launch of QT movie creator
|
||||
|
||||
manindra
|
||||
M bug that was causing the Debugger to point to wrong break point line numbers
|
||||
|
||||
Reference in New Issue
Block a user