Class Recorder
java.lang.Object
org.openpatch.scratch.extensions.recorder.Recorder
- Direct Known Subclasses:
FFmpegRecorder
,FrameRecorder
,GifRecorder
The Recorder class provides a framework for recording frames to a file. It includes methods to
start and stop the recording process, and an abstract method saveFrame() that must be implemented
by subclasses to define the specific behavior for saving a frame.
This class is intended to be extended by other classes that provide concrete implementations for saving frames in different formats.
Example usage:
public class MyRecorder extends Recorder {
public MyRecorder(String path, String ext) {
super(path, ext);
}
@Override
public void saveFrame() {
// Implementation for saving a frame
}
}
Note: The Recorder class uses the Applet class to register a method that is called after each frame is drawn. This ensures that frames are saved at the appropriate time during the recording process.
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Recorder
Constructs a new Recorder object with the specified file path and extension. If the provided path does not end with the specified extension, the extension is appended to the path.- Parameters:
path
- the file path where the recording will be savedext
- the file extension to be used for the recording
-
-
Method Details
-
post
public void post()Called after each frame is drawn. This method is registered with the Applet class to ensure that frames are saved at the appropriate time during the recording process. -
saveFrame
public abstract void saveFrame()Saves the current frame. This method should be implemented by subclasses to define the specific behavior for saving a frame. -
start
public void start()Starts the recording process. -
stop
public void stop()Stops the recording process.
-