pub struct NullBackend {
state: PlayerState,
volume: f32,
position: f64,
duration: Option<f64>,
audio_settings: AudioSettings,
}Expand description
Null player backend (for testing or when no real player is available)
@req: DR-004 - PlayerBackend trait (mock implementation for testing)
Fields§
§state: PlayerState§volume: f32§position: f64§duration: Option<f64>§audio_settings: AudioSettingsImplementations§
Source§impl NullBackend
impl NullBackend
Trait Implementations§
Source§impl Default for NullBackend
impl Default for NullBackend
Source§impl PlayerBackend for NullBackend
impl PlayerBackend for NullBackend
Source§fn load(&mut self, media: &MediaItem) -> Result<(), PlayerError>
fn load(&mut self, media: &MediaItem) -> Result<(), PlayerError>
Load a media item for playback
TRACES: UR-005
Source§fn seek(&mut self, position: f64) -> Result<(), PlayerError>
fn seek(&mut self, position: f64) -> Result<(), PlayerError>
Seek to a position in seconds
TRACES: UR-005
Source§fn set_volume(&mut self, volume: f32) -> Result<(), PlayerError>
fn set_volume(&mut self, volume: f32) -> Result<(), PlayerError>
Set volume (0.0 - 1.0)
TRACES: UR-016
Source§fn state(&self) -> PlayerState
fn state(&self) -> PlayerState
Get current player state
Source§fn set_audio_settings(
&mut self,
settings: &AudioSettings,
) -> Result<(), PlayerError>
fn set_audio_settings( &mut self, settings: &AudioSettings, ) -> Result<(), PlayerError>
Apply audio settings (crossfade, gapless, normalization) Read more
Source§fn audio_settings(&self) -> AudioSettings
fn audio_settings(&self) -> AudioSettings
Get current audio settings Read more
Source§fn set_audio_track(&mut self, _stream_index: i32) -> Result<(), PlayerError>
fn set_audio_track(&mut self, _stream_index: i32) -> Result<(), PlayerError>
Set the active audio track by stream index Read more
Source§fn set_subtitle_track(
&mut self,
_stream_index: Option<i32>,
) -> Result<(), PlayerError>
fn set_subtitle_track( &mut self, _stream_index: Option<i32>, ) -> Result<(), PlayerError>
Set the active subtitle track by stream index (None to disable subtitles) Read more
Auto Trait Implementations§
impl Freeze for NullBackend
impl RefUnwindSafe for NullBackend
impl Send for NullBackend
impl Sync for NullBackend
impl Unpin for NullBackend
impl UnsafeUnpin for NullBackend
impl UnwindSafe for NullBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.