artisynth.core.moviemaker
Class MovieMaker

java.lang.Object
  extended by artisynth.core.moviemaker.MovieMaker

public class MovieMaker
extends java.lang.Object


Field Summary
static java.lang.String ANIMATED_GIF_METHOD
           
static java.lang.String AVCONV_METHOD
           
static java.lang.String FFMPEG_METHOD
           
static java.lang.String INTERNAL_METHOD
           
static java.lang.String MENCODER_METHOD
           
static java.lang.String MENCODER_OSX_METHOD
           
static int OFFSCREEN_MODE
           
static int ONSCREEN_MODE
           
 
Constructor Summary
MovieMaker(GLViewer viewer)
           
 
Method Summary
 void addMethod(java.lang.String methodName, java.lang.String methodCmd, java.lang.String imgFmt)
           
 void clean()
          Remove the image files created in the specified directory after a movie has been made.
 int close()
          Writes movie information file.
 void closeDialog()
          Hides MovieMakerDialog.
 void forceGrab()
          Grabs rectangle and writes to disk right now, forcing a rerender (as opposed to waiting for next render cycle).
 java.lang.String getAudioFileName()
          Returns the path name of the current audio file.
 double getAudioSampleRate()
          Returns the audio sampling rate in Hz.
 java.awt.Rectangle getCaptureArea()
          Returns the area defining the movie region.
 java.lang.String getDataPath()
          Returns the path name of the directory where capture and movie files are to be stored.
 java.lang.String getFormat()
          Returns the output format.
 java.lang.String getFrameFileName(int n)
          Returns the absolute file path of the frame specified by int n.
 double getFrameRate()
          Returns the current frame rate in Hz.
 int getGrabMode()
           
 java.lang.String getMethod()
          Returns current movie making method name.
 java.util.HashMap<java.lang.String,artisynth.core.moviemaker.MovieMaker.Method> getMethodMap()
          Returns the HashMap of method names mapping to method information.
 double getSpeed()
          Returns the video speed.
 void grab()
          Grabs rectangle and writes to disk.
 void grab(java.lang.String filename)
          Grabs rectangle and writes to disk.
 void grabScreenShot(java.lang.String filename)
           
 boolean isAlwaysOnTop()
           
 boolean isAudioNormalized()
          Returns true if audio must be normalized.
 boolean isGrabbing()
          Returns true if currently grabbing frames.
 boolean isRenderingAudioToFile()
          Returns true if currently rendering audio to a file.
 boolean isRenderingAudioToText()
          Returns true if currently rendering audio to text.
 void render(java.lang.String fn)
          Renders captured data to a movie with the specified file name.
 void resetFrameCounter()
           
 void saveFirstFrame(java.lang.String fn)
          Saves the first image file in the same directory as the movie.
 void setAlwaysOnTop(boolean set)
           
 void setAntiAliasingSamples(int s)
           
 void setAudioFileName(java.lang.String fileName)
          Sets the path name for the audio save file.
 void setAudioNormalized(boolean normalize)
          Sets whether audio must be normalized.
 void setAudioSampleRate(double rate)
          Sets the audio sampling rate in Hz.
 void setCaptureArea(java.awt.Rectangle rect, java.awt.Dimension resizeDim, boolean viewerMode)
          Sets the rectangle defining the movie region and what dimensions to capture the movie to; resizeDim should only be set if rendering from a GL canvas, otherwise null.
 void setDataPath(java.lang.String path)
          Sets the path name of the the directory where capture and movie files are to be stored.
 void setFormat(java.lang.String fmt)
          Sets the output format.
 void setFrameRate(double rate)
          Sets the current frame rate in Hz.
 void setGrabbing(boolean grabbing)
          Sets whether the MovieMaker is currently grabbing frames.
 void setMethod(java.lang.String methodName)
          Sets movie making method.
 void setMethod(java.lang.String methodName, java.lang.String methodCmd, java.lang.String imgFmt)
          Sets movie making method.
 void setRenderingAudioToFile(boolean rendering)
          Sets whether the MovieMaker is currently rendering audio to a file.
 void setRenderingAudioToText(boolean rendering)
          Sets whether the MovieMaker is currently rendering audio to text.
 void setSpeed(double s)
          Sets the video speed.
 void showDialog(java.awt.Window win)
          Displays MovieMakerDialog to the right of the specified window.
 void updateForNewRootModel(java.lang.String modelName, RootModel root)
          Update MovieMakerDialog for new model name and audio capabilities.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERNAL_METHOD

public static final java.lang.String INTERNAL_METHOD
See Also:
Constant Field Values

MENCODER_METHOD

public static final java.lang.String MENCODER_METHOD
See Also:
Constant Field Values

MENCODER_OSX_METHOD

public static final java.lang.String MENCODER_OSX_METHOD
See Also:
Constant Field Values

FFMPEG_METHOD

public static final java.lang.String FFMPEG_METHOD
See Also:
Constant Field Values

ANIMATED_GIF_METHOD

public static final java.lang.String ANIMATED_GIF_METHOD
See Also:
Constant Field Values

AVCONV_METHOD

public static final java.lang.String AVCONV_METHOD
See Also:
Constant Field Values

OFFSCREEN_MODE

public static final int OFFSCREEN_MODE
See Also:
Constant Field Values

ONSCREEN_MODE

public static final int ONSCREEN_MODE
See Also:
Constant Field Values
Constructor Detail

MovieMaker

public MovieMaker(GLViewer viewer)
           throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getMethodMap

public java.util.HashMap<java.lang.String,artisynth.core.moviemaker.MovieMaker.Method> getMethodMap()
Returns the HashMap of method names mapping to method information.


setMethod

public void setMethod(java.lang.String methodName)
Sets movie making method. Must be one of: "internal", "mencoder", "mencoder_osx", "ffmpeg", "animated_gif" or "avconv".


setMethod

public void setMethod(java.lang.String methodName,
                      java.lang.String methodCmd,
                      java.lang.String imgFmt)
Sets movie making method. Must be one of: "internal", "mencoder", "mencoder_osx", "ffmpeg", "animated_gif" or "avconv".


addMethod

public void addMethod(java.lang.String methodName,
                      java.lang.String methodCmd,
                      java.lang.String imgFmt)

getMethod

public java.lang.String getMethod()
Returns current movie making method name.


getFormat

public java.lang.String getFormat()
Returns the output format.


setFormat

public void setFormat(java.lang.String fmt)
Sets the output format. Useful ones include "jpg" and "bmp". ImageIO.getWriterFormatNames() gives a complete list.


getFrameFileName

public java.lang.String getFrameFileName(int n)
Returns the absolute file path of the frame specified by int n.


resetFrameCounter

public void resetFrameCounter()

grab

public void grab()
          throws java.lang.Exception
Grabs rectangle and writes to disk.

Throws:
java.lang.Exception

forceGrab

public void forceGrab()
               throws java.lang.Exception
Grabs rectangle and writes to disk right now, forcing a rerender (as opposed to waiting for next render cycle).

Throws:
java.lang.Exception

grabScreenShot

public void grabScreenShot(java.lang.String filename)

grab

public void grab(java.lang.String filename)
          throws java.lang.Exception
Grabs rectangle and writes to disk.

Throws:
java.lang.Exception

close

public int close()
          throws java.lang.Exception
Writes movie information file.

Throws:
java.lang.Exception

render

public void render(java.lang.String fn)
            throws java.lang.Exception
Renders captured data to a movie with the specified file name.

Throws:
java.lang.Exception

saveFirstFrame

public void saveFirstFrame(java.lang.String fn)
Saves the first image file in the same directory as the movie.


clean

public void clean()
Remove the image files created in the specified directory after a movie has been made.


getAudioSampleRate

public double getAudioSampleRate()
Returns the audio sampling rate in Hz.


setAudioSampleRate

public void setAudioSampleRate(double rate)
Sets the audio sampling rate in Hz. Default rate is 44100Hz.


isAudioNormalized

public boolean isAudioNormalized()
Returns true if audio must be normalized.


setAudioNormalized

public void setAudioNormalized(boolean normalize)
Sets whether audio must be normalized.


getSpeed

public double getSpeed()
Returns the video speed.


setSpeed

public void setSpeed(double s)
Sets the video speed. A speed of 2 will create a movie that runs twice as fast as real time. The default speed is 1.


isGrabbing

public boolean isGrabbing()
Returns true if currently grabbing frames.


setGrabbing

public void setGrabbing(boolean grabbing)
Sets whether the MovieMaker is currently grabbing frames.


isRenderingAudioToFile

public boolean isRenderingAudioToFile()
Returns true if currently rendering audio to a file.


setRenderingAudioToFile

public void setRenderingAudioToFile(boolean rendering)
Sets whether the MovieMaker is currently rendering audio to a file.


isRenderingAudioToText

public boolean isRenderingAudioToText()
Returns true if currently rendering audio to text.


setRenderingAudioToText

public void setRenderingAudioToText(boolean rendering)
Sets whether the MovieMaker is currently rendering audio to text.


getCaptureArea

public java.awt.Rectangle getCaptureArea()
Returns the area defining the movie region.


setCaptureArea

public void setCaptureArea(java.awt.Rectangle rect,
                           java.awt.Dimension resizeDim,
                           boolean viewerMode)
Sets the rectangle defining the movie region and what dimensions to capture the movie to; resizeDim should only be set if rendering from a GL canvas, otherwise null.


setAntiAliasingSamples

public void setAntiAliasingSamples(int s)

getGrabMode

public int getGrabMode()

getAudioFileName

public java.lang.String getAudioFileName()
Returns the path name of the current audio file.


setAudioFileName

public void setAudioFileName(java.lang.String fileName)
Sets the path name for the audio save file.


getFrameRate

public double getFrameRate()
Returns the current frame rate in Hz.


setFrameRate

public void setFrameRate(double rate)
Sets the current frame rate in Hz.


getDataPath

public java.lang.String getDataPath()
Returns the path name of the directory where capture and movie files are to be stored.


setDataPath

public void setDataPath(java.lang.String path)
Sets the path name of the the directory where capture and movie files are to be stored.


showDialog

public void showDialog(java.awt.Window win)
Displays MovieMakerDialog to the right of the specified window.


closeDialog

public void closeDialog()
Hides MovieMakerDialog.


updateForNewRootModel

public void updateForNewRootModel(java.lang.String modelName,
                                  RootModel root)
Update MovieMakerDialog for new model name and audio capabilities.


isAlwaysOnTop

public boolean isAlwaysOnTop()

setAlwaysOnTop

public void setAlwaysOnTop(boolean set)