Repository navigation
Conversation
- 新增 Services:AudioPeakMeter(门面)、AudioDeviceEnumerator(设备枚举与缓存)、ContinuousPeakCapture(常驻静默捕获流)、OneShotPeakCapture(一次性三级回退采样)、DecibelCalculator(线性峰值与显示刻度换算)、PeakSample(采样结果纯数据)。 - 新增插件全局设置 DecibelMonitorGlobalSettings 与持久化服务 DecibelMonitorSettingsService(整体反序列化,新增设置项无需同步维护)。 - Plugin.Initialize 注册全局设置服务与共享采样服务;组件将在后续 PR 切换为该服务。 - 新增 Tests/Decibel_Monitor.Tests(xunit),覆盖计算换算与采样数据纯逻辑,共 28 条用例全绿。 由 VS Code 中的 Cline 辅助生成。
- DecibelComponent 从宿主 DI 获取 AudioPeakMeter 与 DecibelMonitorSettingsService,改用 DecibelCalculator 做线性峰值到显示刻度的换算,不再自行枚举设备并三级回退采样。 - 数值改用 AvaloniaProperty(StyledProperty)绑定,移除手写的 INotifyPropertyChanged;采样 Tick 增加节流,避免异步任务堆积;放大倍数取自全局设置,同一麦克风所有组件数值一致。 - 组件设置控件精简为显示侧偏好(分贝前缀、更新频率);测量/校准与提醒设置分别移至插件设置页与通知提供方设置。 - Plugin 移除重复的 GetVoicePeakValue()。 - 编译警告由 3 个降为 0 个(原 CS0108/CS4014 随旧实现一并移除)。 由 VS Code 中的 Cline 辅助生成。
This was referenced Sep 14, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
组件不再自行枚举设备与回退采样,改用 #6 引入的共享采样服务;组件设置只保留「显示侧」偏好。
这是「分贝监测插件重构与提醒功能」拆分系列的第 2/5 个 PR:
变更
DecibelComponent:通过IAppHost.Host.Services获取AudioPeakMeter与DecibelMonitorSettingsService,用DecibelCalculator做线性峰值到显示刻度的换算;数值改用AvaloniaProperty(StyledProperty)绑定,移除手写的INotifyPropertyChanged;采样 Tick 增加节流,避免上一次采样未结束时堆积异步任务;放大倍数取自全局设置,同一麦克风的各组件数值一致。DecibelComponentSettingsControl:由 249 行精简为纯显示偏好(分贝前缀、更新频率);测量/校准在 feat: 新增插件设置页并将校准上收为全局设置 #9 的插件设置页,提醒设置移到 feat: 新增分贝阈值提醒(通知提供方 + 渠道 + 组件提示) #8 的通知侧。Plugin:移除重复的GetVoicePeakValue()(组件不再使用)。验证
组件显示与数值刷新已在宿主 ClassIsland 中人工实测(分贝前缀、更新频率、数值随声源变化)。
说明
本 PR 由 AI 辅助生成。