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]
impl AudioManager
[src]pub fn new(settings: AudioManagerSettings) -> Result<Self, SetupError>
[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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
pub fn remove_stream(
&mut self,
id: AudioStreamId
) -> Result<(), RemoveStreamError>
[src]Removes an audio stream.
pub fn free_unused_resources(&mut self)
[src]
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
Auto Trait Implementations
impl !RefUnwindSafe for AudioManager
impl Send for AudioManager
impl !Sync for AudioManager
impl Unpin for AudioManager
impl !UnwindSafe for AudioManager
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,