diff --git a/program/MapWindow.cs b/program/MapWindow.cs index b82d581..2b857a0 100644 --- a/program/MapWindow.cs +++ b/program/MapWindow.cs @@ -110,6 +110,8 @@ [UI] private RadioButton ViewRightRadio = null; [UI] private RadioButton ViewLeftRadio = null; [UI] private Switch ShowNumbersSwitch = null; + [UI] private Box ShowNumbersSwitchRow = null; // 番号を表示 — debug mode only + [UI] private ScrolledWindow MapControlScroller = null; // left panel: scrolls only in debug [UI] private RadioButton SizeLRadio = null; [UI] private RadioButton SizeXLRadio = null; @@ -219,10 +221,25 @@ // ── waveform boxes ── private WaveData _heartWave, _breathWave; private double _heartCursor = -1, _breathCursor = -1; // 0..1, -1 = hidden - private bool _audible; // true while a tag has the sound unmuted + private bool _audible; // true while any sound is 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? + // Per box: is a sound of that kind audible right now? Each box shows its + // own cursor only while its own sound is playing. + private bool _heartAudible, _breathAudible; + // Current-mode legend levels (0..1), for the point list. + private float _legendHeart, _legendBreath; + + // ── heart / lung / mix filter ── + public enum SoundFilter { Mix, HeartOnly, LungOnly } + private SoundFilter _filter = SoundFilter.Mix; + // glade: 再生する音 segment (ミックス / 心音のみ / 肺音のみ) + [UI] private RadioButton SoundMixRadio = null; + [UI] private RadioButton SoundHeartOnlyRadio = null; + [UI] private RadioButton SoundLungOnlyRadio = null; + + private bool HeartAllowed { get { return _filter != SoundFilter.LungOnly; } } + private bool LungAllowed { get { return _filter != SoundFilter.HeartOnly; } } // ══════════════════════════════════════════════════════════════════ @@ -293,8 +310,10 @@ // ── signals ─────────────────────────────────────────────────── MapArea.Drawn += OnMapDrawn; - HeartWaveArea.Drawn += (o, a) => DrawWave(a, HeartWaveArea, _heartWave, _heartCursor, 0.86, 0.22, 0.20); - BreathWaveArea.Drawn += (o, a) => DrawWave(a, BreathWaveArea, _breathWave, _breathCursor, 0.21, 0.57, 0.78); + HeartWaveArea.Drawn += (o, a) => DrawWave(a, HeartWaveArea, _heartWave, _heartCursor, + _heartAudible && HeartAllowed, 0.86, 0.22, 0.20); + BreathWaveArea.Drawn += (o, a) => DrawWave(a, BreathWaveArea, _breathWave, _breathCursor, + _breathAudible && LungAllowed, 0.21, 0.57, 0.78); MapBackButton.Clicked += OnBackClicked; BodySkeletonRadio.Toggled += (s, e) => { if (BodySkeletonRadio.Active) ReloadBody(); }; @@ -310,23 +329,38 @@ if (ShowNumbersSwitch != null) ShowNumbersSwitch.AddNotification("active", (o, a) => MapArea.QueueDraw()); + + // 番号を表示 is a calibration aid: only offered in debug mode (--debug or + // EARS_DEBUG=1). Outside debug mode the row is hidden and numbers stay off. + if (ShowNumbersSwitchRow != null) + { + ShowNumbersSwitchRow.NoShowAll = true; // survives window.ShowAll() + ShowNumbersSwitchRow.Visible = AppConfig.DebugMode; + } + if (!AppConfig.DebugMode && ShowNumbersSwitch != null) + ShowNumbersSwitch.Active = false; + + // Left panel: fixed in normal mode (sized in touch_friendly.css to fit), + // scrollable in debug mode because of the extra 番号を表示 row. + if (MapControlScroller != null) + MapControlScroller.SetPolicy(PolicyType.Never, + AppConfig.DebugMode ? PolicyType.Automatic : PolicyType.Never); if (ShowVolumeMapSwitch != null) ShowVolumeMapSwitch.AddNotification("active", (o, a) => MapArea.QueueDraw()); + // 聴診点リスト = colour legend + live level per sound, in both modes: + // legacy lists the 7 regions, current mode lists heart / breath. if (ShowPointListSwitch != null) + { ShowPointListSwitch.AddNotification("active", (o, a) => { - Logger.Write("map", "point list " + (ShowPointListSwitch.Active ? "ON" : "OFF") + - (AppMode.Legacy ? "" : " (no effect: not legacy mode)")); + Logger.Write("map", "point list " + (ShowPointListSwitch.Active ? "ON" : "OFF")); MapArea.QueueDraw(); }); - - // The point list is the legacy 7-region meter panel. Current mode has - // no equivalent, so the switch is hidden there instead of doing nothing. - if (ShowPointListSwitchRow != null) - { - ShowPointListSwitchRow.NoShowAll = true; - ShowPointListSwitchRow.Visible = AppMode.Legacy; } + + HookFilter(SoundMixRadio, SoundFilter.Mix); + HookFilter(SoundHeartOnlyRadio, SoundFilter.HeartOnly); + HookFilter(SoundLungOnlyRadio, SoundFilter.LungOnly); if (BlackAudioSwitch != null) BlackAudioSwitch.AddNotification("active", (o, a) => { @@ -415,6 +449,22 @@ }; } + private void HookFilter(RadioButton rb, SoundFilter f) + { + if (rb == null) return; // older glade without the segment + rb.Toggled += (s, e) => + { + if (!rb.Active || _filter == f) return; + _filter = f; + Logger.Write("audio", "filter -> " + f); + _lastPx = _lastPy = -1; // force a re-mix at the current spot + UpdateAudioFromPosition(); + HeartWaveArea.QueueDraw(); + BreathWaveArea.QueueDraw(); + MapArea.QueueDraw(); + }; + } + private void HookView(RadioButton rb, string view) { if (rb == null) return; @@ -520,7 +570,7 @@ !TryGetCursorBodyPoint(out lbx, out lby)) { MuteRegions(); - _audible = false; + SetAudible(false, false); return; } ApplyRegionAudio(lbx, lby); @@ -563,17 +613,36 @@ /// matches the Windows build. private void ApplyLevel(int level) { - _audible = level > 0; - _sound.SetGain(_caseVoice, AudioEngine.VolumeCurve(level)); + bool caseIsHeart = _case != null && _case.IsHeart; + bool caseAllowed = caseIsHeart ? HeartAllowed : LungAllowed; - if (_heart1 != null) _sound.SetGain(_heart1, AudioEngine.VolumeCurve(level / 3)); - if (_heart2 != null) _sound.SetGain(_heart2, AudioEngine.VolumeCurve(level / 3)); - if (_breath != null) _sound.SetGain(_breath, AudioEngine.VolumeCurve(level / 4)); + float caseGain = caseAllowed ? AudioEngine.VolumeCurve(level) : 0f; + float heartGain = (_heart1 != null && HeartAllowed) ? AudioEngine.VolumeCurve(level / 3) : 0f; + float lungGain = (_breath != null && LungAllowed) ? AudioEngine.VolumeCurve(level / 4) : 0f; + + _sound.SetGain(_caseVoice, caseGain); + if (_heart1 != null) _sound.SetGain(_heart1, heartGain); + if (_heart2 != null) _sound.SetGain(_heart2, heartGain); + if (_breath != null) _sound.SetGain(_breath, lungGain); + + _legendHeart = caseIsHeart ? caseGain : heartGain; + _legendBreath = caseIsHeart ? lungGain : caseGain; + SetAudible(_legendHeart > 0f, _legendBreath > 0f); + MapArea.QueueDraw(); // legend levels + } + + /// Which waveform boxes have a sound playing right now. + private void SetAudible(bool heart, bool breath) + { + _heartAudible = heart; + _breathAudible = breath; + _audible = heart || breath; } private void MuteVoices() { - _audible = false; + SetAudible(false, false); + _legendHeart = _legendBreath = 0f; _lastPx = _lastPy = -1; _sound.SetGain(_caseVoice, 0f); if (_heart1 != null) _sound.SetGain(_heart1, 0f); @@ -942,8 +1011,8 @@ bool hideMeters = HideMetersCheck != null ? HideMetersCheck.Active : ShowPointListSwitch != null ? !ShowPointListSwitch.Active : true; - if (AppMode.Legacy && _regions.Count > 0 && !hideMeters) - DrawRegionMeters(cr); + if (!hideMeters) + DrawRegionMeters(cr); // colour legend + live levels, both modes args.RetVal = true; } @@ -1054,6 +1123,19 @@ AddSpin(col, "MapY", "Offset Y (px)", -600, 600, 1, 0); AddSpin(col, "MapAlpha", "Opacity", 0.00, 1.00, 0.05, 2); + // legacy: pixels below this are silent and not drawn + var minSpin = new SpinButton(0, 255, 1); + minSpin.Value = RegionSound.MinIntensity; + minSpin.ValueChanged += (s, e) => + { + RegionSound.MinIntensity = (int)minSpin.Value; + if (AppMode.Legacy) RebuildLegacyMap(); + _lastPx = _lastPy = -1; + UpdateAudioFromPosition(); + MapArea.QueueDraw(); + }; + col.PackStart(Row("Legacy silence <", minSpin), false, false, 0); + col.PackStart(Header("Circle cluster"), false, false, 0); AddSpin(col, "OffsetX", "Offset X (px)", -600, 600, 1, 0); AddSpin(col, "OffsetY", "Offset Y (px)", -600, 600, 1, 0); @@ -1808,7 +1890,10 @@ MapArea.QueueDraw(); } - private void DrawWave(DrawnArgs args, DrawingArea area, WaveData wave, double cursor,double r, double g, double b) + /// audible = this box's sound is playing now. A silent box draws its wave + /// faded and without a cursor, so you can tell at a glance what you hear. + private void DrawWave(DrawnArgs args, DrawingArea area, WaveData wave, double cursor, + bool audible, double r, double g, double b) { var cr = args.Cr; int w = area.AllocatedWidth, h = area.AllocatedHeight; @@ -1818,11 +1903,11 @@ cr.Rectangle(0, 0, w, h); cr.Fill(); - cr.SetSourceRGB(r, g, b); + cr.SetSourceRGBA(r, g, b, audible ? 1.0 : 0.30); if (wave == null || wave.Samples == null || w < 2) { - // no sound for this box — flat line as before + // no sound of this kind in the case — flat line cr.LineWidth = 1.5; cr.MoveTo(0, mid); cr.LineTo(w, mid); @@ -1846,7 +1931,7 @@ } cr.Stroke(); - if (cursor >= 0) + if (audible && cursor >= 0) { double cx = Math.Min(w - 1, cursor * w); cr.SetSourceRGB(0.1, 0.1, 0.1); // dark cursor, contrasts with red and blue waves @@ -1859,35 +1944,36 @@ args.RetVal = true; } + /// Each box shows a sound that this case can actually play: + /// legacy — the first heart region / first breath region (ApplyRegionAudio + /// then switches to whichever region is loudest); + /// current — the case sound in its own box; the other box only if that + /// extra voice (HeartSoundEnabled / BreathSoundEnabled) is loaded. private void LoadWaveforms(CaseDefinition def) { _heartCursor = _breathCursor = -1; + SetAudible(false, false); - // Legacy has no SoundPath; show the first active region's sound instead - string caseSound = def.SoundPath; if (def.IsLegacy) { - caseSound = null; - for (int k = 0; k < 7 && caseSound == null; k++) - if (AppMode.ResolveSound(def.RegionSounds[k]) != null) - caseSound = def.RegionSounds[k]; - } - - WaveData caseWave = LoadWave(caseSound); - - if (def.IsHeart) - { - _heartWave = caseWave; - _breathWave = LoadWave("SND200.wav"); // default breath sound - _heartLive = true; - _breathLive = BreathSoundEnabled; + RegionSound h = _regions.Find(r => r.IsHeart && r.Wave != null); + RegionSound b = _regions.Find(r => !r.IsHeart && r.Wave != null); + _heartWave = h != null ? h.Wave : null; + _breathWave = b != null ? b.Wave : null; } else { - _breathWave = caseWave; - _heartWave = LoadWave("SND100.wav"); // default heart sound - _breathLive = true; - _heartLive = HeartSoundEnabled; + WaveData caseWave = LoadWave(def.SoundPath); + if (def.IsHeart) + { + _heartWave = caseWave; + _breathWave = _breath != null ? LoadWave("SND200.wav") : null; + } + else + { + _breathWave = caseWave; + _heartWave = _heart1 != null ? LoadWave("SND100.wav") : null; + } } HeartWaveArea.QueueDraw(); @@ -1896,11 +1982,11 @@ private static WaveData LoadWave(string csvValue) { - string full = AppMode.ResolveSound(csvValue); // null-safe, uses shared sound/ folder + string full = AppMode.ResolveSound(csvValue); if (full == null) { Logger.Write("wave", "no sound for waveform (" + (csvValue ?? "null") + ")"); - return null; // draw code already shows a flat line + return null; // draw code shows a flat line } string err; @@ -1920,32 +2006,26 @@ private void StopWaveTimer() { if (_waveTimerId != 0) { GLib.Source.Remove(_waveTimerId); _waveTimerId = 0; } - _audible = false; + SetAudible(false, false); _heartCursor = _breathCursor = -1; if (HeartWaveArea != null) HeartWaveArea.QueueDraw(); if (BreathWaveArea != null) BreathWaveArea.QueueDraw(); } + /// Each box runs its own cursor, only while its own sound is audible. + /// All voices were started together with _playClock, so t % duration is + /// where each one is in its loop. private bool OnWaveTick() { - if (!_audible) - { - // muted: hide the cursor (redraw only once, when it disappears) - if (_heartCursor >= 0 || _breathCursor >= 0) - { - _heartCursor = _breathCursor = -1; - HeartWaveArea.QueueDraw(); - BreathWaveArea.QueueDraw(); - } - return true; - } - double t = _playClock.Elapsed.TotalSeconds; - _heartCursor = _heartLive ? CursorFor(_heartWave, t) : -1; - _breathCursor = _breathLive ? CursorFor(_breathWave, t) : -1; + bool heartOn = _heartAudible && HeartAllowed; + bool breathOn = _breathAudible && LungAllowed; - HeartWaveArea.QueueDraw(); - BreathWaveArea.QueueDraw(); + double hc = heartOn ? CursorFor(_heartWave, t) : -1; + double bc = breathOn ? CursorFor(_breathWave, t) : -1; + + if (hc >= 0 || _heartCursor >= 0) { _heartCursor = hc; HeartWaveArea.QueueDraw(); } + if (bc >= 0 || _breathCursor >= 0) { _breathCursor = bc; BreathWaveArea.QueueDraw(); } return true; } @@ -1992,6 +2072,7 @@ // looping and being mixed even at gain 0, so they must not pile up. _sound.ReleaseWhereKeyStarts("R"); + var waves = new Dictionary(StringComparer.OrdinalIgnoreCase); for (int k = 0; k < 7; k++) { string mapPath = AppMode.ResolveMap(def.RegionMaps[k]); @@ -2016,10 +2097,21 @@ var rs = new RegionSound { - Index = k, Name = RegionLabels[k], + Index = k, Name = RegionLabels[k], SoundPath = sndPath, Map = pb, Voice = voice }; rs.CachePixels(); + + // waveform for this region's own sound (shared when regions reuse a file) + WaveData w; + if (!waves.TryGetValue(sndPath, out w)) + { + string err; + w = WaveData.Load(sndPath, out err); + if (w == null) Logger.Write("wave", "load failed " + sndPath + ": " + err); + waves[sndPath] = w; + } + rs.Wave = w; _regions.Add(rs); Logger.Write("map", "region " + RegionLabels[k] + ": " + @@ -2033,7 +2125,7 @@ private void ApplyRegionAudio(double bx, double by) { double u, v; - if (!BodyToMapUV(bx, by, out u, out v)) { MuteRegions(); _audible = false; return; } + if (!BodyToMapUV(bx, by, out u, out v)) { MuteRegions(); SetAudible(false, false); return; } if (_view == "back") u = 1.0 - u; // mirrored front map foreach (var r in _regions) r.Volume = r.VolumeAt(u, v); @@ -2047,11 +2139,32 @@ else h1.Volume = 0f; } + // 心音のみ / 肺音のみ / ミックス + foreach (var r in _regions) + if (r.IsHeart ? !HeartAllowed : !LungAllowed) r.Volume = 0f; + foreach (var r in _regions) _sound.SetGain(r.Voice, r.Volume); - _audible = _regions.Exists(r => r.Volume > 0f); // drives the waveform cursors + + // Each waveform box shows the loudest sound of its own kind, so with + // heart + breath both playing you see two waves and two cursors. + RegionSound hTop = Loudest(true), bTop = Loudest(false); + if (hTop != null && hTop.Wave != null && hTop.Wave != _heartWave) { _heartWave = hTop.Wave; HeartWaveArea.QueueDraw(); } + if (bTop != null && bTop.Wave != null && bTop.Wave != _breathWave) { _breathWave = bTop.Wave; BreathWaveArea.QueueDraw(); } + SetAudible(hTop != null, bTop != null); + MapArea.QueueDraw(); // repaint the meters } + /// Loudest currently-audible region of one kind, or null if none is playing. + private RegionSound Loudest(bool heart) + { + RegionSound best = null; + foreach (var r in _regions) + if (r.IsHeart == heart && r.Volume > 0f && (best == null || r.Volume > best.Volume)) + best = r; + return best; + } + private void MuteRegions() { if (_regions.Count == 0) return; @@ -2080,7 +2193,7 @@ double u = (x + 0.5) / w; if (mirror) u = 1.0 - u; int val = r.IntensityAt(u, v); - if (val < 12) continue; + if (val < RegionSound.MinIntensity) continue; // same cut-off as the audio int k = y * w + x; if (val <= best[k]) continue; @@ -2098,51 +2211,94 @@ return new Gdk.Pixbuf(px, Gdk.Colorspace.Rgb, true, 8, w, h, stride); } + /// 聴診点リスト: one row per sound — colour swatch (the colour it has on the + /// map), name, live volume bar. Rows the case doesn't have are grey; + /// rows muted by the 心音のみ / 肺音のみ filter are dimmed. private void DrawRegionMeters(Cairo.Context cr) { if (!_showRegionLabels) return; - const double rowH = 30, barX = 140, barW = 170, barH = 14, pad = 12; + // rows: label, colour, present?, allowed?, level 0..1 + var labels = new List(); + var colors = new List(); + var present = new List(); + var allowed = new List(); + var levels = new List(); + + if (AppMode.Legacy) + { + for (int k = 0; k < 7; k++) + { + RegionSound r = _regions.Find(rs => rs.Index == k); + byte[] c = RegionColors[k]; + labels.Add(RegionLabels[k]); + colors.Add(new[] { c[0] / 255.0, c[1] / 255.0, c[2] / 255.0 }); + present.Add(r != null && r.Enabled); + allowed.Add(k <= 1 ? HeartAllowed : LungAllowed); + levels.Add(r != null ? r.Volume : 0.0); + } + } + else + { + bool en = _lang != null && _lang.IsEnglish; + bool caseHeart = _case != null && _case.IsHeart; + labels.Add(en ? "Heart (red)" : "心音(赤)"); + colors.Add(new[] { 0.776, 0.157, 0.157 }); + present.Add(caseHeart || _heart1 != null); + allowed.Add(HeartAllowed); + levels.Add(_legendHeart); + + labels.Add(en ? "Breath (blue)" : "呼吸音(青)"); + colors.Add(new[] { 0.122, 0.435, 0.698 }); + present.Add(!caseHeart || _breath != null); + allowed.Add(LungAllowed); + levels.Add(_legendBreath); + } + + int n = labels.Count; + const double rowH = 30, sw = 16, labelX = 12 + sw + 10, barX = 168, barW = 150, barH = 12, pad = 12; double y0 = pad; cr.Save(); cr.NewPath(); cr.SetSourceRGBA(0, 0, 0, 0.72); - cr.Rectangle(pad - 6, y0 - 6, barX + barW + 12, 7 * rowH + 12); + cr.Rectangle(pad - 6, y0 - 6, barX + barW + 12, n * rowH + 12); cr.Fill(); var layout = Pango.CairoHelper.CreateLayout(cr); - layout.FontDescription = Pango.FontDescription.FromString("Noto Sans CJK JP Bold 15"); + layout.FontDescription = Pango.FontDescription.FromString("Noto Sans CJK JP Bold 14"); - for (int k = 0; k < 7; k++) + for (int k = 0; k < n; k++) { - RegionSound r = _regions.Find(rs => rs.Index == k); - bool active = r != null && r.Enabled; - double vol = active ? r.Volume : 0.0; - double y = y0 + k * rowH; + double y = y0 + k * rowH; + double[] c = colors[k]; + bool on = present[k] && allowed[k]; + double a = present[k] ? (allowed[k] ? 1.0 : 0.35) : 0.25; + + // colour swatch — always shown, so it works as a key + cr.NewPath(); + cr.SetSourceRGBA(c[0], c[1], c[2], a); + cr.Rectangle(pad, y + (rowH - sw) / 2.0, sw, sw); + cr.Fill(); // label - layout.SetText(RegionLabels[k]); + layout.SetText(labels[k]); int lw, lh; layout.GetPixelSize(out lw, out lh); - if (active) cr.SetSourceRGB(1, 1, 1); - else cr.SetSourceRGB(0.55, 0.55, 0.55); - cr.MoveTo(pad, y + (rowH - lh) / 2.0); + cr.SetSourceRGBA(1, 1, 1, present[k] ? (allowed[k] ? 1.0 : 0.45) : 0.35); + cr.MoveTo(labelX, y + (rowH - lh) / 2.0); Pango.CairoHelper.ShowLayout(cr, layout); cr.NewPath(); - // bar background + // live level double by = y + (rowH - barH) / 2.0; cr.SetSourceRGB(0.30, 0.30, 0.30); cr.Rectangle(barX, by, barW, barH); cr.Fill(); - - // bar fill - if (active) + if (on && levels[k] > 0) { - byte[] c = RegionColors[k]; - cr.SetSourceRGB(c[0] / 255.0, c[1] / 255.0, c[2] / 255.0); - cr.Rectangle(barX, by, barW * vol, barH); + cr.SetSourceRGB(c[0], c[1], c[2]); + cr.Rectangle(barX, by, barW * Math.Min(1.0, levels[k]), barH); cr.Fill(); } } diff --git a/program/RegionSound.cs b/program/RegionSound.cs index 519ccb2..7cd495b 100644 --- a/program/RegionSound.cs +++ b/program/RegionSound.cs @@ -3,10 +3,16 @@ public class RegionSound : IDisposable { + /// Pixels below this are silent AND not drawn in the overlay, so what you + /// see is where you can hear it. Adjustable live in the tuner (Ctrl+T). + public static int MinIntensity = 12; + public int Index; // 0,1 = heart; 2..6 = breath public string Name; + public string SoundPath; // for the legend / waveform public Gdk.Pixbuf Map; // raw, NOT black-keyed — audio reference public AudioEngine.Voice Voice; // owned by AudioEngine's cache + public WaveData Wave; // waveform of this region's sound (may be null) public float Volume; public bool Enabled = true; @@ -40,15 +46,18 @@ return r != 0 ? r : b; // Python: R if R != 0 else B } - /// Python EarsSound.volume_change: non-linear curve, breath halved. + /// Python's (v/255)^(1/9.5) is only the first step of Form2's curve; the + /// result is then converted through decibels (AudioEngine.VolumeCurve). + /// Using the first step directly as the gain made a pixel value of 1 play + /// at 56% — the faint edge of every map was almost full volume. public float VolumeAt(double u, double v) { if (!Enabled) return 0f; int val = IntensityAt(u, v); - if (val == 0) return 0f; + if (val < MinIntensity) return 0f; - float vol = (float)Math.Pow(val / 255.0, 1.0 / 9.5); - if (!IsHeart) vol *= 0.5f; + float vol = AudioEngine.VolumeCurve(val); + if (!IsHeart) vol *= 0.5f; // Python: breath halved return Math.Max(0f, Math.Min(1f, vol)); } @@ -57,5 +66,6 @@ if (Map != null) { Map.Dispose(); Map = null; } _px = null; Voice = null; // engine keeps and reuses it + Wave = null; } } \ No newline at end of file diff --git a/program/homepageallv8.glade b/program/homepageallv8.glade index f033ca9..8398c53 100644 --- a/program/homepageallv8.glade +++ b/program/homepageallv8.glade @@ -293,7 +293,7 @@ 20 True True - 0 + 0 0 @@ -312,7 +312,7 @@ 20 True True - 0 + 0 0 @@ -331,7 +331,7 @@ 20 True True - 0 + 0 0 @@ -1166,7 +1166,7 @@ - + MapToggleRow True @@ -1251,6 +1251,84 @@ 13 + + + + MapSectionLabel + True + False + 10 + 0 + 再生する音 + + + False + True + 14 + + + + + MapSegment + True + False + 4 + True + + + SoundMixRadio + ミックス + True + True + False + True + False + + + True + True + 0 + + + + + SoundHeartOnlyRadio + 心音のみ + True + True + False + False + SoundMixRadio + + + True + True + 1 + + + + + SoundLungOnlyRadio + 肺音のみ + True + True + False + False + SoundMixRadio + + + True + True + 2 + + + + + False + True + 15 + + @@ -1263,7 +1341,7 @@ True True - 14 + 16 @@ -1279,7 +1357,7 @@ False True - 15 + 17 @@ -1554,4 +1632,4 @@ - \ No newline at end of file + diff --git a/program/touch_friendly.css b/program/touch_friendly.css index c90c152..55cd54b 100644 --- a/program/touch_friendly.css +++ b/program/touch_friendly.css @@ -561,4 +561,73 @@ #PowerOffConfirm { background-color: #C62828; } #PowerOffConfirm:hover { background-color: #D33A3A; } -#PowerOffConfirm:active { background-color: #A61F1F; } \ No newline at end of file +#PowerOffConfirm:active { background-color: #A61F1F; } + +/* ══════════════════════════════════════════════════════════════════ + MAP PAGE ADDITIONS — paste at the very END of touch_friendly.css. + The "compact side panel" part overrides sizes defined earlier in the + file, so it must come after them. + ══════════════════════════════════════════════════════════════════ */ + +/* ── 再生する音: ミックス / 心音のみ / 肺音のみ ── + Same look as the body / size segments; the selected chip is tinted + red for heart and blue for lung so it matches the waveform cards. */ +#SoundMixRadio, #SoundHeartOnlyRadio, #SoundLungOnlyRadio, +#SoundMixRadio button, #SoundHeartOnlyRadio button, #SoundLungOnlyRadio button { + min-height: 38px; + background-color: transparent; + background-image: none; + border-width: 0; + border-radius: 7px; + box-shadow: none; + outline-style: none; +} +#SoundMixRadio label, #SoundHeartOnlyRadio label, #SoundLungOnlyRadio label { + font-size: 16px; + font-weight: 500; + color: #4A505B; +} +#SoundMixRadio:hover, #SoundHeartOnlyRadio:hover, #SoundLungOnlyRadio:hover { + background-color: rgba(255, 255, 255, 0.55); +} +#SoundMixRadio:checked, #SoundHeartOnlyRadio:checked, #SoundLungOnlyRadio:checked, +#SoundMixRadio button:checked, #SoundHeartOnlyRadio button:checked, +#SoundLungOnlyRadio button:checked { + background-color: #FFFFFF; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); +} +#SoundMixRadio:checked label { color: #0B3B6B; font-weight: 700; } +#SoundHeartOnlyRadio:checked label { color: #C62828; font-weight: 700; } +#SoundLungOnlyRadio:checked label { color: #1F6FB2; font-weight: 700; } + +/* ── compact side panel: fits 1280x800 with no scrolling ── + MapWindow turns scrolling off in normal mode and on in debug mode + (debug adds the 番号を表示 row, so it may need to scroll). */ +#MapControlBox { padding: 10px 14px; } + +#MapSegment { padding: 3px; } + +#BodySkeletonRadio, #BodyJacketRadio, #SizeLRadio, #SizeXLRadio, +#ViewFrontRadio, #ViewBackRadio, #ViewRightRadio, #ViewLeftRadio, +#BodySkeletonRadio button, #BodyJacketRadio button, +#SizeLRadio button, #SizeXLRadio button, +#ViewFrontRadio button, #ViewBackRadio button, +#ViewRightRadio button, #ViewLeftRadio button, +#SoundMixRadio, #SoundHeartOnlyRadio, #SoundLungOnlyRadio, +#SoundMixRadio button, #SoundHeartOnlyRadio button, #SoundLungOnlyRadio button { + min-height: 34px; +} +#BodySkeletonRadio label, #BodyJacketRadio label, +#SizeLRadio label, #SizeXLRadio label, +#ViewFrontRadio label, #ViewBackRadio label, +#ViewRightRadio label, #ViewLeftRadio label { + font-size: 17px; +} + +#MapToggleRow { min-height: 34px; } +#MapToggleLabel { font-size: 17px; } + +#MapSectionLabel, #JacketSizeLabel { font-size: 14px; } + +#SoundTestButton { min-height: 40px; } +#SoundTestButton label { font-size: 18px; } \ No newline at end of file