VoiceScreen
A screen the server has published: where it is, what is on it, and where the playhead was.
Generated from source
Record com.socketsvc.client.api.VoiceScreen — generated from VoiceScreen.java. Edit the Javadoc in the Java source, then run pnpm gen:api.
package com.socketsvc.client.api;
public record VoiceScreen(String id, String world, double x, double y, double z, Facing facing, double widthBlocks, double heightBlocks, String source, boolean playing, double positionSeconds, int pixelWidth, int pixelHeight, java.util.List<Speaker> speakers) { ... }A screen the server has published: where it is, what is on it, and where the playhead was.
Deliberately its own type rather than the one that comes off the wire. The wire record lives
in com.socketsvc.transport, and the client API jar is checked to contain nothing but
com.socketsvc.client.api - so an addon compiling against the API alone could not link
against it. Converting once, where the snapshot is read, also means the wire format can change
shape without every installed addon needing a rebuild.
SocketSVC itself does nothing with these but hand them over. Drawing a screen, decoding its source and placing its sound are the cinema addon's job; the core's whole part is resolving what the server said and keeping the timecode in step.
Components
| Component | Description |
|---|---|
String id | — |
String world | — |
double x | — |
double y | — |
double z | — |
Facing facing | — |
double widthBlocks | — |
double heightBlocks | — |
String source | what to play - a URL the client fetches for itself, or null for a screen that is defined but showing nothing |
boolean playing | — |
double positionSeconds | where the playhead was when this snapshot arrived; negative for a live source, which has no seekable timeline to be at a position in |
int pixelWidth | — |
int pixelHeight | — |
java.util.List<Speaker> speakers | — |
Methods
live
public boolean live()Whether this source has a timeline to be at a position in. A live stream does not, and asking a decoder to seek into one produces an error rather than a picture.
positionAt
public double positionAt(double elapsedSeconds)Where the playhead is now, elapsedSeconds after this snapshot arrived - which is
what screenSnapshotAgeSeconds() answers.
Nested types
public record Speaker(double x, double y, double z, Facing facing, double rangeBlocks)public enum Facing