mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
sound feature flag
This commit is contained in:
committed by
Aiden McClelland
parent
6b6dc404ab
commit
0cf1a45da7
@@ -113,12 +113,15 @@ where
|
||||
&'a T: IntoIterator<Item = &'a (Option<Note>, TimeSlice)>,
|
||||
{
|
||||
pub async fn play(&'a self) -> Result<(), Error> {
|
||||
let mut sound = SoundInterface::lease().await?;
|
||||
for (note, slice) in &self.note_sequence {
|
||||
match note {
|
||||
None => tokio::time::sleep(slice.to_duration(self.tempo_qpm)).await,
|
||||
Some(n) => sound.play_for_time_slice(self.tempo_qpm, n, slice).await?,
|
||||
};
|
||||
#[cfg(feature = "sound")]
|
||||
{
|
||||
let mut sound = SoundInterface::lease().await?;
|
||||
for (note, slice) in &self.note_sequence {
|
||||
match note {
|
||||
None => tokio::time::sleep(slice.to_duration(self.tempo_qpm)).await,
|
||||
Some(n) => sound.play_for_time_slice(self.tempo_qpm, n, slice).await?,
|
||||
};
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user