Closed jpirnay closed 1 week ago
The PR implements user-configurable beep sounds by adding a new preference setting and refactoring the sound playing logic. The implementation uses a dictionary-based approach for platform-specific sound file paths and introduces dedicated player functions for each supported platform. The changes also include improved error handling and sound file validation.
sequenceDiagram
actor User
participant System
participant WindowsPlayer
participant DarwinPlayer
participant LinuxPlayer
User->>System: Issue 'beep' command
System->>System: Determine OS_NAME
alt Windows
System->>WindowsPlayer: Play sound
WindowsPlayer->>System: Use default or custom sound
else Darwin
System->>DarwinPlayer: Play sound
DarwinPlayer->>System: Use default or custom sound
else Linux
System->>LinuxPlayer: Play sound
LinuxPlayer->>System: Use default or custom sound
end
classDiagram
class Kernel {
+console_command beep
+console_argument sleeptime
}
class SoundPlayer {
+_play_windows()
+_play_darwin()
+_play_linux()
}
class Preferences {
+beep_soundfile: str
+default_snd: str
+wildcard: str
}
Kernel --> SoundPlayer
Kernel --> Preferences
note for Preferences "Handles user-configurable sound settings"
Change | Details | Files |
---|---|---|
Refactor beep command implementation with platform-specific sound handling |
|
meerk40t/kernel/kernel.py |
Add user interface elements for custom sound file configuration |
|
meerk40t/gui/wxmeerk40t.py |
@sourcery-ai review
@sourcery-ai review
Summary by Sourcery
Add user-configurable beep sound feature, enabling users to select custom sound files for the beep command across different operating systems.
New Features:
Enhancements: