Expand description
§ravenrs-movie
Training videos of a RavenRS app, small enough to ship inside it.
A film here has no pixels. It stores what the app drew, the same rectangles and shaped text the renderer gets, so it stays sharp at any size and zoom, and a minute costs kilobytes instead of megabytes. Built-in fonts are referenced, not copied.
Recording runs the real app from a script. The script clicks by the names screen readers see, so it needs no GPU and no permission from the system, and it runs again when the screens change.
use ravenrs_movie::Recorder;
let mut take = Recorder::new(app, Theme::raven_light(), Size::new(1200.0, 760.0));
take.chapter("A new expense", "How to write down what you spent.");
take.note("Balance", "Your balance", "The sum of all accounts.", 2.0)?;
take.guide("New", "Open the menu", "Click New to begin.")?;
take.click("New")?;
take.type_into("Description", "Groceries")?;
std::fs::write("manual.ravenmovie", take.finish()?.to_bytes())?;Editing is non-destructive, in the style of a screen-recording editor. A Project is a list of
clips and of overlays on tracks: cuts, speed, title cards, callouts, captions, spotlight, hiding
what should not show, zoom and pan, fades and a highlight around the pointer. MovieEditor is its
timeline, canvas and properties. The edits travel with the film, so there is nothing to render.
Watching is MoviePlayer, with chapters, a position bar and steps that wait for a click:
| What the script says | What it becomes in the player |
|---|---|
chapter | An entry in the list of chapters |
note | A mark on the screen whose text appears while it plays, and again on a click |
guide | The film stops and waits for a click on that spot |
intro | A chapter, with a box in the middle of the film saying what it teaches |
explain | A note that lasts as long as its text takes to read or hear |
Whatever the film is saying shows in a box next to what it talks about, and a film too small for the box has the words under it.
Hearing needs nothing in the file. Clicks and keys are noted while recording and their sounds are
computed, and the system’s own voice reads each box in the language of the labels, so a film weighs
the same with sound as without. MoviePlayer has a switch for each. Recording runs with no window,
so the click is not captured from a real mouse: it is a click sound made to fit. On Linux the voice
needs espeak-ng; without it, the boxes still say it all.
Asking is MovieAssistant. Someone types a question and picks an answer, and the film opens at
that moment, with the answers out of the way. A step opens waiting for its click; anything else
plays from there.
use ravenrs_movie::{MovieAssistant, MovieLibrary};
let library = MovieLibrary::new().film("Manual", movie);
let assistant = MovieAssistant::new(library).width(960.0);It searches the words the films hold, the chapters and the steps, ignoring accents and case, and it accepts near forms of a word (“pago” finds “pagar”) and typing slips. There is no model and nothing leaves the machine, so it adds nothing to download and works in the browser. It knows no synonyms: a question with no word in common with the films gets no answer, and it says so.
MovieChat is the same search as a conversation, for a FloatingPanel over the app. Each answer is
a card with the moments, and the app decides how to open them. MovieChat::writer lets a local
model write the answer about what the search found; finding stays with the search, and a question
that finds nothing never reaches the model.
MovieEditor previews the picture only, with no sound.
Narration holds what the films say, recorded ahead of time and compressed to about 8 KB a second, so that nobody who watches needs a voice model. MoviePlayer::narration and MovieAssistant::narration play it in place of the system’s voice, which still says whatever has no recording.
Structs§
- Answer
- A moment that answers a question.
- Assistant
Labels - The words a
MovieAssistantshows. English by default. - BugLabels
- The words a
BugReportershows. English by default. - BugReport
- What someone says about a bug, for the development team.
- BugReporter
- The dialog that turns what the recorder has into a
BugReport. - Chapter
- A part of the film, in the list of chapters.
- Clip
- One piece of the main track.
- Composition
- One moment of an edited film,
widthwide and as tall as its proportions say. The player and the editor both draw with it, so what is edited is what is shown. - Editor
Labels - The words a
MovieEditorshows. English by default. - Editor
State - What is being edited, kept by the app so that it can be read and saved. All the edits the editor can make are methods here too, for scripts and tests.
- Film
Builder - Puts a film together from what the app draws, keeping each different thing once.
- Flight
Recorder - Keeps the last minutes on screen in memory, the way a flight recorder does, so that a bug can show what led to it. Put it anywhere in the app’s views: it draws nothing. A film costs little because each thing drawn is stored once and a screen that does not change costs nothing, and it runs only when the app paints.
- Hotspot
- A spot on the screen that talks to whoever is watching.
- Marker
- A chapter added in the editor, at a moment of the timeline.
- Moment
- A place in a film that can be asked for.
- Movie
- A film and its edits. Cloning is cheap: the film itself is shared.
- Movie
Answers - What answering a question about the films takes. See
MovieAnswers::answer. - Movie
Assistant - A question field over the films of a
MovieLibrary. Each answer is a moment of a film, and choosing one opens the film right there. - Movie
Chat - A
Chatthat answers from the films of aMovieLibrary. It looks only at the words the films hold, on this machine, with no model. - Movie
Chat Labels - The words a
MovieChatshows. English by default. - Movie
Cue - Tells a
MoviePlayerto open a moment of its film, from outside it, asMovieAssistantdoes. Cloning shares it. - Movie
Editor - An editor for a film, in the style of screen-recording editors.
- Movie
Labels - The words a
MoviePlayershows. English by default. - Movie
Library - The films of an app, ready to be asked about. Cloning is cheap.
- Movie
Player - Plays a
Movieas an interactive manual. - Narration
- Recordings of what films say, each found by its text. It shares the bytes, so
cloning it is cheap. Give it to
MoviePlayer::narration. - Overlay
- Something over the film for a while, on a track of the timeline.
- Pointer
Key - Where the pointer was at a moment.
- Project
- A film’s edits.
- Recent
Errors - Keeps the last warnings and errors logged with
tracing, in memory only, to give toBugReporter::errors, where the person sees them before anything goes. Add it to the app’s subscriber as a layer. - Recorder
- Runs an app from a script and films it: the steps are the ones a person would take, found by the names screen readers see. See the crate documentation.
- Region
- A rectangle on the film, in the logical pixels of the app.
Enums§
- Callout
Style - How a callout looks.
- Card
Look - How a title card looks and moves.
- Clip
Kind - What a clip shows.
- Hotspot
Kind - What a spot on the screen does.
- Moment
Kind - What a moment of a film is.
- Movie
Error - What can go wrong with a film.
- Overlay
Kind - What an overlay does.
- Place
- What the timeline shows at a moment.
- Record
Error - What can stop a recording.
Functions§
- live_
expose - Registers this crate’s types with a playground’s interpreter (feature
live).
Type Aliases§
- Movie
Writer - Writes an answer about the moments that a question found. It gets the question,
the moments, where to write the text, what to do when the text moves, and what
to write if it fails. See
MovieChat::writer.