mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
Kernel+Userland: Add option for duration of /dev/beep producing sound
This commit is contained in:
parent
1b00618fd9
commit
26f96d2a42
6 changed files with 13 additions and 5 deletions
|
@ -11,9 +11,11 @@
|
|||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
Optional<size_t> tone;
|
||||
Optional<size_t> milliseconds_duration;
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(tone, "Beep tone", "beep-tone", 'f', "Beep tone (frequency in Hz)");
|
||||
args_parser.add_option(milliseconds_duration, "Duration", "duration", 'n', "Duration (in milliseconds)");
|
||||
args_parser.parse(arguments);
|
||||
TRY(Core::System::beep(tone.value_or(440)));
|
||||
TRY(Core::System::beep(tone.value_or(440), milliseconds_duration.value_or(200)));
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue