diff --git a/program/MapWindow.cs b/program/MapWindow.cs index 473e821..d742f3f 100644 --- a/program/MapWindow.cs +++ b/program/MapWindow.cs @@ -188,6 +188,7 @@ private bool _audible; // true while a tag has the sound unmuted private uint _waveTimerId; private readonly System.Diagnostics.Stopwatch _playClock = new System.Diagnostics.Stopwatch(); + private bool _heartLive, _breathLive; // is this box's sound actually playing? // ══════════════════════════════════════════════════════════════════ @@ -1627,19 +1628,23 @@ private void LoadWaveforms(CaseDefinition def) { - _heartWave = _breathWave = null; _heartCursor = _breathCursor = -1; WaveData caseWave = LoadWave(def.SoundPath); + if (def.IsHeart) { - _heartWave = caseWave; - if (BreathSoundEnabled) _breathWave = LoadWave("sound/SND200.wav"); + _heartWave = caseWave; + _breathWave = LoadWave("sound/SND200.wav"); // default breath sound + _heartLive = true; + _breathLive = BreathSoundEnabled; // only "playing" if that voice was warmed } else { _breathWave = caseWave; - if (HeartSoundEnabled) _heartWave = LoadWave("sound/SND100.wav"); + _heartWave = LoadWave("sound/SND100.wav"); // default heart sound + _breathLive = true; + _heartLive = HeartSoundEnabled; } HeartWaveArea.QueueDraw(); @@ -1698,8 +1703,8 @@ } double t = _playClock.Elapsed.TotalSeconds; - _heartCursor = CursorFor(_heartWave, t); - _breathCursor = CursorFor(_breathWave, t); + _heartCursor = _heartLive ? CursorFor(_heartWave, t) : -1; + _breathCursor = _breathLive ? CursorFor(_breathWave, t) : -1; HeartWaveArea.QueueDraw(); BreathWaveArea.QueueDraw();