Skip to content

Persist solo state (local tracks and peers) across restarts - #291

Open
kb9gxk wants to merge 5 commits into
sonosaurus:mainfrom
kb9gxk:solo-state-persistence
Open

Persist solo state (local tracks and peers) across restarts#291
kb9gxk wants to merge 5 commits into
sonosaurus:mainfrom
kb9gxk:solo-state-persistence

Conversation

@kb9gxk

@kb9gxk kb9gxk commented Aug 12, 2026

Copy link
Copy Markdown

Summary

Currently, MUTE state persists across app restarts, but SOLO state doesn't — soloing a local input track or a remote peer is lost every time the app restarts. This makes the two controls behave inconsistently even though they're presented identically in the UI.

  • ChannelGroupParams (used by both local input channel groups and per-peer channel groups) now serializes soloed, matching the existing muted field exactly.
  • PeerStateCache gains a soloed field for the whole-peer SOLO toggle (the one that solos an entire peer and un-solos the rest), wired through commitCacheForPeer/findAndLoadCacheForPeer and its own getValueTree/setFromValueTree.
  • Two new Options toggles, Remember Local Track Solo and Remember Peer Solo (both default on), let you opt out of this per-category if you'd rather solo always reset on restart.
  • Fixed a related gap found while testing: a peer's live state (soloed, but also gain/pan/etc.) was only ever copied into the on-disk cache when a peer was explicitly disconnected — quitting the app while still connected to a peer silently dropped anything changed since the last disconnect/reconnect. commitCacheForPeer is now also called for every currently-connected peer right before state is saved.

Testing

  • Verified via a headless UI test (Xvfb + xdotool) that both new toggles round-trip correctly through an actual app restart via the real settings file.
  • Verified on a real Windows build: soloed a connected peer, quit without disconnecting, relaunched — peer comes back soloed.
  • Built clean on both Linux and Windows (MSVC) with no new warnings.

Main Monitor Solo is untouched — it was already a plugin parameter and already persisted correctly.

kb9gxk and others added 5 commits August 12, 2026 09:08
Covers both local input channel groups and per-peer channel groups,
since both reuse this struct's serialization.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- PeerStateCache gains a soloed field for whole-peer solo caching.
- Two new processor-level settings, mRememberLocalTrackSolo and
  mRememberPeerSolo (both default true), gate whether solo state is
  restored on load.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- commitCacheForPeer/findAndLoadCacheForPeer now carry RemotePeer::soloed
  through the in-memory peer cache (same-session drop/reconnect).
- PeerStateCache::getValueTree/setFromValueTree round-trip soloed
  to/from disk, matching the existing muted/gain/pan fields.
- Two new extraTree keys persist the Remember Local Track Solo /
  Remember Peer Solo settings themselves.
- On load, if a Remember-Solo setting is off, the corresponding
  soloed values are reset to false right after loading, so a
  restart doesn't restore solo state for that category. In-session
  reconnects are unaffected by this gating (untouched code path).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two new checkboxes in the Options tab, following the existing
Disable-keyboard-shortcuts toggle pattern exactly. Verified via a
headless Xvfb run: both default on, both round-trip correctly
through app restart.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Root cause of solo (and any other per-peer setting) not persisting
for a peer that's still connected when the app quits:
commitCacheForPeer was only ever called from peer-removal code
paths (removeAllRemotePeers, individual disconnect), never from
getStateInformationWithOptions itself. So a peer's live state --
soloed, gain, pan, etc. -- was only captured in mPeerStateCacheMap
if you explicitly disconnected before quitting; anything changed
since the last disconnect/reconnect was silently lost on quit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant