class
Opal::Asciicast::ScreenRecorder
- Opal::Asciicast::ScreenRecorder
- Reference
- Object
Overview
Screen recorder that captures Opal::UI::Buffer frames directly into
standard Asciinema v2 (.cast) files without flicker or terminal diff artifacts.
Defined in:
opal/asciicast/screen_recorder.crConstructors
Instance Method Summary
- #active? : Bool
-
#capture_frame(buffer : UI::Buffer, advance : Float64 | Nil = nil) : Bool
Captures a screen buffer frame directly.
- #current_time : Float64
- #frame_count : Int32
-
#hold(seconds : Float64) : self
Freezes/holds the current visual frame for a given number of seconds in playback.
- #last_captured_buffer : UI::Buffer | Nil
- #output_path : String
- #output_path=(output_path : String)
-
#pause : self
Pauses recording.
- #paused? : Bool
-
#record(&block : ScreenRecorder -> Nil) : Nil
Convenience scoped recording block.
- #recording? : Bool
-
#resume : self
Resumes recording after being paused.
-
#save(path : String | Nil = nil) : Nil
Saves the recording to disk.
-
#screenshot(path : String | Nil = nil, format : Symbol = :ansi, buffer : UI::Buffer | Nil = nil, copy_to_clipboard : Bool = false) : String
Captures a screenshot of the last recorded frame (or the passed buffer).
-
#screenshot_to_clipboard(format : Symbol = :text, buffer : UI::Buffer | Nil = nil) : String
Captures a screenshot of the last recorded frame and copies it to the system clipboard.
-
#skip_frames(count : Int32) : self
Instructs the recorder to discard the next N captured frames.
- #skip_frames_remaining : Int32
- #skip_frames_remaining=(skip_frames_remaining : Int32)
-
#start : self
Starts the recording session
-
#stop : self
Stops the recording session and saves the .cast file.
-
#type_text(text : String, cps : Float64 = 25.0) : self
Simulates human keystroke typing directly to the recording timeline.
-
#wait_frames(count : Int32 = 1, delay_per_frame : Float64 = 0.05) : self
Advances the recording timeline by simulating N frames.
-
#write_terminal(data : String, delay : Float64 = 0.0) : self
Writes raw terminal output or control sequences directly to the recording timeline.
- #writer : Writer
Constructor Detail
Instance Method Detail
Captures a screen buffer frame directly.
If advance is not specified, calculates elapsed wall-clock time since last frame.
Freezes/holds the current visual frame for a given number of seconds in playback.
Convenience scoped recording block. Automatically starts and stops recording.
Saves the recording to disk. If path is provided, overrides @output_path.
Captures a screenshot of the last recorded frame (or the passed buffer).
Captures a screenshot of the last recorded frame and copies it to the system clipboard.
Instructs the recorder to discard the next N captured frames.
Simulates human keystroke typing directly to the recording timeline.
Advances the recording timeline by simulating N frames.
Writes raw terminal output or control sequences directly to the recording timeline.