-
Notifications
You must be signed in to change notification settings - Fork 106
refactor: replace pactl scripts with pulseaudio API calls #953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. Replace os/exec.Command("pactl", ...) calls with native pulseaudio
context methods
2. Add UnloadModuleByName and UnloadModule methods to audio context
3. Remove unused unsetMono() function from sink.go
4. Add doActionByName helper for gesture actions
5. Update gesture manager to show multi-task view on bottom swipe
6. Upgrade go-dbus-factory and go-lib dependencies for new API support
Log: Improved audio module management reliability and added bottom swipe
gesture for multi-task view
Influence:
1. Test audio mono mode toggle functionality
2. Verify echo-cancel module loading/unloading
3. Test bottom edge swipe gesture triggers multi-task view
4. Check audio module cleanup on service restart
5. Verify gesture action name resolution works correctly
6. Test pulseaudio context connection stability
refactor: 使用 pulseaudio API 替代 pactl 脚本调用
1. 将 os/exec.Command("pactl", ...) 调用替换为原生 pulseaudio 上下文方法
2. 为音频上下文添加 UnloadModuleByName 和 UnloadModule 方法
3. 从 sink.go 中移除未使用的 unsetMono() 函数
4. 为手势操作添加 doActionByName 辅助函数
5. 更新手势管理器,底部滑动时显示多任务视图
6. 升级 go-dbus-factory 和 go-lib 依赖以支持新 API
Log: 提升音频模块管理可靠性,新增底部滑动多任务视图手势
Influence:
1. 测试音频单声道模式切换功能
2. 验证回声消除模块的加载/卸载
3. 测试底部边缘滑动手势触发多任务视图
4. 检查服务重启时的音频模块清理
5. 验证手势操作名称解析功能
6. 测试 pulseaudio 上下文连接稳定性
PMS: BUG-288445
Reviewer's GuideThis PR refactors audio module management by replacing external pactl calls with native pulseaudio API methods, adds dedicated unload module functions, cleans up unused code, enhances gesture handling by introducing a doActionByName helper and enabling a bottom-swipe multi-task view, and upgrades go-dbus-factory and go-lib dependencies. Sequence diagram for audio module unloading using pulseaudio APIsequenceDiagram
participant Audio
participant Context
Audio->>Context: UnloadModuleByName("module-echo-cancel")
Context-->>Audio: Module unloaded
Sequence diagram for gesture action resolution using doActionByNamesequenceDiagram
participant Manager
participant doActionByName
participant actionInfo
Manager->>doActionByName: doActionByName("ShowMultiTask")
doActionByName->>actionInfo: Find action with Name="ShowMultiTask"
actionInfo-->>doActionByName: Execute fn()
doActionByName-->>Manager: Return result
Class diagram for updated Audio context and module managementclassDiagram
class Audio {
+SetMono(enable bool) *dbus.Error
+unsetMono()
+setMono(enable bool) error
+unsetReduceNoise()
+hasReduceNoise(source string) bool
}
class Context {
+UnloadModuleByName(name string)
+UnloadModule(index int)
}
Audio --> Context : uses
class Sink {
+SetVolume(value float64, isPlay bool) *dbus.Error
+SetMono(enable bool) error
}
Sink --> Audio : uses
Class diagram for updated Gesture Manager and action handlingclassDiagram
class Manager {
+Exec(evInfo EventInfo) error
+GetInterfaceName() string
+handleTouchEdgeMoveStopLeave(context *touchEventContext, edge string, position string, p Point) error
}
class actionInfo {
+Name string
+fn func() error
}
class doActionByName {
+doActionByName(name string) error
}
Manager --> doActionByName : uses
doActionByName --> actionInfo : iterates actions
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deepin pr auto review我来分析这个代码变更:
总体来说,这次代码变更提高了代码质量和安全性,减少了外部依赖,是一个很好的改进。建议继续完善错误处理和日志记录。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Log: Improved audio module management reliability and added bottom swipe gesture for multi-task view
Influence:
refactor: 使用 pulseaudio API 替代 pactl 脚本调用
Log: 提升音频模块管理可靠性,新增底部滑动多任务视图手势
Influence:
PMS: BUG-288445
Summary by Sourcery
Refactor audio management to use native Pulseaudio API, streamline module loading/unloading, enhance gesture handling with a bottom-swipe multi-task view, and update dependencies.
New Features:
Enhancements:
Build:
Chores: