aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/obs/ObsScenesModule.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/obs/ObsScenesModule.qml')
-rw-r--r--desktop/modules/obs/ObsScenesModule.qml59
1 files changed, 59 insertions, 0 deletions
diff --git a/desktop/modules/obs/ObsScenesModule.qml b/desktop/modules/obs/ObsScenesModule.qml
new file mode 100644
index 0000000..a91149e
--- /dev/null
+++ b/desktop/modules/obs/ObsScenesModule.qml
@@ -0,0 +1,59 @@
+// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+import QtQuick
+import "../.."
+import "../../island"
+
+// Which glyph each OBS scene shows in the island pill, from the same watched
+// map the pill reads. Set once per scene: paste an icon from the Nerd Fonts
+// cheat sheet. OBS is not required to edit the configured rows.
+Module {
+ id: mod
+ name: "obs"
+ label: "OBS scenes"
+ // nf-md-record_circle, present in Inconsolata Nerd Font.
+ icon: "\udb83\udec2"
+ settings: true
+ group: "Desktop"
+ dirty: SceneIcons.dirty
+ keywords: ["obs", "scene", "icon", "glyph", "recording", "webcam", "stream"]
+
+ // The saved keys plus whatever OBS currently reports, so a scene created
+ // in OBS appears without a restart and a configured scene survives OBS
+ // being closed.
+ function names() {
+ const out = [];
+ for (const n in SceneIcons.map.scenes) out.push(n);
+ for (const n of Obs.scenes) if (out.indexOf(n) < 0) out.push(n);
+ return out;
+ }
+
+ function refresh() {
+ if (!SceneIcons.dirty) SceneIcons.begin();
+ mod.searchItems = mod.names().map(n => ({ text: n, key: n }));
+ }
+
+ page: Component {
+ Page {
+ title: "OBS scenes"
+ actions: Component {
+ SaveBar {
+ dirty: SceneIcons.dirty
+ valid: SceneIcons.valid
+ onSave: SceneIcons.save(SceneIcons.draft)
+ onDiscard: SceneIcons.discard()
+ }
+ }
+ ObsScenesPage { width: parent.width }
+ }
+ }
+}