pub fn add_sound(&mut self, sound: Sound) -> Result<SoundHandle, AddSoundError> {
		if !self.does_track_exist(sound.default_track()) {
			return Err(AddSoundError::NoTrackWithIndex(sound.default_track()));
		}
		if let Some(group) = self.first_missing_group_in_set(sound.groups()) {
			return Err(AddSoundError::NoGroupWithId(group));
		}
		self.active_ids.add_sound_id(sound.id())?;
		let handle = SoundHandle::new(&sound, self.command_producer.clone());
		let sound = Owned::new(&self.resource_collector().handle(), sound);
		self.command_producer
			.push(ResourceCommand::AddSound(sound).into())?;
		Ok(handle)
	}
/// Sends a sound to the audio thread and returns a handle to the sound.
Sends a sound to the audio thread and returns a handle to the sound.
Sends a sound to the audio thread and returns a handle to the sound .
pub fn add_sound(&mut self, sound: Sound) -> Result<SoundHandle, AddSoundError> {
		if !self.does_track_exist(sound.default_track()) {
			return Err(AddSoundError::NoTrackWithIndex(sound.default_track()));
		}
		if let Some(group) = self.first_missing_group_in_set(sound.groups()) {
			return Err(AddSoundError::NoGroupWithId(group));
		}
		self.active_ids.add_sound_id(sound.id())?;
		let handle = SoundHandle::new(&sound, self.command_producer.clone());
		let sound = Owned::new(&self.resource_collector().handle(), sound);
		self.command_producer
			.push(ResourceCommand::AddSound(sound).into())?;
		Ok(handle)
	}
pub fn add_sound ( & mut self , sound : Sound ) -> Result < SoundHandle , AddSoundError > { if ! self . does_track_exist ( sound . default_track ( ) ) { return Err ( AddSoundError :: NoTrackWithIndex ( sound . default_track ( ) ) ) ; } if let Some ( group ) = self . first_missing_group_in_set ( sound . groups ( ) ) { return Err ( AddSoundError :: NoGroupWithId ( group ) ) ; } self . active_ids . add_sound_id ( sound . id ( ) ) ? ; let handle = SoundHandle :: new ( & sound , self . command_producer . clone ( ) ) ; let sound = Owned :: new ( & self . resource_collector ( ) . handle ( ) , sound ) ; self . command_producer . push ( ResourceCommand :: AddSound ( sound ) . into ( ) ) ? ; Ok ( handle ) }
Sends a sound to the audio thread and returns a handle to the sound.
Sends a sound to the audio thread and returns a handle to the sound .
&mut self
sound
Sound
&mut self
sound
Sound