aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/Obs.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/Obs.qml')
-rw-r--r--desktop/island/Obs.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/desktop/island/Obs.qml b/desktop/island/Obs.qml
index 9b8ba06..593e978 100644
--- a/desktop/island/Obs.qml
+++ b/desktop/island/Obs.qml
@@ -34,6 +34,9 @@ Singleton {
property real duration: 0
property var scenes: []
property string scene: ""
+ // The current scene's items as { name, kind }, for the window-source
+ // properties button. Kept current with the same GetSceneItemList call.
+ property var sources: []
// The webcam: the first v4l2_input item in the current scene, -1 for none.
// ponytail: a webcam inside a group or nested scene is not found; walk
// GetGroupSceneItemList if one ever is.
@@ -58,6 +61,10 @@ Singleton {
if (desktopAudio)
request("SetInputMute", { inputName: desktopAudio, inputMuted: !desktopMuted });
}
+ // Opens OBS's source dialog, which is where the Wayland portal picker runs.
+ function openSource(name) {
+ if (name) request("OpenInputPropertiesDialog", { inputName: name });
+ }
// The corner math assumes the webcam item is top-left aligned (alignment 5).
function moveCam(corner) {
if (camId < 0 || baseWidth <= 0 || camW <= 0 || camH <= 0) return;
@@ -109,6 +116,7 @@ Singleton {
recording = false; paused = false; duration = 0;
stateFromEvents = false;
scenes = []; scene = ""; camId = -1; camOn = false;
+ sources = [];
camW = 0; camH = 0;
desktopAudio = ""; desktopMuted = false;
baseWidth = 0; baseHeight = 0;
@@ -238,6 +246,7 @@ Singleton {
request("GetSceneItemList", { sceneName: scene });
break;
case "GetSceneItemList": {
+ sources = r.sceneItems.map(i => ({ name: i.sourceName, kind: i.inputKind }));
const it = r.sceneItems.find(i => i.inputKind === "v4l2_input");
camId = it ? it.sceneItemId : -1;
camOn = !!it && it.sceneItemEnabled;