Skip to content

Commit

Permalink
orb-ui: bootup sound on bootcomplete event (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
fouge authored Apr 16, 2024
1 parent 711af5a commit fde9d2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions orb-ui/src/engine/diamond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ impl EventHandler for Runner<DIAMOND_RING_LED_COUNT, DIAMOND_CENTER_LED_COUNT> {
tracing::info!("UI event: {:?}", event);
match event {
Event::Bootup => {
self.sound
.queue(sound::Type::Melody(sound::Melody::BootUp))?;
self.stop_ring(LEVEL_NOTICE, true);
self.stop_center(LEVEL_NOTICE, true);
self.stop_cone(LEVEL_NOTICE, true);
Expand All @@ -219,7 +217,11 @@ impl EventHandler for Runner<DIAMOND_RING_LED_COUNT, DIAMOND_CENTER_LED_COUNT> {
);
self.operator_pulse.trigger(2048.0, 1., 1., false);
}
Event::BootComplete => self.operator_pulse.stop(),
Event::BootComplete => {
self.sound
.queue(sound::Type::Melody(sound::Melody::BootUp))?;
self.operator_pulse.stop()
}
Event::Shutdown { requested } => {
self.sound
.queue(sound::Type::Melody(sound::Melody::PoweringDown))?;
Expand Down
8 changes: 5 additions & 3 deletions orb-ui/src/engine/pearl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ impl EventHandler for Runner<PEARL_RING_LED_COUNT, PEARL_CENTER_LED_COUNT> {
tracing::info!("UI event: {:?}", event);
match event {
Event::Bootup => {
self.sound
.queue(sound::Type::Melody(sound::Melody::BootUp))?;
self.stop_ring(LEVEL_NOTICE, true);
self.stop_center(LEVEL_NOTICE, true);
self.set_ring(
Expand All @@ -197,7 +195,11 @@ impl EventHandler for Runner<PEARL_RING_LED_COUNT, PEARL_CENTER_LED_COUNT> {
);
self.operator_pulse.trigger(2048.0, 1., 1., false);
}
Event::BootComplete => self.operator_pulse.stop(),
Event::BootComplete => {
self.sound
.queue(sound::Type::Melody(sound::Melody::BootUp))?;
self.operator_pulse.stop()
}
Event::Shutdown { requested } => {
self.sound
.queue(sound::Type::Melody(sound::Melody::PoweringDown))?;
Expand Down

0 comments on commit fde9d2d

Please sign in to comment.