The reason's writer is the engine lane, not this one
Browse files at this commita091c6dbfc3e987da6f52c6b9fd1b936c9e99c9eParent: e87ca88- docs
- the reason's writer is the engine lane, not this one
2 changed files +15 -11
crates/app/src/notices.rsmodified+10 -5
| @@ -109,11 +109,16 @@ pub(crate) fn audio_step( | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | /// What a *change* in the engine's sound reason does to the notice queue, as a | 111 | /// What a *change* in the engine's sound reason does to the notice queue, as a |
| 112 | -/// pure step: the death line pushed when a reason arrives, the same line taken | 112 | +/// pure step: the line pushed when a reason arrives, the same line taken back |
| 113 | -/// back when the reason clears ([`PlaybackSession::audio_disabled_reason`]'s | 113 | +/// when the reason clears. [`Player::watch_audio`] is the only caller and owns |
| 114 | -/// `AUDIO_LOST` and its own re-arm). [`Player::watch_audio`] is the only caller | 114 | +/// the caching; this owns the queue, so a test can drive both directions without |
| 115 | -/// and owns the caching; this owns the queue, so a test can drive both | 115 | +/// a window and without a device that dies on cue. |
| 116 | -/// directions without a window and without a device that dies on cue. | 116 | +/// |
| 117 | +/// The reason itself is the engine's to write | ||
| 118 | +/// ([`PlaybackSession::audio_disabled_reason`]): this side never spells its | ||
| 119 | +/// words, so a lost-device reason the engine lane teaches the death path to set | ||
| 120 | +/// needs nothing here -- and a death that sets nothing stays unsaid, which is | ||
| 121 | +/// what the engine side of this defect is. | ||
| 117 | pub(crate) fn audio_change_notice( | 122 | pub(crate) fn audio_change_notice( |
| 118 | notices: &mut std::collections::VecDeque<SharedString>, | 123 | notices: &mut std::collections::VecDeque<SharedString>, |
| 119 | was: Option<&str>, | 124 | was: Option<&str>, |
crates/app/src/tests/media.rsmodified+5 -6
| @@ -16,12 +16,11 @@ use crate::ui::preview::{bgra_to_rgba, screenshot_path}; | |||
| 16 | /// them (`notices` is a private module re-exported for the window). | 16 | /// them (`notices` is a private module re-exported for the window). |
| 17 | use crate::notices::{audio_change_notice, audio_lost_line, audio_tail}; | 17 | use crate::notices::{audio_change_notice, audio_lost_line, audio_tail}; |
| 18 | 18 | ||
| 19 | -/// A sound device that dies under a file that is already open says so, and stops | 19 | +/// A reason that changes under a session that is already open says so, and stops |
| 20 | -/// saying so when the engine's own re-arm takes. The engine sets its | 20 | +/// saying so when it clears. This side is the *reader*: the writer of a reason is |
| 21 | -/// `audio_disabled_reason` to its lost-device word on a death and clears it on a | 21 | +/// the engine's own `audio_disabled_reason`, and the app's two call sites were |
| 22 | -/// successful reopen, and nothing on this side ever looked at it: the two call | 22 | +/// the *open* paths -- so a reason that arrived mid-session reached no consumer |
| 23 | -/// sites were the *open* paths, so a mid-session death played on in silence with | 23 | +/// at all and the window played on in silence with nothing said. |
| 24 | -/// no message at all. | ||
| 25 | /// | 24 | /// |
| 26 | /// Driven through the queue step itself -- [`audio_change_notice`] is the whole | 25 | /// Driven through the queue step itself -- [`audio_change_notice`] is the whole |
| 27 | /// of what a reason change does to the strip -- because a test cannot make a | 26 | /// of what a reason change does to the strip -- because a test cannot make a |