(&mut self)
| 114 | } |
| 115 | |
| 116 | pub fn update(&mut self) { |
| 117 | // Update the firewheel context. |
| 118 | // This must be called regularly (i.e. once every frame). |
| 119 | if let Err(e) = self.cx.update() { |
| 120 | tracing::error!("{:?}", &e); |
| 121 | } |
| 122 | |
| 123 | // Log any stream errors/warnings that have occurred. |
| 124 | self.stream.log_status(); |
| 125 | |
| 126 | // The stream has stopped unexpectedly (i.e the user has |
| 127 | // unplugged their headphones.) |
| 128 | // |
| 129 | // Typically you should start a new stream as soon as |
| 130 | // possible to resume processing (even if it's a dummy |
| 131 | // output device). |
| 132 | // |
| 133 | // In this example we just quit the application. |
| 134 | if !self.stream.all_streams_ok() { |
| 135 | panic!("Stream stopped unexpectedly!"); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | pub fn is_activated(&self) -> bool { |
| 140 | self.cx.is_active() |
no test coverage detected