|
YAACC - UPNP Client and Server
|
The audio output of the engine on top of a TrackPort: everything that is logic and not a platform call.
More...


Classes | |
| interface | Opener |
| Opens the platform output. More... | |
Public Member Functions | |
| StreamingSink (MicroClock clock, Opener opener) | |
| void | open (SinkFormat wanted) throws AudioSinkException |
| Creates the output. | |
| void | attachTrace (EventTrace trace) |
| Lets the output note its own events (position source changes) in the engine's trace. | |
| int | startThresholdFrames () |
| How many frames the engine must have written before the output really starts playing (the streaming start threshold of the platform); 0 when the output starts at once. | |
| String | describe () |
| One line about the output for the status and the trace: buffer, start threshold, underruns, timestamp health. | |
| int | write (byte[] data, int offset, int length) throws AudioSinkException |
| Queues whole frames without blocking. | |
| void | start () throws AudioSinkException |
| Starts playback of what was written; does nothing when it already runs. | |
| void | flush () |
| Throws away everything queued and stops. | |
| PlaybackPosition | position () |
| The latest position the platform knows, or null when there is none (yet). | |
| int | underrunCount () |
| How often the output ran empty since it was opened. | |
| void | setGain (float gain) |
| A linear gain, 0 to 1. | |
| String | positionSource () |
A label of where position() comes from, for the status line. | |
| void | release () |
| Frees the output. | |
Public Member Functions inherited from de.yaacc.multiroom.engine.AudioSink | |
Static Public Attributes | |
| static final int | WANTED_START_THRESHOLD_MS = 40 |
| The streaming start threshold the engine asks for: it wants the output to start early, with this much audio queued. | |
The audio output of the engine on top of a TrackPort: everything that is logic and not a platform call.
It keeps the position bookkeeping (the 32 bit counters are unwrapped, a timestamp older than the last flush is ignored, the position after a flush is taken from zero), converts the platform's monotonic time to the engine clock by the age of a report, and falls back to the head position when the platform gives no timestamp.
| de.yaacc.multiroom.engine.StreamingSink.StreamingSink | ( | MicroClock | clock, |
| Opener | opener ) |
| clock | the clock of the engine (the one the connection's time sync uses) |
| void de.yaacc.multiroom.engine.StreamingSink.attachTrace | ( | EventTrace | trace | ) |
Lets the output note its own events (position source changes) in the engine's trace.
Implements de.yaacc.multiroom.engine.AudioSink.
| String de.yaacc.multiroom.engine.StreamingSink.describe | ( | ) |
One line about the output for the status and the trace: buffer, start threshold, underruns, timestamp health.
Implements de.yaacc.multiroom.engine.AudioSink.

| void de.yaacc.multiroom.engine.StreamingSink.flush | ( | ) |
Throws away everything queued and stops.
The counting of PlaybackPosition#getFrames() starts again at 0 and start() is needed again. The output itself is kept (it is not re-created).
Implements de.yaacc.multiroom.engine.AudioSink.

| void de.yaacc.multiroom.engine.StreamingSink.open | ( | SinkFormat | format | ) | throws AudioSinkException |
Creates the output.
Not started yet.
Implements de.yaacc.multiroom.engine.AudioSink.

| PlaybackPosition de.yaacc.multiroom.engine.StreamingSink.position | ( | ) |
The latest position the platform knows, or null when there is none (yet).
Implements de.yaacc.multiroom.engine.AudioSink.
Referenced by de.yaacc.multiroom.engine.StreamingSink.position().


| String de.yaacc.multiroom.engine.StreamingSink.positionSource | ( | ) |
A label of where position() comes from, for the status line.
Implements de.yaacc.multiroom.engine.AudioSink.
Referenced by de.yaacc.multiroom.engine.StreamingSink.describe().

| void de.yaacc.multiroom.engine.StreamingSink.release | ( | ) |
Frees the output.
Safe to call twice.
Implements de.yaacc.multiroom.engine.AudioSink.
Referenced by de.yaacc.multiroom.engine.StreamingSink.open().

| void de.yaacc.multiroom.engine.StreamingSink.setGain | ( | float | gain | ) |
A linear gain, 0 to 1.
Implements de.yaacc.multiroom.engine.AudioSink.
| void de.yaacc.multiroom.engine.StreamingSink.start | ( | ) | throws AudioSinkException |
Starts playback of what was written; does nothing when it already runs.
Implements de.yaacc.multiroom.engine.AudioSink.
| int de.yaacc.multiroom.engine.StreamingSink.startThresholdFrames | ( | ) |
How many frames the engine must have written before the output really starts playing (the streaming start threshold of the platform); 0 when the output starts at once.
Implements de.yaacc.multiroom.engine.AudioSink.

| int de.yaacc.multiroom.engine.StreamingSink.underrunCount | ( | ) |
How often the output ran empty since it was opened.
Implements de.yaacc.multiroom.engine.AudioSink.
| int de.yaacc.multiroom.engine.StreamingSink.write | ( | byte[] | data, |
| int | offset, | ||
| int | length ) throws AudioSinkException |
Queues whole frames without blocking.
Implements de.yaacc.multiroom.engine.AudioSink.
