diff --git a/video/src/processing/video/MovieMaker.java b/video/src/processing/video/MovieMaker.java index c9b4ec921..48d649c55 100644 --- a/video/src/processing/video/MovieMaker.java +++ b/video/src/processing/video/MovieMaker.java @@ -51,6 +51,39 @@ import processing.core.*; * Library to create a QuickTime movie from a Processing pixel array. * Written by Daniel Shiffman. * Thanks to Dan O'Sullivan and Shawn Van Every. + *
+ * // Declare MovieMaker object
+ * MovieMaker mm;
+ *
+ * void setup() {
+ *   size(320, 240);
+ *
+ *   // Create MovieMaker object with size, filename,
+ *   // compression codec and quality, framerate
+ *   mm = new MovieMaker(this, width, height, "drawing.mov",
+ *                       MovieMaker.H263, MovieMaker.HIGH,30);
+ *   background(160, 32, 32);
+ * }
+ *
+ * void draw() {
+ *   stroke(7,146,168);
+ *   strokeWeight(4);
+ *   // Draw if mouse is pressed
+ *   if (mousePressed) {
+ *     line(pmouseX,pmouseY,mouseX,mouseY);
+ *   }
+ *
+ *   // Add window's pixels to movie
+ *   mm.add();
+ * }
+ *
+ * void keyPressed() {
+ *   // Finish the movie if space bar is pressed!
+ *   if (key == ' ') {
+ *     mm.finish();
+ *   }
+ * }
+ * 
*/ public class MovieMaker { @@ -107,10 +140,11 @@ public class MovieMaker { private PApplet parent; // Simple constructors that assume width and height is same as Processing Applet + /* public MovieMaker(PApplet p, String _filename) { this(p, p.width, p.height, _filename, 0, 0, 30, 15); } - + public MovieMaker(PApplet p, String _filename, int _codecType, int _codecQuality) { this(p, p.width, p.height,_filename, _codecType, _codecQuality, 30, 15); } @@ -118,6 +152,7 @@ public class MovieMaker { public MovieMaker(PApplet p, String _filename, int _codecType, int _codecQuality, int _rate) { this(p, p.width, p.height, _filename, _codecType, _codecQuality, _rate, 15); } + */ public MovieMaker(PApplet p, int _w, int _h, String _filename) { this(p, _w, _h, _filename, 0, 0, 30, 15); @@ -277,9 +312,9 @@ public class MovieMaker { e.printStackTrace(); } } - - - public void finishMovie() { + + + public void finish() { System.out.println("Finishing movie file."); try { readyForFrames = false; @@ -297,7 +332,7 @@ public class MovieMaker { //QTSession.close(); } - + public void dispose() { if (readyForFrames) finishMovie();