Struct kira::manager::AudioManager[][src]

pub struct AudioManager { /* fields omitted */ }
Expand description

Plays and manages audio.

The audio manager is responsible for all communication between the gameplay thread and the audio thread.

Implementations

impl AudioManager[src]

pub fn new(settings: AudioManagerSettings) -> Result<Self, SetupError>[src]

Creates a new audio manager and starts an audio thread.

pub fn add_sound(&mut self, sound: Sound) -> Result<SoundHandle, AddSoundError>[src]

Sends a sound to the audio thread and returns a handle to the sound.

pub fn load_sound(
    &mut self,
    path: impl AsRef<Path>,
    settings: SoundSettings
) -> Result<SoundHandle, LoadSoundError>
[src]

Loads a sound from a file and returns a handle to the sound.

This is a shortcut for constructing the sound manually and adding it using AudioManager::add_sound.

pub fn remove_sound(
    &mut self,
    id: impl Into<SoundId>
) -> Result<(), RemoveSoundError>
[src]

Removes a sound from the audio thread.

pub fn add_arrangement(
    &mut self,
    arrangement: Arrangement
) -> Result<ArrangementHandle, AddArrangementError>
[src]

Sends a arrangement to the audio thread and returns a handle to the arrangement.

pub fn remove_arrangement(
    &mut self,
    id: impl Into<ArrangementId>
) -> Result<(), RemoveArrangementError>
[src]

Removes an arrangement from the audio thread.

pub fn add_metronome(
    &mut self,
    settings: MetronomeSettings
) -> Result<MetronomeHandle, AddMetronomeError>
[src]

Adds a metronome and returns a handle to it.

pub fn remove_metronome(
    &mut self,
    id: impl Into<MetronomeId>
) -> Result<(), RemoveMetronomeError>
[src]

Removes a metronome from the audio thread.

pub fn start_sequence<CustomEvent: Clone + Eq + Hash>(
    &mut self,
    sequence: Sequence<CustomEvent>,
    settings: SequenceInstanceSettings
) -> Result<SequenceInstanceHandle<CustomEvent>, StartSequenceError>
[src]

Starts a sequence.

pub fn add_parameter(
    &mut self,
    settings: ParameterSettings
) -> Result<ParameterHandle, AddParameterError>
[src]

Creates a parameter with the specified starting value.

pub fn remove_parameter(
    &mut self,
    id: impl Into<ParameterId>
) -> Result<(), RemoveParameterError>
[src]

Removes a parameter from the audio thread.

pub fn main_track(&mut self) -> MainTrackHandle[src]

Returns a handle to the main mixer track.

pub fn add_sub_track(
    &mut self,
    settings: SubTrackSettings
) -> Result<SubTrackHandle, AddSubTrackError>
[src]

Creates a mixer sub-track.

pub fn remove_sub_track(
    &mut self,
    id: impl Into<SubTrackId>
) -> Result<(), RemoveSubTrackError>
[src]

Removes a sub-track from the mixer.

pub fn add_send_track(
    &mut self,
    settings: SendTrackSettings
) -> Result<SendTrackHandle, AddSendTrackError>
[src]

Creates a mixer send track.

pub fn remove_send_track(
    &mut self,
    id: impl Into<SendTrackId>
) -> Result<(), RemoveSendTrackError>
[src]

Removes a send track from the mixer.

pub fn add_group(
    &mut self,
    settings: GroupSettings
) -> Result<GroupHandle, AddGroupError>
[src]

Adds a group.

pub fn remove_group(
    &mut self,
    id: impl Into<GroupId>
) -> Result<(), RemoveGroupError>
[src]

Removes a group.

pub fn add_stream(
    &mut self,
    stream: impl AudioStream,
    track: TrackIndex
) -> Result<AudioStreamId, AddStreamError>
[src]

Adds an audio stream.

pub fn remove_stream(
    &mut self,
    id: AudioStreamId
) -> Result<(), RemoveStreamError>
[src]

Removes an audio stream.

pub fn free_unused_resources(&mut self)[src]

Frees resources that are no longer in use, such as unloaded sounds or finished sequences.

Trait Implementations

impl Drop for AudioManager[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V