pub struct Player {
pub info: Info,
pub finished_tracks: Arc<Mutex<Vec<i32>>>,
pub ts: Arc<Mutex<f64>>,
/* private fields */
}Expand description
Primary playback controller.
Player owns the playback threads, buffering state, and runtime settings
such as volume and reverb configuration.
Fields§
§info: Info§finished_tracks: Arc<Mutex<Vec<i32>>>§ts: Arc<Mutex<f64>>Implementations§
Source§impl Player
impl Player
Sourcepub fn new_from_file_paths(file_paths: &Vec<Vec<String>>) -> Self
pub fn new_from_file_paths(file_paths: &Vec<Vec<String>>) -> Self
Create a new player for a set of standalone file paths.
Sourcepub fn new_from_path_or_paths(
path: Option<&String>,
paths: Option<&Vec<Vec<String>>>,
) -> Self
pub fn new_from_path_or_paths( path: Option<&String>, paths: Option<&Vec<Vec<String>>>, ) -> Self
Create a player from either a container path or standalone file paths.
Sourcepub fn set_impulse_response_spec(&mut self, spec: ImpulseResponseSpec)
pub fn set_impulse_response_spec(&mut self, spec: ImpulseResponseSpec)
Override the impulse response used for convolution reverb.
Sourcepub fn set_impulse_response_from_string(&mut self, value: &str)
pub fn set_impulse_response_from_string(&mut self, value: &str)
Parse and apply an impulse response spec string.
Sourcepub fn set_impulse_response_tail_db(&mut self, tail_db: f32)
pub fn set_impulse_response_tail_db(&mut self, tail_db: f32)
Override the impulse response tail trim (dB).
Sourcepub fn set_reverb_enabled(&self, enabled: bool)
pub fn set_reverb_enabled(&self, enabled: bool)
Enable or disable convolution reverb.
Sourcepub fn set_reverb_mix(&self, dry_wet: f32)
pub fn set_reverb_mix(&self, dry_wet: f32)
Set the reverb wet/dry mix (clamped to [0.0, 1.0]).
Sourcepub fn get_reverb_settings(&self) -> ReverbSettings
pub fn get_reverb_settings(&self) -> ReverbSettings
Retrieve the current reverb settings snapshot.
Sourcepub fn get_reverb_metrics(&self) -> ReverbMetrics
pub fn get_reverb_metrics(&self) -> ReverbMetrics
Retrieve the latest reverb performance metrics.
Sourcepub fn debug_playback_state(&self) -> (bool, PlayerState, bool)
pub fn debug_playback_state(&self) -> (bool, PlayerState, bool)
Debug helper returning thread alive, state, and audio heard flags.
Sourcepub fn debug_buffering_done(&self) -> bool
pub fn debug_buffering_done(&self) -> bool
Debug helper indicating whether buffering has completed.
Sourcepub fn debug_timing_ms(&self) -> (u64, u64)
pub fn debug_timing_ms(&self) -> (u64, u64)
Debug helper returning internal timing markers in milliseconds.
Sourcepub fn debug_sink_state(&self) -> (bool, bool, usize)
pub fn debug_sink_state(&self) -> (bool, bool, usize)
Debug helper returning sink paused/empty flags and queued length.
Sourcepub fn set_start_buffer_ms(&self, start_buffer_ms: f32)
pub fn set_start_buffer_ms(&self, start_buffer_ms: f32)
Configure the minimum buffered audio (ms) before playback starts.
Sourcepub fn set_track_eos_ms(&self, track_eos_ms: f32)
pub fn set_track_eos_ms(&self, track_eos_ms: f32)
Configure heuristic end-of-track threshold for containers (ms).
Sourcepub fn kill_current(&self)
pub fn kill_current(&self)
Stop the current playback thread without changing state.
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Return true if playback is currently active.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Return true if playback has reached the end.
Sourcepub fn sleep_until_end(&self)
pub fn sleep_until_end(&self)
Block the current thread until playback finishes.
Sourcepub fn get_duration(&self) -> f64
pub fn get_duration(&self) -> f64
Get the total duration (seconds) of the active selection.
Sourcepub fn refresh_tracks(&mut self)
pub fn refresh_tracks(&mut self)
Refresh active track selections from the underlying container.
Sourcepub fn set_volume(&mut self, new_volume: f32)
pub fn set_volume(&mut self, new_volume: f32)
Set the playback volume (0.0-1.0).
Sourcepub fn get_volume(&self) -> f32
pub fn get_volume(&self) -> f32
Get the current playback volume.