Skip to main content

QueueConfig

Struct QueueConfig 

Source
#[non_exhaustive]
pub struct QueueConfig<S>
where S: HasPool<u8> + HasPool<f32> + Send + Sync + 'static,
{ pub action_at_item_end: ActionAtItemEnd, pub crossfade_settings: CrossfadeSettings, pub max_concurrent_loads: NonZeroUsize, pub cancel: Option<CancelToken>, pub store: Option<AssetStore<S>>, pub playback_order: PlaybackOrder, pub runtime: Option<Handle>, pub player: PlayerImpl<S>, pub should_autoplay: bool, pub prefetch_duration: f32, pub max_history_size: usize, }
Expand description

Configuration for a Queue.

Holds queue-level defaults plus the owned PlayerImpl instance whose item list the queue coordinates.

TrackSource::Uri resources share this queue’s store. A caller-supplied ResourceConfig retains its own store.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§action_at_item_end: ActionAtItemEnd§crossfade_settings: CrossfadeSettings§max_concurrent_loads: NonZeroUsize

Max concurrent background prefetch loads. Default: 3.

§cancel: Option<CancelToken>

Master cancel for the queue. Some threads the app master so the queue subtree cascades from one app-wide owner; None falls back to a fresh standalone token (test / library use). Must never be None on the production app path.

§store: Option<AssetStore<S>>

Shared store used for bare URI track sources.

§playback_order: PlaybackOrder§runtime: Option<Handle>

Runtime the queue runs its loads and load completions on. None takes the runtime current where the queue is built; an embedding that drives the queue from threads without one (FFI hosts) passes its own.

§player: PlayerImpl<S>

Player owned and decorated by this queue.

§should_autoplay: bool

Whether the queue starts playback by itself once the first track appended to a queue with nothing selected finishes loading. Off by default: the embedding decides when playback starts. A document cannot name it, because starting playback is the embedding’s choice.

§prefetch_duration: f32

Lead time in seconds before EOF at which the next queued track is preloaded into the audio processor. Default: 3.5. Stays f32 seconds rather than the campaign’s humantime duration convention: the value already reaches 10 setter and 14 read call sites as a bare f32, and converting the type would only churn those for a formatting preference.

§max_history_size: usize

Entries the navigation history keeps. Only explicit selections and auto-advances land there, so the default is a listening session’s worth of back-steps; the queue’s own track list is unbounded.

Implementations§

Source§

impl<S> QueueConfig<S>
where S: HasPool<u8> + HasPool<f32> + Send + Sync + 'static,

Source

pub fn builder() -> QueueConfigBuilder<S>

Create an instance of QueueConfig using the builder syntax

Source§

impl<S> QueueConfig<S>
where S: HasPool<u8> + HasPool<f32> + Send + Sync + 'static,

Source

pub fn apply(&mut self, patch: QueueConfigPatch)

Merge what a configuration document said onto this configuration.

A key the document did not name leaves the value already in place.

Trait Implementations§

Source§

impl<S> Debug for QueueConfig<S>
where S: HasPool<u8> + HasPool<f32> + Send + Sync + 'static,

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HangDump for T

Source§

fn dump_json(&self) -> String

Source§

fn label(&self) -> Option<&str>

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more