pub struct PulsePlaybackEngine { /* private fields */ }Expand description
Shared playback engine used by Lua playback handles.
Implementations§
Source§impl PulsePlaybackEngine
impl PulsePlaybackEngine
Sourcepub fn new() -> PulseResult<Self>
pub fn new() -> PulseResult<Self>
Creates a playback engine using tunes::engine::AudioEngine::new.
§Errors
Returns a playback error when the audio engine cannot initialize.
Sourcepub fn play(&self, playable: PulsePlayable<'_>) -> PulseResult<()>
pub fn play(&self, playable: PulsePlayable<'_>) -> PulseResult<()>
Plays a target immediately and waits for tunes to schedule playback.
§Errors
Returns an error when mixer creation or playback scheduling fails.
Sourcepub fn play_realtime(
&self,
playable: PulsePlayable<'_>,
) -> PulseResult<PulsePlaybackHandle>
pub fn play_realtime( &self, playable: PulsePlayable<'_>, ) -> PulseResult<PulsePlaybackHandle>
Starts real-time playback and returns a handle for later control.
§Errors
Returns an error when mixer creation or playback scheduling fails.
Sourcepub fn play_looping(
&self,
playable: PulsePlayable<'_>,
) -> PulseResult<PulsePlaybackHandle>
pub fn play_looping( &self, playable: PulsePlayable<'_>, ) -> PulseResult<PulsePlaybackHandle>
Starts looping playback and returns a handle for later control.
§Errors
Returns an error when mixer creation or playback scheduling fails.
Sourcepub fn play_at_rate(
&self,
playable: PulsePlayable<'_>,
rate: f32,
) -> PulseResult<()>
pub fn play_at_rate( &self, playable: PulsePlayable<'_>, rate: f32, ) -> PulseResult<()>
Plays a target with a playback-rate multiplier.
§Errors
Returns an error when rate is invalid or playback fails.
Sourcepub fn play_realtime_at_rate(
&self,
playable: PulsePlayable<'_>,
rate: f32,
) -> PulseResult<PulsePlaybackHandle>
pub fn play_realtime_at_rate( &self, playable: PulsePlayable<'_>, rate: f32, ) -> PulseResult<PulsePlaybackHandle>
Starts real-time playback with a playback-rate multiplier.
§Errors
Returns an error when rate is invalid or playback fails.
Trait Implementations§
Source§impl Clone for PulsePlaybackEngine
impl Clone for PulsePlaybackEngine
Source§fn clone(&self) -> PulsePlaybackEngine
fn clone(&self) -> PulsePlaybackEngine
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl UserData for PulsePlaybackEngine
impl UserData for PulsePlaybackEngine
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Source§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Source§fn register(registry: &mut UserDataRegistry<Self>)
fn register(registry: &mut UserDataRegistry<Self>)
Auto Trait Implementations§
impl !RefUnwindSafe for PulsePlaybackEngine
impl !Send for PulsePlaybackEngine
impl !Sync for PulsePlaybackEngine
impl !UnwindSafe for PulsePlaybackEngine
impl Freeze for PulsePlaybackEngine
impl Unpin for PulsePlaybackEngine
impl UnsafeUnpin for PulsePlaybackEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more