OryksaPresenter class

The presenter: the AI speaks on screen with the voice of the locale (from the server, never in the code) and big subtitles. Get it from OryksaTv.presenter and show it with OryksaPresenterView.

Every line she says, or only shows, is charged each time by the ORYKSA interaction cost table (per piece of up to 600 characters), a repeated line too: a spoken line at the voice price, a subtitles-only line at the text price. The line appears only once the server has counted it. Lines already said are kept on the device, so the server does not have to make the same voice again.

Inheritance

Constructors

OryksaPresenter(OryksaTv tv, {OryksaTvAudioPlayer? player})
Creates the presenter of tv. Use OryksaTv.presenter.

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isBusy → bool
True while she speaks or prepares to.
no setter
line → String
The subtitle on screen now.
no setter
onEnd ↔ VoidCallback?
Called when she stops speaking.
getter/setter pair
onError ↔ void Function(Object error)?
Called with errors (network, no interactions left, a line the server did not count). A line the server did not count is not shown.
getter/setter pair
onStart ↔ VoidCallback?
Called when she starts speaking (lower your music or video).
getter/setter pair
phase → OryksaPresenterPhase
What she is doing.
no setter
readingTime ↔ Duration Function(String line)
How long a subtitle stays on screen when there is no voice.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
text → String
The whole text she is saying.
no setter
tv → OryksaTv
The TV pieces.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
say(String text, {bool whisper = false, bool voice = true}) → Future<void>
Says text (written by your app) in the locale of tv, with subtitles. Completes when she finishes, is stopped or is given another text. Never throws: errors go to onError. Each piece of the text is charged each time, even a line said before (at the voice price); a piece the server did not count is not shown, and she stops there.
sayGenerated({required String instructions, String? input, bool whisper = false, bool voice = true}) → Future<String>
Asks the AI to write a line (instructions and input, as in client.ai) in the locale of tv and says it. Returns the text. Counts the ORYKSA interactions of the AI answer and of the line, as in say (voice false: the subtitles only, counted the same).
stop() → Future<void>
Stops speaking now.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited