Split the Stream Studio: logic into voelin-ui-vm, the windows and the engine in bind.rs

studio.rs (62 Bridge writes) is split like the settings pages. What the
studio decides lives in voelin_ui_vm::studio::logic:

- StudioData, the state apart from the running parts (settings, scenes,
  status, statistics, destination, stream, pickers, overlays), with the
  bitrate and layers a stream starts with, the hidden-tick counter, the
  preview size, the destination choice, the stream settings form and the
  header/bottom-bar status (status_view, with the front end's side passed
  in as a StatusContext), the overlays the switches ask for;
- where the stream goes (destinations, their names and rows, the channel
  tab of the stream chat), the stream settings panel's edits, the output,
  the layer, source, picker and mixer controls (source_action,
  source_change, camera/screen/audio pickers, main_source_changes), the
  studio settings dialog, event and ending texts;
- the studio's own settings type and key (StudioUi, STUDIO_UI), the demo
  studio's sample scenes, viewers, stream and chat message.

voelin-ui keeps studio/mod.rs (StudioState: the models, the running
studio, the windows, the mixer handles, plus StudioData) and studio/bind.rs
(the engine tasks, the preview, the encoder, the two windows' StudioBridge
writes, the camera and screen listing, the chat and stream commands). The
demo settings return their problems instead of logging them. SessionView
and Tab methods that need no Default list type no longer ask for one.
28 new tests cover the logic.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-20 16:01:12 +03:00
1 parent 03f4a92161
commit ce0e6e1f62
7 files changed
+3421 -2275

No files matched your search

+12 -8
View File
@@ -192,7 +192,9 @@ impl<L: Default> Tab<L> {
cache: Default::default(),
}
}
}
impl<L> Tab<L> {
/// A private chat (on the Direct Messages page, not in the chat strip).
pub fn is_private(&self) -> bool {
matches!(self.target, ChatTarget::Private(_))
@@ -356,7 +358,7 @@ impl<L: Default> Default for SessionView<L> {
}
}
impl<L: Default> SessionView<L> {
impl<L> SessionView<L> {
/// Streams can be watched and shared: TeamSpeak 6, connected with voice.
pub fn streams_available(&self) -> bool {
self.capabilities.streams && self.state.voice == VoiceState::Connected
@@ -441,13 +443,6 @@ impl<L: Default> SessionView<L> {
true
}
/// A new tab for `target`, read as far as the store says.
pub fn new_tab(&self, target: ChatTarget, title: String) -> Tab<L> {
let mut tab = Tab::new(target, title);
tab.read_from(&self.reads);
tab
}
/// The session's gateway offers this feature
/// (`voelin_gateway_proto::feature`).
pub fn gateway_has(&self, feature: &str) -> bool {
@@ -482,6 +477,15 @@ impl<L: Default> SessionView<L> {
}
}
impl<L: Default> SessionView<L> {
/// A new tab for `target`, read as far as the store says.
pub fn new_tab(&self, target: ChatTarget, title: String) -> Tab<L> {
let mut tab = Tab::new(target, title);
tab.read_from(&self.reads);
tab
}
}
/// The data the screens share, apart from the engine and the toolkit: the
/// servers and what is known of their sessions, the settings the screens
/// show and the dialogs' targets.
File diff suppressed because it is too large. Load diff
@@ -1,6 +1,9 @@
//! The Stream Studio's view models: scene, source, mixer and layer rows,
//! the header's numbers, the source dialog's form, where new sources go and
//! the overlay sources the stream settings' switches keep in the scenes.
//! Decisions of the studio (what it does when) are in [`logic`].
pub mod logic;
use std::time::Duration;