Struct sqa_engine::Sender [] [src]

pub struct Sender<T> {
    pub buf: T,
    pub sample_rate: u64,
    // some fields omitted
}

Corresponds to, and controls, a Player in the audio thread.

Fields

The buffer to write to (or not) - will be a bounded_spsc_queue::Producer<f32> or ().

The sample rate of this sender. Can differ from the output sample rate.

Methods

impl<T> Sender<T>
[src]

Set whether this stream will play samples or not.

This essentially halts all processing related to the sender's Player.

Start playing the stream, from this moment on.

This calls set_start_time() with the current time, and calls set_active(true).

Start playing the stream, as if it was supposed to start at a given time.

This calls set_start_time() with the given time, and calls set_active(true).

Set the volume of this stream.

Get the volume of this stream.

Get whether this stream will play samples or not.

Query whether this stream is alive. If this function returns false, any other action on this stream has no effect - the stream is no longer being processed.

Resets this stream's position to 0.

This will also reset its start_time to the current time as a preventative measure against calling this function without doing so while the stream is playing.

Get the stream's position in samples.

This position starts at 0 when the stream starts, and is incremented every time the stream delivers samples. It is compared to the start_time, meaning that you MUST NOT change one without changing the other (otherwise, the stream will think it's out of sync). In fact, you can't!

Get the stream's position as a Duration.

Get this stream's output patch (which channel number this stream is patched to)

Set this stream's output patch (which channel number this stream is patched to)

An invalid output patch will cause the stream to deactivate (active will be set to false).

Set this stream's start time - the time, from the system's monotonic clock, that it starts playing at.

The stream will maintain its playback position relative to this start time, skipping frames as needed to catch up. To get the current time from the system's monotonic clock, call Sender::precise_time_ns.

Make a PlainSender from this sender.

Get this sender's UUID.

A wrapper around time::precise_time_ns().

Trait Implementations

impl<T> Drop for Sender<T>
[src]

If this sender was the original: deactivates the stream, setting alive to false.