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§
Sourcefn playback_id(&self) -> PlaybackId
fn playback_id(&self) -> PlaybackId
A unique ID, which can be used to identify sources in PlaybackStatusEvents.
Sourcefn playback_options(&self) -> &FilePlaybackOptions
fn playback_options(&self) -> &FilePlaybackOptions
The file source’s playback options
Sourcefn playback_message_queue(&self) -> Arc<ArrayQueue<FilePlaybackMessage>>
fn playback_message_queue(&self) -> Arc<ArrayQueue<FilePlaybackMessage>>
Message queue to control file playback.
Sourcefn playback_status_sender(&self) -> Option<Sender<PlaybackStatusEvent>>
fn playback_status_sender(&self) -> Option<Sender<PlaybackStatusEvent>>
Channel to receive playback status from the file.
fn set_playback_status_sender( &mut self, sender: Option<Sender<PlaybackStatusEvent>>, )
Sourcefn playback_status_context(&self) -> Option<PlaybackStatusContext>
fn playback_status_context(&self) -> Option<PlaybackStatusContext>
Optional context passed along with the playback status.
fn set_playback_status_context( &mut self, context: Option<PlaybackStatusContext>, )
Sourcefn total_frames(&self) -> Option<u64>
fn total_frames(&self) -> Option<u64>
Total number of sample frames in the decoded file: may not be known before playback finished.
Sourcefn current_frame_position(&self) -> u64
fn current_frame_position(&self) -> u64
Current playback pos in frames
Sourcefn end_of_track(&self) -> bool
fn end_of_track(&self) -> bool
True when the source played through the entire file, else false.