absent.rs

crates/veilvoice-audio/src/absent.rs

veilvoice-audio · 372 lines · read the source here · or on GitHub

The live modules, in a build that has no live capture.

Roadmap item 162. cpal has no backend for FreeBSD, OpenBSD or NetBSD, so the live feature is off there. The command line has always coped by leaving its live commands out. The window cannot do that as neatly: the Studio and the Browser are written against sessions, recorders and players, and leaving each use out would mean a cfg on every line of the tab that uses them, which is where a build that only one platform exercises goes to rot.

So the same names exist here, with the same signatures, and none of them can do anything. One is missing on purpose: record::start makes a recorder, which this build cannot hold, and only a live session calls it. The crate's tests compare this file with the live modules, so a name added to one and not the other fails in the build CI tests. Every constructor refuses with REASON, which a front end shows where the button was pressed. Every type that stands for a running thing (a session, a room, a recorder, a player, an opened device) holds a std::convert::Infallible, so no value of it can ever exist and its methods are proofs that they are never called rather than code that pretends to measure something.

The data the live path reports is not here: it is in crate::kinds and is the same type in both builds.

What this is not

It is not a fake microphone. Nothing here produces a sample, a level or a device name, because a meter that moved on a platform that cannot hear anything would be a lie about the one thing this program is for.

In plain words

On a system where VeilVoice cannot use a microphone, the parts that would use one are still there, and every one of them says that this system cannot capture sound when it is asked to start.

WHAT THIS FILE CONTAINS

372 lines defining 1 function (0 public), 0 types and 1 constant. Everything below is read out of the source, so it cannot disagree with the code.

WHAT CALLS WHAT

refused line 49 helper: private to this file dashed: a call that goes back up, or across a wrapped rank The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one.

The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one.

The same graph as Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#1a1b26","primaryColor":"#1f2335","primaryTextColor":"#c0caf5","primaryBorderColor":"#7aa2f7","secondaryColor":"#16161e","tertiaryColor":"#16161e","lineColor":"#737aa2","textColor":"#c0caf5","mainBkg":"#1f2335","nodeBorder":"#7aa2f7","clusterBkg":"#16161e","clusterBorder":"#2f3549","fontFamily":"ui-monospace, SFMono-Regular, Consolas, monospace","fontSize":"14px"}}}%%
flowchart TD
    n_refused["refused<br/>line 49"]
    click n_refused href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-audio/src/absent.rs#L49" "open the source"
    classDef helper fill:#1f2335,stroke:#bb9af7,color:#c0caf5
    class n_refused helper
    subgraph chart_key ["Key"]
        direction LR
        key_helper["helper: private to this file"]
    end
    class key_helper helper

This site loads no third-party script, so it cannot run Mermaid; the diagram above is the same nodes and edges drawn by the generator instead. GitHub renders the source below directly.

ITEMS

ItemLineDocumentation
REASON pub const43Why nothing live can start in this build, in the words a person reads.
refused fn49The one answer every constructor here gives.
devices pub mod54Devices, of which this build can see none.
record pub mod85Recorders, which only a live session can create.
playback pub mod143Playback, which needs an output device this build cannot open.
live pub mod176The single-microphone session, which cannot start in this build.
call pub mod229A call, which cannot be recorded in this build.
room pub mod284Several microphones at once, which cannot start in this build.