#include <senf/Utils/Beeper.hh>
This helper class allows you to beep the pc speaker with precision like frequency and duration. The beep can be played synchronous and asynchronous.
Typically the /dev/console
device is used to control the local pc speaker. Note, that opening /dev/console
is a privileged operation on most systems.
KIOCSOUND
Definition at line 48 of file Beeper.hh.
Public Member Functions |
|
Beeper (std::string const &device="/dev/console") | |
Construct a new Beeper for the given device. |
|
~Beeper () | |
void | beep_sync (float freq, unsigned length, unsigned count=1, unsigned delay=100) |
play beep synchronous |
|
void | beep_async (float freq, unsigned length, unsigned count=1, unsigned delay=100) |
play beep asynchronous |
|
void | stop_beep () |
stop playing. |
|
bool | start_beep (float freq) |
start playing. |
senf::Beeper:: | ||||
Beeper | ( | std::string const & |
device = "/dev/console"
|
) |
void senf::Beeper:: | ||||
beep_async | ( | float | freq, | |
unsigned | length, | |||
unsigned |
count = 1 , |
|||
unsigned |
delay = 100
|
) | ||
void senf::Beeper:: | ||||
beep_sync | ( | float | freq, | |
unsigned | length, | |||
unsigned |
count = 1 , |
|||
unsigned |
delay = 100
|
) | ||
bool senf::Beeper:: | ||||
start_beep | ( | float | freq | ) |
start playing.
start playing until any other member is called.
freq | frequency in Hz, where 0 < freq < 20000. |
Definition at line 36 of file Beeper.cci.
void senf::Beeper:: | ||||
stop_beep | () | |||
stop playing.
Definition at line 41 of file Beeper.cci.