pub fn add_sub_track(
		&mut self,
		settings: SubTrackSettings,
	) -> Result<SubTrackHandle, AddSubTrackError> {
		if let TrackIndex::Sub(id) = settings.parent_track {
			if !self.active_ids.active_sub_track_ids.contains(&id) {
				return Err(AddSubTrackError::NonexistentParentTrack(id));
			}
		}
		for (send_track_id, _) in settings.sends.iter() {
			if !self
				.active_ids
				.active_send_track_ids
				.contains(send_track_id)
			{
				return Err(AddSubTrackError::NonexistentSendTrack(*send_track_id));
			}
		}
		let id = settings.id.unwrap_or(SubTrackId::new());
		self.active_ids.add_sub_track_id(id)?;
		let handle = SubTrackHandle::new(
			id,
			&settings,
			self.command_producer.clone(),
			self.sample_rate,
			Arc::downgrade(self.resource_collector_handle.as_ref().unwrap()),
		);
		let track = Owned::new(
			&self.resource_collector().handle(),
			Track::new_sub_track(id, settings),
		);
		self.command_producer
			.push(MixerCommand::AddTrack(track).into())?;
		Ok(handle)
	}
/// Creates a mixer sub-track.
Creates a mixer sub-track.
Creates a mixer sub - track .
pub fn add_sub_track(
		&mut self,
		settings: SubTrackSettings,
	) -> Result<SubTrackHandle, AddSubTrackError> {
		if let TrackIndex::Sub(id) = settings.parent_track {
			if !self.active_ids.active_sub_track_ids.contains(&id) {
				return Err(AddSubTrackError::NonexistentParentTrack(id));
			}
		}
		for (send_track_id, _) in settings.sends.iter() {
			if !self
				.active_ids
				.active_send_track_ids
				.contains(send_track_id)
			{
				return Err(AddSubTrackError::NonexistentSendTrack(*send_track_id));
			}
		}
		let id = settings.id.unwrap_or(SubTrackId::new());
		self.active_ids.add_sub_track_id(id)?;
		let handle = SubTrackHandle::new(
			id,
			&settings,
			self.command_producer.clone(),
			self.sample_rate,
			Arc::downgrade(self.resource_collector_handle.as_ref().unwrap()),
		);
		let track = Owned::new(
			&self.resource_collector().handle(),
			Track::new_sub_track(id, settings),
		);
		self.command_producer
			.push(MixerCommand::AddTrack(track).into())?;
		Ok(handle)
	}
pub fn add_sub_track ( & mut self , settings : SubTrackSettings , ) -> Result < SubTrackHandle , AddSubTrackError > { if let TrackIndex :: Sub ( id ) = settings . parent_track { if ! self . active_ids . active_sub_track_ids . contains ( & id ) { return Err ( AddSubTrackError :: NonexistentParentTrack ( id ) ) ; } } for ( send_track_id , _ ) in settings . sends . iter ( ) { if ! self . active_ids . active_send_track_ids . contains ( send_track_id ) { return Err ( AddSubTrackError :: NonexistentSendTrack ( * send_track_id ) ) ; } } let id = settings . id . unwrap_or ( SubTrackId :: new ( ) ) ; self . active_ids . add_sub_track_id ( id ) ? ; let handle = SubTrackHandle :: new ( id , & settings , self . command_producer . clone ( ) , self . sample_rate , Arc :: downgrade ( self . resource_collector_handle . as_ref ( ) . unwrap ( ) ) , ) ; let track = Owned :: new ( & self . resource_collector ( ) . handle ( ) , Track :: new_sub_track ( id , settings ) , ) ; self . command_producer . push ( MixerCommand :: AddTrack ( track ) . into ( ) ) ? ; Ok ( handle ) }
Creates a mixer sub-track.
Creates a mixer sub - track .
&mut self
settings
SubTrackSettings
&mut self
settings
SubTrackSettings