[PR #219] [MERGED] Replace Browser widget "Audio and video only" toggle with Mode picker #222

Closed
opened 2026-03-02 04:00:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/eerimoq/moblin/pull/219
Author: @Copilot
Created: 2/8/2026
Status: Merged
Merged: 2/8/2026
Merged by: @eerimoq

Base: mainHead: copilot/replace-audio-video-toggle


📝 Commits (3)

  • aa693a7 Initial plan
  • 572a2d7 Replace Browser widget "Audio and video only" toggle with "Mode" picker
  • 0c31660 Remove String raw value from SettingsWidgetBrowserMode enum

📊 Changes

4 files changed (+36 additions, -12 deletions)

View changed files

📝 Moblin/RemoteControl/RemoteControl.swift (+3 -3)
📝 Moblin/Various/Settings/SettingsScene.swift (+23 -3)
📝 Moblin/VideoEffects/Browser/BrowserEffect.swift (+1 -1)
📝 Moblin/View/Settings/Scenes/Widgets/Widget/Browser/WidgetBrowserSettingsView.swift (+9 -5)

📄 Description

Replaces the boolean toggle with an enum-based Mode picker offering "Periodic, audio and video" and "Audio and video only" options.

Changes

  • New SettingsWidgetBrowserMode enumCodable, CaseIterable with cases periodicAudioAndVideo and audioAndVideoOnly
  • SettingsWidgetBrowseraudioAndVideoOnly: Boolmode: SettingsWidgetBrowserMode, encodes under new mode key
  • Settings migration — Decoder tries mode key first, falls back to legacy audioOnly bool:
    if let decodedMode = try? container.decode(SettingsWidgetBrowserMode.self, forKey: .mode) {
        mode = decodedMode
    } else {
        let audioOnly = container.decode(.audioOnly, Bool.self, false)
        mode = audioOnly ? .audioAndVideoOnly : .periodicAudioAndVideo
    }
    
  • UI — Toggle replaced with Picker("Mode", ...) over SettingsWidgetBrowserMode.allCases; Base FPS slider shown only for .periodicAudioAndVideo
  • BrowserEffect — Derives internal bool via widget.mode == .audioAndVideoOnly
  • RemoteControlaudioAndVideoOnly: Boolmode: SettingsWidgetBrowserMode

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/eerimoq/moblin/pull/219 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 2/8/2026 **Status:** ✅ Merged **Merged:** 2/8/2026 **Merged by:** [@eerimoq](https://github.com/eerimoq) **Base:** `main` ← **Head:** `copilot/replace-audio-video-toggle` --- ### 📝 Commits (3) - [`aa693a7`](https://github.com/eerimoq/moblin/commit/aa693a79f400bdf13489ad5d3193142965ac76c2) Initial plan - [`572a2d7`](https://github.com/eerimoq/moblin/commit/572a2d7e1814139698d1be982a4edad48c7f62c6) Replace Browser widget "Audio and video only" toggle with "Mode" picker - [`0c31660`](https://github.com/eerimoq/moblin/commit/0c3166096ba04db1d3532d5067aea633aed7dd98) Remove String raw value from SettingsWidgetBrowserMode enum ### 📊 Changes **4 files changed** (+36 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `Moblin/RemoteControl/RemoteControl.swift` (+3 -3) 📝 `Moblin/Various/Settings/SettingsScene.swift` (+23 -3) 📝 `Moblin/VideoEffects/Browser/BrowserEffect.swift` (+1 -1) 📝 `Moblin/View/Settings/Scenes/Widgets/Widget/Browser/WidgetBrowserSettingsView.swift` (+9 -5) </details> ### 📄 Description Replaces the boolean toggle with an enum-based `Mode` picker offering "Periodic, audio and video" and "Audio and video only" options. ### Changes - **New `SettingsWidgetBrowserMode` enum** — `Codable, CaseIterable` with cases `periodicAudioAndVideo` and `audioAndVideoOnly` - **`SettingsWidgetBrowser`** — `audioAndVideoOnly: Bool` → `mode: SettingsWidgetBrowserMode`, encodes under new `mode` key - **Settings migration** — Decoder tries `mode` key first, falls back to legacy `audioOnly` bool: ```swift if let decodedMode = try? container.decode(SettingsWidgetBrowserMode.self, forKey: .mode) { mode = decodedMode } else { let audioOnly = container.decode(.audioOnly, Bool.self, false) mode = audioOnly ? .audioAndVideoOnly : .periodicAudioAndVideo } ``` - **UI** — Toggle replaced with `Picker("Mode", ...)` over `SettingsWidgetBrowserMode.allCases`; Base FPS slider shown only for `.periodicAudioAndVideo` - **`BrowserEffect`** — Derives internal bool via `widget.mode == .audioAndVideoOnly` - **`RemoteControl`** — `audioAndVideoOnly: Bool` → `mode: SettingsWidgetBrowserMode` <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem closed this issue 2026-03-02 04:00:48 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/moblin#222
No description provided.