//! The Stream Studio's structs: the plain counterparts of //! `crates/voelin-ui/ui/studio-bridge.slint`, as [`crate::bridge`] has those of //! `bridge.slint`. use std::sync::Arc; use crate::image::ImageRef; /// A scene of the studio. #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioScene { pub id: i32, pub name: Arc, /// Its sources, front first: "Screen + Camera + Text". pub detail: Arc, /// Composited now (the live scene). pub live: bool, /// The kind of its front-most source (for the icon). pub kind: Arc, } /// A source of the live scene, front first. #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioSource { pub id: i32, pub name: Arc, /// screen, window, portal, camera, image, text, colour, pattern pub kind: Arc, pub visible: bool, pub locked: bool, /// keep, blur, image, colour pub background: Arc, /// Why it shows nothing ("" while it works). pub error: Arc, /// "1920×1080 · 60 fps" pub info: Arc, /// At the front or the back (cannot move further). pub front: bool, pub back: bool, } /// An audio source of the stream (`stream.audio_sources`). #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioAudio { pub name: Arc, /// "Elgato Wave:3", the application... pub detail: Arc, /// microphone, desktop, app, window, tone pub kind: Arc, pub gain_db: f32, pub muted: bool, /// The meter in dBFS, after the gain. pub level: f32, /// Why it captures nothing. pub error: Arc, } /// A simulcast layer (`stream.layers`) as typed: any numbers. #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioLayer { /// "1280x720"; empty: `scale` of the output. pub size: Arc, pub scale: Arc, /// Frame-rate cap; empty: the output's. pub fps: Arc, /// kbit/s. pub bitrate: Arc, /// kbit/s a viewer needs for this layer. pub min_bitrate: Arc, } /// A viewer of the studio's stream. #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioViewer { pub client: i32, pub name: Arc, /// requested, connecting, connected pub state: Arc, } /// An entry of a picker (screens, windows, cameras, audio sources). #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioPick { pub name: Arc, pub detail: Arc, /// For the icon: monitor, window, portal, camera, microphone, desktop, app, tone pub kind: Arc, /// The application's own icon (audio), if it has one. pub icon: ImageRef, /// Already mixed in (audio): picking it again takes it out. pub selected: bool, } /// The header, the preview's badges and the bottom bar. #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioStatus { /// The engine runs (preview, mixer, replay buffer). pub running: bool, /// "Chill Zone • Starfall Community"; empty without a destination. pub destination: Arc, /// 0: not live, 1: poor, 2: fair, 3: good, 4: excellent. pub quality: i32, pub quality_text: Arc, /// "1080p • 60 FPS • 8,250 kbps" pub format: Arc, /// The numbers behind it, for the info button. pub details: Arc, pub live: bool, /// Going live: waiting for the server. pub starting: bool, /// "00:12:34" pub elapsed: Arc, pub viewers: i32, pub participants: i32, pub can_go_live: bool, /// Why Go Live is off, or what goes wrong. pub hint: Arc, pub recording: bool, pub recorded: Arc, /// The replay buffer's window (0: off) and what it holds now. pub replay_seconds: i32, pub replay_held: Arc, pub output_width: i32, pub output_height: i32, pub fps: i32, pub detached: bool, /// A window of its own is possible (not on Android). pub can_detach: bool, /// The live scene shows a screen, a camera, a window (the phone's cards). pub screen_shown: bool, pub camera_shown: bool, pub window_shown: bool, } /// The stream settings panel (`studio.stream`, `stream.bitrate_kbps`). #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioForm { pub destination: i32, pub title: Arc, pub game: Arc, pub message: Arc, pub show_viewers: bool, pub show_chat: bool, pub show_now_playing: bool, pub audio: bool, /// kbit/s of the stream without layers, as typed. pub bitrate: Arc, } /// The source properties dialog (also for adding text, colour and image /// sources: `id` -1). Numbers as typed. #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioSourceForm { pub id: i32, pub name: Arc, pub kind: Arc, pub x: Arc, pub y: Arc, /// Empty: the source's own size times `scale`. pub width: Arc, pub height: Arc, pub scale: Arc, /// contain, cover, stretch pub fit: Arc, pub crop_left: Arc, pub crop_top: Arc, pub crop_right: Arc, pub crop_bottom: Arc, /// Percent. pub opacity: f32, pub locked: bool, pub visible: bool, /// keep, blur, image, colour pub background: Arc, /// Blur radius in percent of the picture's height. pub blur: Arc, pub background_path: Arc, pub background_colour: Arc, /// Text, colour ("#rrggbb" or "#rrggbbaa") and image sources. pub text: Arc, pub text_size: Arc, pub colour: Arc, pub path: Arc, pub mirror: bool, } /// The studio settings dialog (`studio.*` keys and the preview). #[derive(Clone, Debug, Default, PartialEq)] pub struct StudioSettingsForm { pub replay_seconds: Arc, pub replay_memory: Arc, pub recording_dir: Arc, pub preview_width: Arc, pub preview_fps: Arc, }