pub fn add_metronome(
		&mut self,
		settings: MetronomeSettings,
	) -> Result<MetronomeHandle, AddMetronomeError> {
		let id = settings.id.unwrap_or(MetronomeId::new());
		self.active_ids.add_metronome_id(id)?;
		let (event_producer, event_consumer) =
			RingBuffer::new(settings.event_queue_capacity).split();
		let metronome = Owned::new(
			&self.resource_collector().handle(),
			Metronome::new(settings, event_producer),
		);
		self.command_producer
			.push(MetronomeCommand::AddMetronome(id, metronome).into())?;
		Ok(MetronomeHandle::new(
			id,
			self.command_producer.clone(),
			event_consumer,
		))
	}
/// Adds a metronome and returns a handle to it.
Adds a metronome and returns a handle to it.
Adds a metronome and returns a handle to it .
pub fn add_metronome(
		&mut self,
		settings: MetronomeSettings,
	) -> Result<MetronomeHandle, AddMetronomeError> {
		let id = settings.id.unwrap_or(MetronomeId::new());
		self.active_ids.add_metronome_id(id)?;
		let (event_producer, event_consumer) =
			RingBuffer::new(settings.event_queue_capacity).split();
		let metronome = Owned::new(
			&self.resource_collector().handle(),
			Metronome::new(settings, event_producer),
		);
		self.command_producer
			.push(MetronomeCommand::AddMetronome(id, metronome).into())?;
		Ok(MetronomeHandle::new(
			id,
			self.command_producer.clone(),
			event_consumer,
		))
	}
pub fn add_metronome ( & mut self , settings : MetronomeSettings , ) -> Result < MetronomeHandle , AddMetronomeError > { let id = settings . id . unwrap_or ( MetronomeId :: new ( ) ) ; self . active_ids . add_metronome_id ( id ) ? ; let ( event_producer , event_consumer ) = RingBuffer :: new ( settings . event_queue_capacity ) . split ( ) ; let metronome = Owned :: new ( & self . resource_collector ( ) . handle ( ) , Metronome :: new ( settings , event_producer ) , ) ; self . command_producer . push ( MetronomeCommand :: AddMetronome ( id , metronome ) . into ( ) ) ? ; Ok ( MetronomeHandle :: new ( id , self . command_producer . clone ( ) , event_consumer , ) ) }
Adds a metronome and returns a handle to it.
Adds a metronome and returns a handle to it .
&mut self
settings
MetronomeSettings
&mut self
settings
MetronomeSettings