class
Opal::Asciicast::VCR
- Opal::Asciicast::VCR
- Reference
- Object
Overview
VCR-style tactile tape deck supporting programmatic and interactive recording and playback of asciicast sessions with multi-frame pacing and overlay awareness.
Defined in:
opal/asciicast/vcr.crConstructors
- .hold(seconds : Float64) : VCR
- .instance : VCR
- .load(path_or_content : String) : VCR
- .new
- .pause : VCR
-
.record(path : String, width : Int32 = 80, height : Int32 = 24, title : String = "Opal Session", term : String = "xterm-256color", &) : VCR
Delegate class-level methods to the global singleton instance
- .record(path : String, width : Int32 = 80, height : Int32 = 24, title : String = "Opal Session", term : String = "xterm-256color") : VCR
- .resume : VCR
- .skip_frames(count : Int32) : VCR
- .stop : VCR
- .type_text(text : String, cps : Float64 = 25.0) : VCR
- .wait_frames(count : Int32 = 1, delay_per_frame : Float64 = 0.05) : VCR
- .write_terminal(data : String, delay : Float64 = 0.0) : VCR
Class Method Summary
- .capture(buffer : UI::Buffer, advance : Float64 | Nil = nil) : Bool
- .current_buffer : UI::Buffer
- .duration : Float64
- .goto_frame(index : Int32) : PlaybackFrame
- .next_frame : PlaybackFrame
- .paused? : Bool
- .play(speed : Float64 = 1.0, loop : Bool = false, &block : UI::Buffer, Int32 -> Nil) : Nil
- .playing? : Bool
- .prev_frame : PlaybackFrame
- .recording? : Bool
- .render_frame(target : UI::Buffer, x : Int32 = 0, y : Int32 = 0, respect_overlays : Bool = false) : Nil
- .rewind : PlaybackFrame
- .save(path : String | Nil = nil) : Nil
- .screenshot(path : String | Nil = nil, format : Symbol = :ansi, buffer : UI::Buffer | Nil = nil, copy_to_clipboard : Bool = false) : String
- .screenshot_to_clipboard(format : Symbol = :text, buffer : UI::Buffer | Nil = nil) : String
- .seek(timestamp_seconds : Float64) : PlaybackFrame
- .total_frames : Int32
Instance Method Summary
-
#add_overlay(element : UI::Element, x : Int32, y : Int32, width : Int32, height : Int32) : self
Attaches a persistent overlay onto playback
-
#capture(buffer : UI::Buffer, advance : Float64 | Nil = nil) : Bool
Captures a screen buffer snapshot onto the current recording tape
- #clear_overlays : self
- #current_buffer : UI::Buffer
- #current_frame : PlaybackFrame
- #current_frame_index : Int32
- #current_timestamp : Float64
- #duration : Float64
- #elapsed : Float64
- #frame_count : Int32
- #goto_frame(index : Int32) : PlaybackFrame
- #has_next? : Bool
- #has_prev? : Bool
-
#hold(seconds : Float64) : self
Holds the current visual buffer for a specified duration in playback
-
#load(path_or_content : String) : self
Loads a recording file or raw content as a playback tape
-
#load(recording : Reader::Recording) : self
Loads an existing Reader::Recording directly
- #next_frame : PlaybackFrame
-
#pause : self
Pauses active recording or playback
- #paused? : Bool
-
#play(speed : Float64 = 1.0, loop : Bool = false, &block : UI::Buffer, Int32 -> Nil) : Nil
Automated playback loop yielding each frame buffer and index
- #player : PlaybackEngine | Nil
- #playing? : Bool
- #prev_frame : PlaybackFrame
-
#record(path : String, width : Int32 = 80, height : Int32 = 24, title : String = "Opal Session", term : String = "xterm-256color") : self
Starts recording to a destination .cast file
-
#record(path : String, width : Int32 = 80, height : Int32 = 24, title : String = "Opal Session", term : String = "xterm-256color", &) : self
Scoped block recording with automatic start, pacing, and save on exit
- #recorder : ScreenRecorder | Nil
- #recording? : Bool
-
#render_frame(target : UI::Buffer, x : Int32 = 0, y : Int32 = 0, respect_overlays : Bool = false) : Nil
Composites current playback frame into destination buffer, respecting existing overlays if requested
-
#resume : self
Resumes paused recording or playback
- #rewind : PlaybackFrame
-
#save(path : String | Nil = nil) : Nil
Saves the current recording tape to disk
-
#screenshot(path : String | Nil = nil, format : Symbol = :ansi, buffer : UI::Buffer | Nil = nil, copy_to_clipboard : Bool = false) : String
Captures a screenshot from the current recording/playback state or passed buffer.
-
#screenshot_to_clipboard(format : Symbol = :text, buffer : UI::Buffer | Nil = nil) : String
Captures a screenshot and copies it directly to the system clipboard.
- #seek(timestamp_seconds : Float64) : PlaybackFrame
-
#skip_frames(count : Int32) : self
Drops the next N frames from recording
- #state : State
-
#stop : self
Stops recording or playback
- #total_frames : Int32
-
#type_text(text : String, cps : Float64 = 25.0) : self
Simulates human keystroke typing directly to active recorder
-
#wait_frames(count : Int32 = 1, delay_per_frame : Float64 = 0.05) : self
Advances the recording timeline by N simulated frame durations
-
#write_terminal(data : String, delay : Float64 = 0.0) : self
Writes raw terminal output or control sequences directly to active recorder
Constructor Detail
Delegate class-level methods to the global singleton instance
Class Method Detail
Instance Method Detail
Attaches a persistent overlay onto playback
Captures a screen buffer snapshot onto the current recording tape
Holds the current visual buffer for a specified duration in playback
Loads a recording file or raw content as a playback tape
Loads an existing Reader::Recording directly
Automated playback loop yielding each frame buffer and index
Starts recording to a destination .cast file
Scoped block recording with automatic start, pacing, and save on exit
Composites current playback frame into destination buffer, respecting existing overlays if requested
Captures a screenshot from the current recording/playback state or passed buffer.
Captures a screenshot and copies it directly to the system clipboard.
Simulates human keystroke typing directly to active recorder
Advances the recording timeline by N simulated frame durations
Writes raw terminal output or control sequences directly to active recorder