group.rs

crates/veilvoice-gui/src/group.rs

veilvoice-gui · 2110 lines · read the source here · or on GitHub

Group mode: several people in one recording, each with a name and a colour.

The engine has handled several speakers since veilvoice-conversation existed. This is the part of it a person can see: who is in the recording, what each of them is called, what colour each is drawn in, and which destination voice each becomes.

The toggle does not persist, and the tick that makes it persist is separate

Group mode changes what a recording is treated as. A mode that survives a restart is a mode somebody eventually forgets is on, and for this tool that means a single-speaker recording rendered against a plan that does not describe it, which silences everything the plan does not claim. So the toggle is per-run and off by default, and there is a second, explicit tick for "always start in group mode" which is the only thing written to disk.

Two controls where one would do, deliberately. They answer two different questions: is this recording a group recording and are most of my recordings group recordings.

Colour is assigned, never guessed from the voice

A speaker's colour is a function of their slot, exactly as their destination voice is, and for the same reason: anything chosen by measuring the input would make an output property a function of the input speaker, which is the linkage this whole project exists to destroy. Slot 0 and slot 1 are the furthest-apart pair in the table because two people is the common case; every slot after that is the colour whose nearest neighbour among the ones already used is furthest away. That order was computed rather than judged. See veilvoice_video::palette.

A colour can be overridden per speaker, from any colour in any of the nine palettes the website offers. An override is a person's choice about their own recording, made after the fact, and carries none of the linkage problem above.

Colour is never the only signal

The name is drawn beside every circle, in the list, and in the subtitles. Somebody who cannot separate two of these colours has the name, everywhere. A panel that distinguished speakers by colour alone would be one about eight per cent of men could not use.

In plain words

The panel for a recording with several people in it.

Each person gets a name and a colour, so you can see at a glance who is who. The colours are chosen to be as different from each other as possible, and you can pick your own from any of the palettes the website offers.

Group mode is off when the application opens unless you have said otherwise, and turning it on lasts only for that run. A mode that quietly survived a restart is a mode somebody eventually forgets is on.

WHAT THIS FILE CONTAINS

2110 lines defining 41 functions (17 public), 4 types and 0 constants. Everything below is read out of the source, so it cannot disagree with the code.

The types it owns.

  • struct Person line 71 · One person, as the panel holds them.
  • struct Outputs line 94 · What comes out of a group render.
  • struct Group line 172 · The group-mode panel's state.
  • struct Job line 1278 · Everything one render needs, taken from the panel at the moment the button was pressed.

What happens when it runs. These are the ways in: public, and nothing else in this file calls them, so they are what an outside caller reaches first.

  • Outputs::any line 124 · Whether anything at all would be written.
  • Outputs::names line 129 · The ticked ones, by name, for a project file.
  • Group::start_from line 279 · The panel as it should open, given the saved preference.
    reaches default
  • Group::len line 287 · How many people are in the recording.
  • Group::is_empty line 292 · Whether there is nobody in it.
  • Group::to_plan line 345 · Build a plan from the panel: names in slot order, no turns.
  • Group::tab line 361 · The whole panel.
    reaches body, collect_dialogs, files_and_theme, mode_controls, output_controls, people_list, profile_controls, render_controls, strip, voice_mode_controls, from_workspace, to_workspace
  • Group::drain line 1006 · Take the worker's answer if it has one.

WHAT CALLS WHAT

Person::at line 80 Outputs::default line 112 Outputs::from_names line 151 Group::default line 242 Group::start_from line 279 Group::colour line 297 Group::add line 310 Group::limit line 323 Group::remove line 331 Group::tab line 361 Group::collect_dialogs line 378 Group::body line 406 Group::profile_controls line 481 Group::apply_profile line 548 Group::mode_controls line 569 Group::voice_mode_controls line 626 Group::strip line 727 Group::people_list line 762 Group::to_workspace line 923 Group::from_workspace line 949 Group::is_busy line 1001 assigned_colour line 1499 entry: a way in: public, and nothing in this file calls it api: public, and also used inside this file 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. 22 of 40 functions are drawn; the diagram is bounded at 22 so it stays readable.

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. 22 of 40 functions are drawn; the diagram is bounded at 22 so it stays readable.

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_at["Person::at<br/>line 80"]
    n_default["Outputs::default<br/>line 112"]
    n_from_names["Outputs::from_names<br/>line 151"]
    n_default["Group::default<br/>line 242"]
    n_start_from(["Group::start_from<br/>line 279"])
    n_colour["Group::colour<br/>line 297"]
    n_add["Group::add<br/>line 310"]
    n_limit["Group::limit<br/>line 323"]
    n_remove["Group::remove<br/>line 331"]
    n_tab(["Group::tab<br/>line 361"])
    n_collect_dialogs["Group::collect_dialogs<br/>line 378"]
    n_body["Group::body<br/>line 406"]
    n_profile_controls["Group::profile_controls<br/>line 481"]
    n_apply_profile["Group::apply_profile<br/>line 548"]
    n_mode_controls["Group::mode_controls<br/>line 569"]
    n_voice_mode_controls["Group::voice_mode_controls<br/>line 626"]
    n_strip["Group::strip<br/>line 727"]
    n_people_list["Group::people_list<br/>line 762"]
    n_to_workspace["Group::to_workspace<br/>line 923"]
    n_from_workspace["Group::from_workspace<br/>line 949"]
    n_is_busy["Group::is_busy<br/>line 1001"]
    n_assigned_colour["assigned_colour<br/>line 1499"]
    n_add --> n_at
    n_body --> n_collect_dialogs
    n_body --> n_mode_controls
    n_body --> n_people_list
    n_body --> n_profile_controls
    n_body --> n_strip
    n_body --> n_voice_mode_controls
    n_collect_dialogs --> n_from_workspace
    n_collect_dialogs --> n_to_workspace
    n_colour --> n_assigned_colour
    n_from_workspace --> n_from_names
    n_people_list --> n_add
    n_people_list --> n_colour
    n_people_list --> n_limit
    n_people_list --> n_remove
    n_profile_controls --> n_apply_profile
    n_start_from --> n_default
    n_strip --> n_colour
    n_tab --> n_body
    click n_at href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L80" "open the source"
    click n_default href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L112" "open the source"
    click n_from_names href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L151" "open the source"
    click n_default href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L242" "open the source"
    click n_start_from href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L279" "open the source"
    click n_colour href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L297" "open the source"
    click n_add href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L310" "open the source"
    click n_limit href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L323" "open the source"
    click n_remove href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L331" "open the source"
    click n_tab href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L361" "open the source"
    click n_collect_dialogs href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L378" "open the source"
    click n_body href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L406" "open the source"
    click n_profile_controls href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L481" "open the source"
    click n_apply_profile href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L548" "open the source"
    click n_mode_controls href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L569" "open the source"
    click n_voice_mode_controls href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L626" "open the source"
    click n_strip href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L727" "open the source"
    click n_people_list href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L762" "open the source"
    click n_to_workspace href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L923" "open the source"
    click n_from_workspace href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L949" "open the source"
    click n_is_busy href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L1001" "open the source"
    click n_assigned_colour href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/group.rs#L1499" "open the source"
    classDef entry fill:#1f2335,stroke:#7aa2f7,color:#c0caf5
    class n_start_from,n_tab entry
    classDef api fill:#1f2335,stroke:#7dcfff,color:#c0caf5
    class n_from_names,n_colour,n_add,n_limit,n_remove,n_to_workspace,n_from_workspace,n_is_busy,n_assigned_colour api
    classDef helper fill:#1f2335,stroke:#bb9af7,color:#c0caf5
    class n_at,n_default,n_default,n_collect_dialogs,n_body,n_profile_controls,n_apply_profile,n_mode_controls,n_voice_mode_controls,n_strip,n_people_list 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
Person pub struct71One person, as the panel holds them.
Person::at fn80A person with the default name for their slot.
Outputs pub struct94What comes out of a group render.
Outputs::default fn112
Outputs::any pub fn124Whether anything at all would be written.
Outputs::names pub fn129The ticked ones, by name, for a project file.
Outputs::from_names pub fn151Read back from a project file.
hex_of fn162An egui colour as #rrggbb.
colour_of fn167#rrggbb as an egui colour, or None for anything that is not one.
Group pub struct172The group-mode panel's state.
Group::default fn242
Group::start_from pub fn279The panel as it should open, given the saved preference.
Group::len pub fn287How many people are in the recording.
Group::is_empty pub fn292Whether there is nobody in it.
Group::colour pub fn297The colour a slot is drawn in: the override, or the one it is given.
Group::add pub fn310Add a person, if there is room for one.
Group::limit pub fn323How many people this panel can hold in its current mode.
Group::remove pub fn331Remove one person, keeping at least two.
Group::to_plan pub fn345Build a plan from the panel: names in slot order, no turns.
Group::tab pub fn361The whole panel.
Group::collect_dialogs fn378Collect whatever the open pickers have answered.
Group::body fn406Everything inside the scroller.
Group::profile_controls fn481The named ways of working, and the project this panel came from.
Group::apply_profile fn548Set the controls this profile names, and change nothing else.
Group::mode_controls fn569The two controls that decide whether group mode is on.
Group::voice_mode_controls fn626A voice each, or one voice between everybody.
Group::strip fn727The picture: a circle per person, in their colour, with their name.
Group::people_list fn762One row per person: colour, name, and a way to remove them.
Group::palette_picker fn834Every colour in every palette, as swatches.
Group::swatch fn873One clickable colour.
Group::output_controls fn896What a render writes.
Group::to_workspace pub fn923This panel as a saveable project.
Group::from_workspace pub fn949Put a saved project back.
Group::is_busy pub fn1001Whether a render is running, so the window keeps repainting.
Group::drain pub fn1006Take the worker's answer if it has one.
Group::files_and_theme fn1028The recording, the plan, the title and the palette.
Group::render_controls fn1118The button, and what came of pressing it.
Group::start fn1224Start a render on a thread of its own.
file_name fn1266The last component of a path, for showing beside a button.
Job struct1278Everything one render needs, taken from the panel at the moment the button was pressed.
render_now fn1298Do the render.
render_video fn1418Roadmap item 139.
write_private fn1482Replace the last extension, keeping any .veiled before it.
with_extension fn1487
assigned_colour pub fn1499The colour a slot is given, as an egui colour.