class
Opal::Asciicast::PlaybackEngine
- Opal::Asciicast::PlaybackEngine
- Reference
- Object
Overview
Playback and inspection engine for Asciinema v2 recordings.
Reconstructs terminal screens into UI::Buffer frames, supports
frame-by-frame stepping, seeking, speed multipliers, and overlay-respecting compositing.
Defined in:
opal/asciicast/playback_engine.crConstructors
-
.from_file(path : String) : self
Factory constructor from file path
-
.from_string(content : String) : self
Factory constructor from raw asciicast string
- .new(recording : Reader::Recording)
Instance Method Summary
-
#add_overlay(element : UI::Element, x : Int32, y : Int32, width : Int32, height : Int32) : self
Attaches a persistent overlay element to be composited over playback
-
#clear_overlays : self
Clears all persistent overlays
-
#current_buffer : UI::Buffer
Returns the current visual buffer
-
#current_frame : PlaybackFrame
Returns the current frame or a blank buffer if no frames exist
- #current_index : Int32
-
#current_timestamp : Float64
Returns the current timestamp in seconds
- #duration : Float64
- #empty? : Bool
- #frames : Array(PlaybackFrame)
-
#goto_frame(index : Int32) : PlaybackFrame
Seeks directly to a frame index
- #has_next? : Bool
- #has_prev? : Bool
- #height : Int32
- #looping=(looping : Bool)
- #looping? : Bool
-
#next_frame : PlaybackFrame
Advances to the next frame
- #pause : self
- #paused? : Bool
-
#play(speed : Float64 = 1.0, loop : Bool = false, &block : UI::Buffer, Int32 -> Nil) : Nil
Automated playback loop yielding each frame buffer and frame index
- #playing? : Bool
-
#prev_frame : PlaybackFrame
Steps back to the previous frame
- #recording : Reader::Recording
-
#render_frame(target : UI::Buffer, x : Int32 = 0, y : Int32 = 0, respect_overlays : Bool = false) : Nil
Composites the current playback frame into the target buffer.
- #resume : self
-
#rewind : PlaybackFrame
Rewinds playback to frame 0
-
#seek(timestamp_seconds : Float64) : PlaybackFrame
Seeks to the frame closest to the specified timestamp in seconds
- #speed : Float64
- #speed=(speed : Float64)
- #stop : self
- #total_frames : Int32
- #width : Int32
Constructor Detail
Instance Method Detail
Attaches a persistent overlay element to be composited over playback
Automated playback loop yielding each frame buffer and frame index
Composites the current playback frame into the target buffer.
If respect_overlays is true, does not overwrite non-space cells already in target.
Seeks to the frame closest to the specified timestamp in seconds