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 辅助生成。
- 新增 DecibelNotificationProvider:继承 NotificationProviderBase<DecibelNotificationProviderSettings> 以获得宿主自动持久化的通知侧设置,注册「超过分贝阈值」渠道并通过 Channel(...) 发送,与内置通知提供方保持一致。 - 提醒判定抽为纯函数 DecibelAlertEvaluator.Evaluate(...):严格大于阈值才触发、冷却期内不重复通知; 配套 9 条边界单元测试(等于阈值不触发、冷却中不通知、冷却刚过可通知、冷却下限 1 分钟等),单元测试总数 37 条全绿。 - 新增通知侧设置控件:启用提醒、阈值(dB)、提醒文字、冷却时间(分钟)。 - 组件展示评估结果:超阈值时显示红色提示文字,可用组件设置里的「组件内提示」关闭(关闭后仍照常发送通知); 提供方实例动态读取,避免组件先于 IHostedService 创建导致提醒永久失效。 - README 补充阈值提醒的使用方式、设置项与排查说明。 由 VS Code 中的 Cline 辅助生成。
- 新增插件设置页(设置 → Decibel_Monitor,External 分类):全局校准(参考 dB 0..150、放大倍数、校准按钮)、 持续监听麦克风与采样参数、默认捕获设备信息与捕获设备列表诊断。 - 校准改为调用 AudioPeakMeter.CaptureSamplePeakAsync 显式采样一次,结果写入全局放大倍数, 插件内所有组件立即生效(同一麦克风各组件数值一致)。 - Plugin 注册设置页;Decibel_Monitor.csproj 补充设置页 XAML 与代码后置的 DependentUpon。 - README 更新:设置分布(组件设置 / 通知设置 / 插件设置页三处)、校准位置由组件设置改为插件设置页、 补充全局设置项与故障排查说明。 由 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.
概述
新增插件设置页,并把测量/校准上收为插件级全局设置(同一麦克风的所有组件数值一致)。
这是「分贝监测插件重构与提醒功能」拆分系列的第 4/5 个 PR:
变更
Views/SettingsPages/DecibelMonitorSettingsPage(设置 → Decibel_Monitor,External 分类):AudioPeakMeter.CaptureSamplePeakAsync显式采样一次,用DecibelCalculator.CalculateMagnification计算并保存全局放大倍数,插件内所有组件立即生效(避免各组件数值不一致)。Plugin注册设置页;Decibel_Monitor.csproj补充设置页 XAML/代码后置的DependentUpon。验证
设置页 UI、校准按钮与设备诊断需要真实宿主与麦克风,已在本机 ClassIsland 中人工实测,无头 CI 无法覆盖。
说明
本 PR 由 AI 辅助生成。