Trait FileSource

Source
pub trait FileSource: Source {
    // Required methods
    fn playback_id(&self) -> PlaybackId;
    fn playback_options(&self) -> &FilePlaybackOptions;
    fn playback_message_queue(&self) -> Arc<ArrayQueue<FilePlaybackMessage>>;
    fn playback_status_sender(&self) -> Option<Sender<PlaybackStatusEvent>>;
    fn set_playback_status_sender(
        &mut self,
        sender: Option<Sender<PlaybackStatusEvent>>,
    );
    fn playback_status_context(&self) -> Option<PlaybackStatusContext>;
    fn set_playback_status_context(
        &mut self,
        context: Option<PlaybackStatusContext>,
    );
    fn total_frames(&self) -> Option<u64>;
    fn current_frame_position(&self) -> u64;
    fn end_of_track(&self) -> bool;
}
Expand description

A source which decodes and plays back an audio file.

Required Methods§

Source

fn playback_id(&self) -> PlaybackId

A unique ID, which can be used to identify sources in PlaybackStatusEvents.

Source

fn playback_options(&self) -> &FilePlaybackOptions

The file source’s playback options

Source

fn playback_message_queue(&self) -> Arc<ArrayQueue<FilePlaybackMessage>>

Message queue to control file playback.

Source

fn playback_status_sender(&self) -> Option<Sender<PlaybackStatusEvent>>

Channel to receive playback status from the file.

Source

fn set_playback_status_sender( &mut self, sender: Option<Sender<PlaybackStatusEvent>>, )

Source

fn playback_status_context(&self) -> Option<PlaybackStatusContext>

Optional context passed along with the playback status.

Source

fn set_playback_status_context( &mut self, context: Option<PlaybackStatusContext>, )

Source

fn total_frames(&self) -> Option<u64>

Total number of sample frames in the decoded file: may not be known before playback finished.

Source

fn current_frame_position(&self) -> u64

Current playback pos in frames

Source

fn end_of_track(&self) -> bool

True when the source played through the entire file, else false.

Implementors§