mirror of
https://github.com/processing/processing4.git
synced 2026-06-08 00:20:51 +02:00
fix up broken tool setup, also wrapping up moviemaker mess
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
0200 android
|
||||
X fix BufferedHttpEntity problem
|
||||
X was trying to allocate a byte buffer for entire size of HTTP file
|
||||
|
||||
|
||||
0199 android
|
||||
X tries to create and AVD when running on the phone.. why?
|
||||
X this is a real problem, causes lots of crashing on startup
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
0200 android
|
||||
X fix BufferedHttpEntity problem
|
||||
X was trying to allocate a byte buffer for entire size of HTTP file
|
||||
0201 android
|
||||
|
||||
|
||||
_ remove 'processing.test' package--people are posting on the market w/ it
|
||||
_ Android mode does not recognize library imports
|
||||
|
||||
@@ -44,9 +44,9 @@ import processing.core.*;
|
||||
* files and images, etc) that comes from that.
|
||||
*/
|
||||
public class Base {
|
||||
static public final int REVISION = 200;
|
||||
static public final int REVISION = 201;
|
||||
/** This might be replaced by main() if there's a lib/version.txt file. */
|
||||
static public String VERSION_NAME = "0200";
|
||||
static public String VERSION_NAME = "0201";
|
||||
/** Set true if this a proper release rather than a numbered revision. */
|
||||
static public boolean RELEASE = false;
|
||||
/** True if heavy debugging error/log messages are enabled */
|
||||
@@ -68,7 +68,7 @@ public class Base {
|
||||
platformIndices.put("linux", PConstants.LINUX);
|
||||
}
|
||||
static Platform platform;
|
||||
|
||||
|
||||
/** How many bits this machine is */
|
||||
static int nativeBits;
|
||||
static {
|
||||
@@ -124,7 +124,7 @@ public class Base {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
static private void createAndShowGUI(String[] args) {
|
||||
try {
|
||||
File versionFile = getContentFile("lib/version.txt");
|
||||
@@ -152,7 +152,7 @@ public class Base {
|
||||
|
||||
// run static initialization that grabs all the prefs
|
||||
Preferences.init(null);
|
||||
|
||||
|
||||
String filename = args.length > 1 ? args[0] : null;
|
||||
if (!(Preferences.get("server.port") == null)
|
||||
&& sendArgumentsToOtherInstance(filename, 1000)) {
|
||||
@@ -185,7 +185,7 @@ public class Base {
|
||||
"Could not create a place to store untitled sketches.\n" +
|
||||
"That's gonna prevent us from continuing.", e);
|
||||
}
|
||||
|
||||
|
||||
// System.out.println("about to create base...");
|
||||
new Base(args);
|
||||
// System.out.println("done creating base...");
|
||||
@@ -199,18 +199,18 @@ public class Base {
|
||||
final String key = "" + Math.random();
|
||||
Preferences.set("server.key", key);
|
||||
Preferences.save();
|
||||
|
||||
|
||||
new Thread(new Runnable() {
|
||||
|
||||
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
Socket s = ss.accept();
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
|
||||
String receivedKey = br.readLine();
|
||||
|
||||
|
||||
if (platform.base == null) continue;
|
||||
|
||||
|
||||
if (key.equals(receivedKey)) {
|
||||
final String filename = br.readLine();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@@ -231,7 +231,7 @@ public class Base {
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static private boolean sendArgumentsToOtherInstance(String filename,
|
||||
long timeout) {
|
||||
try {
|
||||
@@ -322,11 +322,11 @@ public class Base {
|
||||
Mode javaScriptMode = ModeContribution
|
||||
.getCoreMode(this, "processing.mode.javascript.JavaScriptMode",
|
||||
getContentFile("modes/javascript"));
|
||||
|
||||
|
||||
coreModes = new Mode[] { defaultMode, androidMode, javaScriptMode };
|
||||
}
|
||||
|
||||
/** Instantiates and adds new contributed modes to the contribModes list.
|
||||
|
||||
/** Instantiates and adds new contributed modes to the contribModes list.
|
||||
* Checks for duplicates so the same mode isn't instantiates twice. Does not
|
||||
* remove modes because modes can't be removed once they are instantiated */
|
||||
void rebuildContribModes() {
|
||||
@@ -347,7 +347,7 @@ public class Base {
|
||||
public Base(String[] args) {
|
||||
// Get the sketchbook path, and make sure it's set properly
|
||||
determineSketchbookFolder();
|
||||
|
||||
|
||||
// Delete all modes and tools that have been flagged for deletion before
|
||||
// they are initialized by an editor.
|
||||
ArrayList<InstalledContribution> contribs = new ArrayList<InstalledContribution>();
|
||||
@@ -358,12 +358,12 @@ public class Base {
|
||||
removeDir(contrib.getFolder());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
buildCoreModes();
|
||||
rebuildContribModes();
|
||||
|
||||
|
||||
contributionManagerFrame = new ContributionManager();
|
||||
|
||||
|
||||
// Make sure ThinkDifferent has library examples too
|
||||
defaultMode.rebuildLibraryList();
|
||||
|
||||
@@ -1135,7 +1135,7 @@ public class Base {
|
||||
|
||||
Preferences.unset("server.port");
|
||||
Preferences.unset("server.key");
|
||||
|
||||
|
||||
// This will store the sketch count as zero
|
||||
editors.remove(editor);
|
||||
storeSketches();
|
||||
@@ -1551,12 +1551,12 @@ public class Base {
|
||||
public void handleOpenContributionManager() {
|
||||
contributionManagerFrame.showFrame(activeEditor);
|
||||
}
|
||||
|
||||
|
||||
public void handleShowUpdates() {
|
||||
contributionManagerFrame.showFrame(activeEditor);
|
||||
contributionManagerFrame.setFilterText("has:updates");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Installed the libraries in the given file after a confirmation from the
|
||||
* user. Returns the number of libraries installed.
|
||||
@@ -1606,12 +1606,12 @@ public class Base {
|
||||
static public int getNativeBits() {
|
||||
return nativeBits;
|
||||
}
|
||||
|
||||
|
||||
static public String getPlatformVersionName() {
|
||||
String version = System.getProperty("os.version");
|
||||
|
||||
if (version != null) {
|
||||
|
||||
|
||||
if (Base.isMacOS()) {
|
||||
if (version.startsWith("10.0"))
|
||||
return "cheetah";
|
||||
@@ -1630,17 +1630,17 @@ public class Base {
|
||||
if (version.startsWith("10.7"))
|
||||
return "lion";
|
||||
}
|
||||
|
||||
|
||||
if (Base.isWindows()) {
|
||||
if (version.startsWith("6.0"))
|
||||
return "vista";
|
||||
|
||||
|
||||
// yes, windows 7 is really windows 6.1
|
||||
if (version.startsWith("6.1"))
|
||||
return "7";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -1844,7 +1844,7 @@ public class Base {
|
||||
sketchbookFolder.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getSketchbookLibrariesFolder().mkdir();
|
||||
getSketchbookToolsFolder().mkdir();
|
||||
getSketchbookModesFolder().mkdir();
|
||||
@@ -1874,7 +1874,7 @@ public class Base {
|
||||
public File getSketchbookToolsFolder() {
|
||||
return new File(sketchbookFolder, "tools");
|
||||
}
|
||||
|
||||
|
||||
public File getSketchbookModesFolder() {
|
||||
// return new File(getSketchbookFolder(), "libraries");
|
||||
return new File(sketchbookFolder, "modes");
|
||||
|
||||
@@ -894,7 +894,13 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
String title = tool.getMenuTitle();
|
||||
JMenuItem item = new JMenuItem(title);
|
||||
item.addActionListener(new ActionListener() {
|
||||
boolean inited;
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (!inited) {
|
||||
tool.init(Editor.this);
|
||||
inited = true;
|
||||
}
|
||||
SwingUtilities.invokeLater(tool);
|
||||
//new Thread(tool).start();
|
||||
}
|
||||
|
||||
@@ -49,8 +49,7 @@ import processing.app.tools.Tool;
|
||||
// http://code.google.com/p/processing/issues/detail?id=836
|
||||
// + the None compressor seems to have bugs, so just disabled it instead.
|
||||
// + the 'pass through' option seems to be broken, it's been removed, and in
|
||||
// its place is an option to use the same width and height as the original
|
||||
// images. however, the code has not been refactored with the new name.
|
||||
// its place is an option to use the same width and height as the originals.
|
||||
// + when this new 'pass through' is set, there's some nastiness with how
|
||||
// the 'final' width/height variables are passed to the movie maker.
|
||||
// this is an easy fix but needs a couple minutes.
|
||||
@@ -64,7 +63,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
private JFileChooser soundFileChooser;
|
||||
private JFileChooser movieFileChooser;
|
||||
private Preferences prefs;
|
||||
|
||||
|
||||
// private Editor editor;
|
||||
|
||||
//MovieMaker m = new MovieMaker();
|
||||
@@ -75,13 +74,15 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
return "Movie Maker";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void run() {
|
||||
// System.out.println("calling run() for MovieMaker");
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void init(Editor editor) {
|
||||
// System.out.println("calling init for MovieMaker");
|
||||
// this.editor = editor;
|
||||
initComponents();
|
||||
|
||||
@@ -103,7 +104,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
widthLabel,
|
||||
heightField,
|
||||
heightLabel,
|
||||
passThroughCheckBox,
|
||||
originalSizeCheckBox,
|
||||
// noPreparationRadio,
|
||||
// fastStartCompressedRadio,
|
||||
// fastStartRadio
|
||||
@@ -118,21 +119,21 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
soundFileField.setText(prefs.get("movie.soundFile", ""));
|
||||
widthField.setText("" + prefs.getInt("movie.width", 640));
|
||||
heightField.setText("" + prefs.getInt("movie.height", 480));
|
||||
passThroughCheckBox.setSelected(prefs.getBoolean("movie.passThrough", false));
|
||||
originalSizeCheckBox.setSelected(prefs.getBoolean("movie.originalSize", false));
|
||||
String fps = "" + prefs.getDouble("movie.fps", 30);
|
||||
if (fps.endsWith(".0")) {
|
||||
fps = fps.substring(0, fps.length() - 2);
|
||||
}
|
||||
fpsField.setText(fps);
|
||||
compressionBox.setSelectedIndex(Math.max(0, Math.min(compressionBox.getItemCount() - 1, prefs.getInt("movie.compression", 1))));
|
||||
compressionBox.setSelectedIndex(Math.max(0, Math.min(compressionBox.getItemCount() - 1, prefs.getInt("movie.compression", 0))));
|
||||
|
||||
passThroughCheckBox.addActionListener(new ActionListener() {
|
||||
originalSizeCheckBox.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
widthField.setEnabled(passThroughCheckBox.isSelected());
|
||||
heightField.setEnabled(passThroughCheckBox.isSelected());
|
||||
widthField.setEnabled(originalSizeCheckBox.isSelected());
|
||||
heightField.setEnabled(originalSizeCheckBox.isSelected());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// String streaming = prefs.get("movie.streaming", "fastStartCompressed");
|
||||
// for (Enumeration<AbstractButton> i = streamingGroup.getElements(); i.hasMoreElements();) {
|
||||
// AbstractButton btn = i.nextElement();
|
||||
@@ -141,11 +142,14 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// scoot everybody around
|
||||
pack();
|
||||
// center the frame on screen
|
||||
setLocationRelativeTo(null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initComponents() {
|
||||
imageFolderHelpLabel = new JLabel();
|
||||
imageFolderField = new JTextField();
|
||||
@@ -162,7 +166,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
compressionBox = new JComboBox();
|
||||
fpsLabel = new JLabel();
|
||||
fpsField = new JTextField();
|
||||
passThroughCheckBox = new JCheckBox();
|
||||
originalSizeCheckBox = new JCheckBox();
|
||||
// streamingLabel = new JLabel();
|
||||
// streamingGroup = new ButtonGroup();
|
||||
// noPreparationRadio = new JRadioButton();
|
||||
@@ -173,15 +177,15 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
public void windowClosing(WindowEvent e) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
Base.registerWindowCloseKeys(getRootPane(), new ActionListener() {
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
setTitle("QuickTime Movie Maker");
|
||||
|
||||
aboutLabel =
|
||||
@@ -199,7 +203,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
"<br>" +
|
||||
"<font color=#808080>This code is based on QuickTime Movie Maker 1.5.1 2011-01-17.<br>" +
|
||||
"Copyright © 2010-2011 Werner Randelshofer. All rights reserved.<br>" +
|
||||
"This software is licensed under Creative Commons Atribution 3.0.");
|
||||
"This software is licensed under Creative Commons Atribution 3.0.");
|
||||
|
||||
imageFolderHelpLabel.setText("Drag a folder with image files into the field below:");
|
||||
chooseImageFolderButton.setText("Choose...");
|
||||
@@ -213,7 +217,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
createMovieButton.addActionListener(formListener);
|
||||
|
||||
Font font = new Font("Dialog", Font.PLAIN, 11);
|
||||
|
||||
|
||||
widthLabel.setFont(font);
|
||||
widthLabel.setText("Width:");
|
||||
widthField.setColumns(4);
|
||||
@@ -238,9 +242,9 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
fpsField.setFont(font);
|
||||
fpsField.setText("30");
|
||||
|
||||
passThroughCheckBox.setFont(font);
|
||||
passThroughCheckBox.setText("Same size as originals");
|
||||
passThroughCheckBox.setToolTipText("Check this box if the folder contains already encoded video frames in the desired size.");
|
||||
originalSizeCheckBox.setFont(font);
|
||||
originalSizeCheckBox.setText("Same size as originals");
|
||||
originalSizeCheckBox.setToolTipText("Check this box if the folder contains already encoded video frames in the desired size.");
|
||||
|
||||
// streamingLabel.setText("Prepare for Internet Streaming");
|
||||
//
|
||||
@@ -282,7 +286,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
.addGap(1, 1, 1)
|
||||
.addComponent(compressionBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(passThroughCheckBox))
|
||||
.addComponent(originalSizeCheckBox))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(widthField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
@@ -330,7 +334,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
.addComponent(fpsLabel)
|
||||
.addComponent(fpsField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(compressionLabel)
|
||||
.addComponent(passThroughCheckBox))
|
||||
.addComponent(originalSizeCheckBox))
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(soundFileHelpLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
@@ -400,12 +404,12 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this is super naughty, and shouldn't be out here. it's a hack to get the
|
||||
// ImageIcon width/height setting to work. there are better ways to do this
|
||||
// given a bit of time. you know, time? the infinite but non-renewable resource?
|
||||
int width, height;
|
||||
|
||||
|
||||
private void createMovie(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createMovie
|
||||
// ---------------------------------
|
||||
// Check input
|
||||
@@ -459,7 +463,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
prefs.putInt("movie.height", height);
|
||||
prefs.putDouble("movie.fps", fps);
|
||||
prefs.putInt("movie.compression", compressionBox.getSelectedIndex());
|
||||
prefs.putBoolean("movie.passThrough", passThroughCheckBox.isSelected());
|
||||
prefs.putBoolean("movie.originalSize", originalSizeCheckBox.isSelected());
|
||||
|
||||
|
||||
// ---------------------------------
|
||||
@@ -487,7 +491,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
prefs.put("movie.outputFile", movieFile.getPath());
|
||||
createMovieButton.setEnabled(false);
|
||||
|
||||
final boolean passThrough = passThroughCheckBox.isSelected();
|
||||
final boolean originalSize = originalSizeCheckBox.isSelected();
|
||||
|
||||
// ---------------------------------
|
||||
// Create the QuickTime movie
|
||||
@@ -513,7 +517,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
}
|
||||
|
||||
// Check on first image, if we can actually do pass through
|
||||
if (passThrough) {
|
||||
if (originalSize) {
|
||||
ImageIcon temp = new ImageIcon(imgFiles[0].getAbsolutePath());
|
||||
width = temp.getIconWidth();
|
||||
height = temp.getIconHeight();
|
||||
@@ -923,7 +927,7 @@ public class MovieMaker extends JFrame implements Tool {
|
||||
private JTextField imageFolderField;
|
||||
private JLabel imageFolderHelpLabel;
|
||||
// private JRadioButton noPreparationRadio;
|
||||
private JCheckBox passThroughCheckBox;
|
||||
private JCheckBox originalSizeCheckBox;
|
||||
private JTextField soundFileField;
|
||||
private JLabel soundFileHelpLabel;
|
||||
// private ButtonGroup streamingGroup;
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
0200 core
|
||||
X remove textMode(SCREEN)
|
||||
X added expand(long) and expand(double) because of Table
|
||||
X PImage.save() with full path raises exception
|
||||
X http://code.google.com/p/processing/issues/detail?id=808
|
||||
X update wiki re: PNode... also include notes about the changes
|
||||
X add note about textMode(SCREEN) to the wiki
|
||||
|
||||
|
||||
0199 core
|
||||
X pnode: look more closely at json and xml compatibility
|
||||
X argh, dumb mistake that broke SVG loading with loadNode()
|
||||
|
||||
+3
-9
@@ -1,12 +1,6 @@
|
||||
0200 core
|
||||
X remove textMode(SCREEN)
|
||||
X added expand(long) and expand(double) because of Table
|
||||
X PImage.save() with full path raises exception
|
||||
X http://code.google.com/p/processing/issues/detail?id=808
|
||||
X update wiki re: PNode... also include notes about the changes
|
||||
X add note about textMode(SCREEN) to the wiki
|
||||
|
||||
_ moviemaker built into core to write uncompressed frames? or PNG?
|
||||
0201 core
|
||||
o moviemaker built into core to write uncompressed frames? or PNG?
|
||||
X doing this via a tool instead
|
||||
|
||||
_ change how beginRecord() works.. passing around PApplet vs PGraphics is gross
|
||||
_ have to pass PApplet just to make the rendering work to both renderers
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
0200 pde
|
||||
X update to java 6u26
|
||||
X re-upload with new version to include javac
|
||||
X HTML escapes for < and > not working properly
|
||||
X http://code.google.com/p/processing/issues/detail?id=771
|
||||
X code to quit if multiple instances are running from peter
|
||||
X another problem with missing shearX/Y() in JAVA2D
|
||||
X http://code.google.com/p/processing/issues/detail?id=784
|
||||
|
||||
|
||||
0199 pde
|
||||
X remove error messages for UpdateCheck w/o internet connection
|
||||
X 'u' breaks sketches in 0198
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
0200 pde
|
||||
X update to java 6u26
|
||||
X re-upload with new version to include javac
|
||||
X HTML escapes for < and > not working properly
|
||||
X http://code.google.com/p/processing/issues/detail?id=771
|
||||
X code to quit if multiple instances are running from peter
|
||||
X another problem with missing shearX/Y() in JAVA2D
|
||||
X http://code.google.com/p/processing/issues/detail?id=784
|
||||
0201 pde
|
||||
X implement movie maker tool
|
||||
X http://code.google.com/p/processing/issues/detail?id=836
|
||||
X add movie maker tool to the build scripts
|
||||
|
||||
_ add movie maker tool to the build scripts
|
||||
_ move Movie Maker out to its own separate tool package
|
||||
_ http://code.google.com/p/processing/issues/detail?id=837
|
||||
|
||||
_ don't show library conflict warning until someone tries to build code
|
||||
_ too many people seem to think this is an error
|
||||
|
||||
Reference in New Issue
Block a user