Struct FileStreamerNode

Source
pub struct FileStreamerNode { /* private fields */ }
Expand description

Streams a file, which must be specified to the constructor and cannot be changed thereafter. This node is a stopgap solution, and should be considered temporary. It will likely remain for backward compatibility. Libaudioverse plans to eventually offer a more generic streaming node that also supports web addresses; such a node will have a completely different, less buffer-like interface. In order to stream a file, it must be passed through a resampler. Consequentlty, the position property is slightly inaccurate and the ended property and callback are slightly delayed.

This node has no inputs.

Outputs:

indexchannelsdescription
0Depends on the file.The output of the stream.

Implementations§

Source§

impl FileStreamerNode

Source

pub fn new(server: &Server, path: &CString) -> Result<FileStreamerNode>

Creates a new file streamer node.

Source

pub fn ended(&self) -> BoolProperty

Returns the ended property. This property is read-only. Switches from false to true once the stream has ended completely and gone silent. This property will never go true unless looping is false.

Source

pub fn looping(&self) -> BoolProperty

Default value: False

If true, this node repeats the file from the beginning once it reaches the end. Note that setting looping means that ended will never go true. If ended is already true, it may take until the end of the next processing block for ended to properly go false once more.

Source

pub fn position(&self) -> DoubleProperty

Range: dynamic

Default value: 0.0

The position of playback, in seconds. The range of this property corresponds to the total duration of the file. Note that this property may be slightly inaccurate because this node has to pass data through a resampler.

Trait Implementations§

Source§

impl Node for FileStreamerNode

Source§

fn connect(&self, output: i32, destination: &dyn Node, input: i32) -> Result<()>

Connect the specified output of the specified node to the specified input of the specified node. It is an error if this would cause a cycle in the graph of nodes.
Source§

fn connect_property( &self, output: i32, destination: &dyn Node, slot: i32, ) -> Result<()>

Connect a node’s output to an automatable property.
Source§

fn connect_server(&self, output: i32) -> Result<()>

Connect the specified output of the specified node to the server’s input. Any node which is connected directly or indirectly to the server will remain alive even if your program lets go of it. For more details on the subject of node lifetimes, see the Libaudioverse manual.
Source§

fn disconnect( &self, output: i32, destination: &dyn Node, input: i32, ) -> Result<()>

Disconnect the output of the specified node.
Source§

fn get_input_connection_count(&self) -> Result<u32>

Get the number of inputs this node has.
Source§

fn get_output_connection_count(&self) -> Result<u32>

Get the number of outputs this node has.
Source§

fn isolate(&self) -> Result<()>

Equivalent to disconnecting all of the outputs of this node. After a call to isolate, this node will no longer be affecting audio in any way.
Source§

fn reset(&self) -> Result<()>

Reset a node. What this means depends on the node in question. Properties are not touched by node resetting.
Source§

fn add(&self) -> FloatProperty

Returns the add property. Read more
Source§

fn mul(&self) -> FloatProperty

Returns the mul property. Read more
Source§

fn state(&self) -> NodeStateProperty

Returns the state property. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.