mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:37:45 +00:00
Kernel+Userland: Add support for using the PCSpeaker with various tones
This commit is contained in:
parent
2d27c98659
commit
11a7e21c2a
9 changed files with 26 additions and 12 deletions
|
@ -924,9 +924,9 @@ int gettid()
|
|||
return cached_tid;
|
||||
}
|
||||
|
||||
int sysbeep()
|
||||
int sysbeep(int tone)
|
||||
{
|
||||
int rc = syscall(SC_beep);
|
||||
int rc = syscall(SC_beep, tone);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ int get_process_name(char* buffer, int buffer_size);
|
|||
int set_process_name(char const* name, size_t name_length);
|
||||
void dump_backtrace(void);
|
||||
int fsync(int fd);
|
||||
int sysbeep(void);
|
||||
int sysbeep(int tone);
|
||||
int gettid(void);
|
||||
int getpagesize(void);
|
||||
pid_t fork(void);
|
||||
|
|
|
@ -132,9 +132,9 @@ namespace Core::System {
|
|||
|
||||
#ifdef AK_OS_SERENITY
|
||||
|
||||
ErrorOr<void> beep()
|
||||
ErrorOr<void> beep(Optional<size_t> tone)
|
||||
{
|
||||
auto rc = ::sysbeep();
|
||||
auto rc = ::sysbeep(tone.value_or(440));
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("beep"sv, -errno);
|
||||
return {};
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
namespace Core::System {
|
||||
|
||||
#ifdef AK_OS_SERENITY
|
||||
ErrorOr<void> beep();
|
||||
ErrorOr<void> beep(Optional<size_t> tone);
|
||||
ErrorOr<void> pledge(StringView promises, StringView execpromises = {});
|
||||
ErrorOr<void> unveil(StringView path, StringView permissions);
|
||||
ErrorOr<void> unveil_after_exec(StringView path, StringView permissions);
|
||||
|
|
|
@ -1067,7 +1067,7 @@ void TerminalWidget::beep()
|
|||
return;
|
||||
}
|
||||
if (m_bell_mode == BellMode::AudibleBeep) {
|
||||
sysbeep();
|
||||
sysbeep(440);
|
||||
return;
|
||||
}
|
||||
m_visual_beep_timer->restart(200);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue