xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
beep.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
console.hpp
"
6
#include "
object.hpp
"
7
9
namespace
xtd
{
21
class
beep
final :
public
object
{
22
public
:
24
31
beep
() =
default
;
32
39
beep
(
uint32
frequency,
uint32
duration) : frequency_(frequency), duration_(duration) {}
41
43
friend
auto
operator <<(std::ostream& os,
const
beep
&
b
) -> std::ostream& {
44
if
(!
console::is_output_redirected
() && os.rdbuf() ==
console::out
.rdbuf())
45
console::beep
(
b
.frequency_,
b
.duration_);
46
return
os;
47
}
49
50
private
:
51
uint32
frequency_ {800};
52
uint32
duration_ {200};
53
};
54
}
xtd::beep
Represent beep output manipulator class.
Definition
beep.hpp:21
xtd::beep::beep
beep()=default
Plays the sound of a beep through the console speaker.
xtd::beep::beep
beep(uint32 frequency, uint32 duration)
Plays the sound of a beep of a specified frequency and duration through the console speaker.
Definition
beep.hpp:39
xtd::console::out
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition
console.hpp:52
xtd::console::is_output_redirected
static auto is_output_redirected() -> bool
Gets a value that indicates whether the output stream has been redirected from the standard output st...
xtd::console::beep
static auto beep() -> void
Plays the sound of a beep through the console speaker.
xtd::object::object
object()=default
Create a new instance of the ultimate base class object.
console.hpp
Contains xtd::console class.
xtd::uint32
std::uint32_t uint32
Represents a 32-bit unsigned integer.
Definition
uint32.hpp:23
xtd::console_key::b
@ b
The B key.
Definition
console_key.hpp:90
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
object.hpp
Contains xtd::object class.
Generated on
for xtd by
Gammasoft
. All rights reserved.