pub enum PlaybackCommand {
Play(SourceId, Arc<PetalSonicAudioData>, SourceConfig, LoopMode),
Pause(SourceId),
Stop(SourceId),
StopAll,
UpdateConfig(SourceId, SourceConfig),
Seek(SourceId, f32),
}Expand description
Commands that can be sent to the audio engine for playback control.
These commands are used internally to communicate between the main thread
and the audio processing thread. Most users will interact with playback
through PetalSonicWorld methods instead.
§Variants
Play: Start playing an audio source with specified configuration and loop modePause: Pause a playing audio sourceStop: Stop an audio source and reset its positionStopAll: Stop all currently playing audio sourcesUpdateConfig: Update the spatial configuration of a playing sourceSeek: Seek to a specific position in the audio (0.0 = start, 1.0 = end)
Variants§
Play(SourceId, Arc<PetalSonicAudioData>, SourceConfig, LoopMode)
Play a source with given configuration and loop mode Carries the audio data directly to avoid requiring engine to call back into world
Pause(SourceId)
Pause a specific source
Stop(SourceId)
Stop a specific source
StopAll
Stop all playing sources
UpdateConfig(SourceId, SourceConfig)
Update the configuration of a source
Seek(SourceId, f32)
Seek to a specific position (progress in range [0.0, 1.0])
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlaybackCommand
impl RefUnwindSafe for PlaybackCommand
impl Send for PlaybackCommand
impl Sync for PlaybackCommand
impl Unpin for PlaybackCommand
impl UnwindSafe for PlaybackCommand
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