Expand description
System tray / menu bar icon: playback controls, dynamic title + tooltip, popup menu, and (non-Linux) a WebView popover styled like macOS Now Playing (no artwork).
StructsΒ§
- Tray
NowPlaying Payload - Tray
Popover Emit - Serialized to the
tray-popoverWebView for frosted Now Playing UI. - Tray
State - Per-tray state: icon + cached i18n for rebuilding the popup without hitting SQLite each tick.
- Tray
State Inner
ConstantsΒ§
- TRAY_
MENU_ πNOW_ PLAYING_ MAX - Max characters for the first row of the tray dropdown (macOS truncates visually; keep readable).
- TRAY_
POLL_ πMS - Host-side poll interval β 500 ms matches the popover UIβs expected cadence and is cheap since the audio-engine stdin/stdout JSON request is just a few bytes.
- TRAY_
POPOVER_ πH - Default height until JS measures
#shell(tray_popover_resize); generous so first paint is not clipped (multi-line title + meta + directory path + progress + volume + speed + transport + padding). - TRAY_
POPOVER_ πW
StaticsΒ§
- TRAY_
POLL_ πACTIVE
FunctionsΒ§
- build_
tray_ πpopup_ menu - create_
tray - emit_
tray_ πpopover_ state - Set
AUDIO_HAXOR_TRAY_DEBUG=1in the environment to print every successfultray-popover-state/tray-popover-ui-themeemit to stderr (state includes the ~500 ms host poll). Emit failures always log. - emit_
tray_ popover_ ui_ theme - Light/dark from prefs (
prefs_setkeytheme). Same debug env / failure logging asemit_tray_popover_state. - fmt_
tray_ πtime - normalized_
popover_ πreveal_ path - popover_
xy_ πbelow_ tray scale_factormaps logical popover width to physical pixels whenrectuses physical coordinates (common on macOS tray events).- refresh_
tray_ popup_ menu - Rebuild tray popup labels from
app_i18n(after UI locale change). Preserves last now-playing line. - show_
main_ window - Bring the main window forward (tray popover context menu β same intent as the native tray βShowβ item).
- start_
tray_ host_ poll - Background thread that polls
audio-engineplayback_statusand pushes fresh elapsed / total / paused state to the tray icon and the tray-popover WebView, regardless of JS timer throttling. The JS side (update_tray_now_playinginaudio.js) still owns the title and subtitle β those come from DOM state that Rust cannot see β but this thread keeps the elapsed / total / playing fields live when the main window is unfocused (on macOS the rAF loop andsetIntervalboth pause behindisUiIdleHeavyCpu, leaving the tray frozen). - t π
- toggle_
tray_ πpopover - tray_
emit_ πui_ theme - tray_
menu_ πbar_ icon - Prefer the bundle window icon; otherwise embed
32x32.pngso dev/release always have pixels. - tray_
playback_ πspeed_ merge - tray_
popover_ action - tray_
popover_ get_ state - tray_
popover_ get_ ui_ theme - tray_
popover_ hide - Hide the tray popover. Invoked from the main window (Escape keybind in
ipc.js) so the user can dismiss the popover from any focused window βtray-popover.jsβs owndocument.keydownEscape listener only fires when the popover webview itself has keyboard focus, which doesnβt happen if the popover was shown withfocus: falseand the user never clicked into it. - tray_
popover_ resize - Fit the
tray-popoverWebView to content (title lines, meta, fonts). Called fromtray-popover.js. Width/height are CSS / logical pixels (same units asgetBoundingClientRect);PhysicalSizewould undersize on HiDPI and clip the HUD. - tray_
popover_ πui_ theme_ from_ prefs - Prefs key
themeβ popoverdata-theme(lightvsdarkHUD). - tray_
volume_ πpct_ merge - truncate_
tray_ πmenu_ line - truncate_
tray_ πtitle - update_
tray_ now_ playing - Tauri v2 IPC: call
invoke('update_tray_now_playing', { payload: β¦ })β the outer key must bepayload(matches this parameter name); a flat object fails deserialization.