class Opal::Asciicast::VCR

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.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.hold(seconds : Float64) : VCR #

[View source]
def self.instance : VCR #

[View source]
def self.load(path_or_content : String) : VCR #

[View source]
def self.new #

[View source]
def self.pause : VCR #

[View source]
def self.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


[View source]
def self.record(path : String, width : Int32 = 80, height : Int32 = 24, title : String = "Opal Session", term : String = "xterm-256color") : VCR #

[View source]
def self.resume : VCR #

[View source]
def self.skip_frames(count : Int32) : VCR #

[View source]
def self.stop : VCR #

[View source]
def self.type_text(text : String, cps : Float64 = 25.0) : VCR #

[View source]
def self.wait_frames(count : Int32 = 1, delay_per_frame : Float64 = 0.05) : VCR #

[View source]
def self.write_terminal(data : String, delay : Float64 = 0.0) : VCR #

[View source]

Class Method Detail

def self.capture(buffer : UI::Buffer, advance : Float64 | Nil = nil) : Bool #

[View source]
def self.current_buffer : UI::Buffer #

[View source]
def self.duration : Float64 #

[View source]
def self.goto_frame(index : Int32) : PlaybackFrame #

[View source]
def self.next_frame : PlaybackFrame #

[View source]
def self.paused? : Bool #

[View source]
def self.play(speed : Float64 = 1.0, loop : Bool = false, &block : UI::Buffer, Int32 -> Nil) : Nil #

[View source]
def self.playing? : Bool #

[View source]
def self.prev_frame : PlaybackFrame #

[View source]
def self.recording? : Bool #

[View source]
def self.render_frame(target : UI::Buffer, x : Int32 = 0, y : Int32 = 0, respect_overlays : Bool = false) : Nil #

[View source]
def self.rewind : PlaybackFrame #

[View source]
def self.save(path : String | Nil = nil) : Nil #

[View source]
def self.screenshot(path : String | Nil = nil, format : Symbol = :ansi, buffer : UI::Buffer | Nil = nil, copy_to_clipboard : Bool = false) : String #

[View source]
def self.screenshot_to_clipboard(format : Symbol = :text, buffer : UI::Buffer | Nil = nil) : String #

[View source]
def self.seek(timestamp_seconds : Float64) : PlaybackFrame #

[View source]
def self.total_frames : Int32 #

[View source]

Instance Method Detail

def add_overlay(element : UI::Element, x : Int32, y : Int32, width : Int32, height : Int32) : self #

Attaches a persistent overlay onto playback


[View source]
def capture(buffer : UI::Buffer, advance : Float64 | Nil = nil) : Bool #

Captures a screen buffer snapshot onto the current recording tape


[View source]
def clear_overlays : self #

[View source]
def current_buffer : UI::Buffer #

[View source]
def current_frame : PlaybackFrame #

[View source]
def current_frame_index : Int32 #

[View source]
def current_timestamp : Float64 #

[View source]
def duration : Float64 #

[View source]
def elapsed : Float64 #

[View source]
def frame_count : Int32 #

[View source]
def goto_frame(index : Int32) : PlaybackFrame #

[View source]
def has_next? : Bool #

[View source]
def has_prev? : Bool #

[View source]
def hold(seconds : Float64) : self #

Holds the current visual buffer for a specified duration in playback


[View source]
def load(path_or_content : String) : self #

Loads a recording file or raw content as a playback tape


[View source]
def load(recording : Reader::Recording) : self #

Loads an existing Reader::Recording directly


[View source]
def next_frame : PlaybackFrame #

[View source]
def pause : self #

Pauses active recording or playback


[View source]
def paused? : Bool #

[View source]
def play(speed : Float64 = 1.0, loop : Bool = false, &block : UI::Buffer, Int32 -> Nil) : Nil #

Automated playback loop yielding each frame buffer and index


[View source]
def player : PlaybackEngine | Nil #

[View source]
def playing? : Bool #

[View source]
def prev_frame : PlaybackFrame #

[View source]
def 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


[View source]
def 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


[View source]
def recorder : ScreenRecorder | Nil #

[View source]
def recording? : Bool #

[View source]
def 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


[View source]
def resume : self #

Resumes paused recording or playback


[View source]
def rewind : PlaybackFrame #

[View source]
def save(path : String | Nil = nil) : Nil #

Saves the current recording tape to disk


[View source]
def 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.


[View source]
def screenshot_to_clipboard(format : Symbol = :text, buffer : UI::Buffer | Nil = nil) : String #

Captures a screenshot and copies it directly to the system clipboard.


[View source]
def seek(timestamp_seconds : Float64) : PlaybackFrame #

[View source]
def skip_frames(count : Int32) : self #

Drops the next N frames from recording


[View source]
def state : State #

[View source]
def stop : self #

Stops recording or playback


[View source]
def total_frames : Int32 #

[View source]
def type_text(text : String, cps : Float64 = 25.0) : self #

Simulates human keystroke typing directly to active recorder


[View source]
def wait_frames(count : Int32 = 1, delay_per_frame : Float64 = 0.05) : self #

Advances the recording timeline by N simulated frame durations


[View source]
def write_terminal(data : String, delay : Float64 = 0.0) : self #

Writes raw terminal output or control sequences directly to active recorder


[View source]