MCPcopy Index your code
hub / github.com/endbasic/endbasic / new

Method new

std/src/sound/cmds.rs:45–60  ·  view source on GitHub ↗

Creates a new `BEEP` command that reproduces a canned tone on the `console`.

(console: Rc<RefCell<dyn Console>>)

Source from the content-addressed store, hash-verified

43impl BeepCommand {
44 /// Creates a new `BEEP` command that reproduces a canned tone on the `console`.
45 pub fn new(console: Rc<RefCell<dyn Console>>) -> Rc<Self> {
46 Rc::from(Self {
47 metadata: CallableMetadataBuilder::new("BEEP")
48 .with_async(true)
49 .with_syntax(&[(&[], None)])
50 .with_category(CATEGORY)
51 .with_description(
52 "Reproduces a short audible tone.
53This command plays a square-wave tone at 800 hertz for 0.25 seconds in consoles that \
54support sound. Otherwise, this falls back to a BEL control code that should match this \
55pitch and duration, but it may not.",
56 )
57 .build(),
58 console,
59 })
60 }
61}
62
63#[async_trait(?Send)]

Callers

nothing calls this directly

Calls 5

with_descriptionMethod · 0.80
with_categoryMethod · 0.80
with_syntaxMethod · 0.80
with_asyncMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected