Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

feat(ui): the five dialogs, wired to what the engine actually carries

Veyra Goal Agent3197ca93c807
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index 497d414c..49aa5e42 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -89,6 +89,30 @@ class QmlPlayerBridge : public QObject {
// list here could drift from what the package actually contains.
Q_PROPERTY(QVariantList componentList READ componentList NOTIFY snapshotChanged)
+ // --- capture dialog ----------------------------------------------------
+ // Device and format lists come from the source's own enumeration, so the UI
+ // can only offer what the machine actually reports.
+ Q_PROPERTY(QVariantList captureDevices READ captureDevices NOTIFY captureChanged)
+ Q_PROPERTY(QString captureDeviceId READ captureDeviceId WRITE setCaptureDeviceId NOTIFY captureChanged)
+ Q_PROPERTY(QString captureDeviceLabel READ captureDeviceLabel NOTIFY captureChanged)
+ Q_PROPERTY(bool captureForceSdr READ captureForceSdr WRITE setCaptureForceSdr NOTIFY settingsChanged)
+ Q_PROPERTY(bool captureFlipVertical READ captureFlipVertical WRITE setCaptureFlipVertical NOTIFY settingsChanged)
+
+ // --- screen-capture dialog ---------------------------------------------
+ Q_PROPERTY(QVariantList screenTargets READ screenTargets NOTIFY captureChanged)
+ Q_PROPERTY(QString screenTargetId READ screenTargetId WRITE setScreenTargetId NOTIFY captureChanged)
+ Q_PROPERTY(QString screenTargetLabel READ screenTargetLabel NOTIFY captureChanged)
+ Q_INVOKABLE void refreshCaptureTargets();
+
+ // Subtitles: SubtitleStyle is owned by the old Win32 shell, not by the engine,
+ // so there is nothing here for the bridge to read or write. The subtitle dialog
+ // says it is not wired rather than keeping a second copy of that state that
+ // would silently disagree with the renderer.
+
+ // --- ps5 dialog --------------------------------------------------------
+ Q_PROPERTY(QString remotePlayHost READ remotePlayHost WRITE setRemotePlayHost NOTIFY settingsChanged)
+ Q_PROPERTY(QString remotePlayPin READ remotePlayPin WRITE setRemotePlayPin NOTIFY settingsChanged)
+
Q_PROPERTY(QString appName READ appName CONSTANT)
Q_PROPERTY(QString version READ version CONSTANT)
@@ -255,6 +279,25 @@ public:
void setCurrentPage(const QString& value);
QString remotePlayState() const;
QVariantList componentList() const;
+ QVariantList captureDevices() const;
+ QString captureDeviceId() const;
+ void setCaptureDeviceId(const QString& value);
+ QString captureDeviceLabel() const;
+ bool captureForceSdr() const;
+ void setCaptureForceSdr(bool value);
+ bool captureFlipVertical() const;
+ void setCaptureFlipVertical(bool value);
+
+ QVariantList screenTargets() const;
+ QString screenTargetId() const;
+ void setScreenTargetId(const QString& value);
+ QString screenTargetLabel() const;
+
+ QString remotePlayHost() const;
+ void setRemotePlayHost(const QString& value);
+ QString remotePlayPin() const;
+ void setRemotePlayPin(const QString& value);
+
QString appName() const;
QString version() const;
@@ -447,6 +490,8 @@ signals:
void recentFilesChanged();
void presetsChanged();
void exportChanged();
+ // Emitted when the capture device or screen-target lists are re-enumerated.
+ void captureChanged();
// User-facing notices the UI shows as a transient message: a rejected
// chain edit, an export that finished, a failed open.
void notice(const QString& text, bool isError);
diff --git a/qml/Veyra/DialogHost.qml b/qml/Veyra/DialogHost.qml
new file mode 100644
index 00000000..82f8364b
--- /dev/null
+++ b/qml/Veyra/DialogHost.qml
@@ -0,0 +1,469 @@
+// The five dialogs, rebuilt from the design's dialogs.js.
+//
+// Each mirrors the design's structure: a header with a colour-plated icon and a
+// subtitle, a scrolling body of sections (a heading with a hairline, then a group
+// of label/control rows), and a footer with the actions.
+//
+// Scope: the dialog edits only what the engine actually carries. Device and screen
+// target lists come from the source's own enumeration; force-SDR and flip are real
+// settings. The format list, audio monitoring, bitstream passthrough, subtitle
+// style and remote-play detail are not wired to anything yet, and each says so on
+// the page instead of being drawn as a control that would do nothing.
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Item {
+ id: host
+ anchors.fill: parent
+ z: 100
+
+ // Which dialog is showing: "" | capture | ps5 | screen | subtitle | audio
+ property string dialog: ""
+
+ function open(key) { host.dialog = key }
+ function close() { host.dialog = "" }
+
+ signal startCapture()
+ signal startPs5()
+ signal startScreen()
+
+ // Scrim: the design dims the page behind the dialog.
+ Rectangle {
+ anchors.fill: parent
+ color: Qt.rgba(0, 0, 0, 0.55)
+ visible: host.dialog !== ""
+ TapHandler { onTapped: host.close() }
+ }
+
+ // --- shared chrome ----------------------------------------------------
+ component DLayer: Rectangle {
+ id: dlg
+ property string title: ""
+ property string sub: ""
+ property string glyph: ""
+ property int dialogWidth: 640
+ property var actions: []
+ default property alias body: bodyCol.data
+ signal actionTriggered(string label)
+
+ anchors.centerIn: parent
+ width: dialogWidth
+ implicitHeight: Math.min(720, header.height + bodyScroll.contentHeight + footer.height + 40)
+ height: implicitHeight
+ radius: 16
+ color: Theme.dialog
+ border.width: 1
+ border.color: Theme.stroke2
+ visible: host.dialog !== ""
+ scale: visible ? 1.0 : 0.9
+ Behavior on scale { NumberAnimation { duration: 550; easing.bezierCurve: Theme.spring } }
+
+ ColumnLayout {
+ anchors.fill: parent
+ spacing: 0
+
+ RowLayout {
+ id: header
+ Layout.fillWidth: true
+ Layout.margins: 16
+ spacing: 12
+ Rectangle {
+ implicitWidth: 34; implicitHeight: 34; radius: 10
+ color: Qt.rgba(1, 1, 1, 0.06)
+ Text { anchors.centerIn: parent; text: dlg.glyph; font.pixelSize: 16 }
+ }
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 2
+ Text {
+ text: dlg.title
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsH2
+ font.weight: Font.DemiBold
+ }
+ Text {
+ Layout.fillWidth: true
+ visible: dlg.sub.length > 0
+ text: dlg.sub
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 12
+ wrapMode: Text.WordWrap
+ }
+ }
+ VButton { icon: true; glyph: "✕"; ghost: true; onClicked: host.close() }
+ }
+
+ Flickable {
+ id: bodyScroll
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.leftMargin: 20
+ Layout.rightMargin: 20
+ contentHeight: bodyCol.implicitHeight
+ clip: true
+ ScrollBar.vertical: ScrollBar { }
+ ColumnLayout {
+ id: bodyCol
+ width: parent.width
+ spacing: 0
+ }
+ }
+
+ RowLayout {
+ id: footer
+ Layout.fillWidth: true
+ Layout.margins: 16
+ spacing: 8
+ Item { Layout.fillWidth: true }
+ Repeater {
+ model: dlg.actions
+ delegate: VButton {
+ required property var modelData
+ text: modelData.label
+ primary: modelData.primary === true
+ onClicked: dlg.actionTriggered(modelData.label)
+ }
+ }
+ }
+ }
+ }
+
+ // --- 采集卡 -----------------------------------------------------------
+ DLayer {
+ visible: host.dialog === "capture"
+ glyph: "🎬"
+ title: "采集卡"
+ sub: "连接设备后,先关闭增强确认基础画面,再按需开启"
+ dialogWidth: 620
+ actions: [
+ { label: "取消" },
+ { label: "连接并开始", primary: true }
+ ]
+ onActionTriggered: label => {
+ host.close()
+ if (label === "连接并开始") host.startCapture()
+ }
+
+ DSection { text: "设备" }
+ DGroup {
+ VRow {
+ label: "视频输入设备"
+ hint: veyra.captureDevices.length === 0 ? "未检测到采集设备" : ""
+ VSelect {
+ value: veyra.captureDeviceLabel
+ options: veyra.captureDevices
+ onPicked: id => veyra.captureDeviceId = id
+ }
+ }
+ }
+ DSection { text: "格式与画面" }
+ DGroup {
+ VRow {
+ label: "转为 SDR 显示"
+ hint: "收到 HDR 也按 SDR 预览,立即生效"
+ VSwitch {
+ checked: veyra.captureForceSdr
+ onToggled: veyra.captureForceSdr = checked
+ }
+ }
+ VRow {
+ label: "画面上下翻转"
+ hint: "采集画面倒置时开启,立即生效"
+ VSwitch {
+ checked: veyra.captureFlipVertical
+ onToggled: veyra.captureFlipVertical = checked
+ }
+ }
+ }
+ DSection { text: "尚未接入" }
+ DNote {
+ text: "格式列表(分辨率 · 帧率 · 像素格式)、色彩空间与范围、设备缓冲、"
+ + "音频监听设备、Dolby / DTS 位流、限定输入帧率:引擎侧尚未暴露这些设置,"
+ + "这里不放假控件。当前按设备默认格式打开。"
+ }
+ }
+
+ // --- PS5 串流 ---------------------------------------------------------
+ DLayer {
+ visible: host.dialog === "ps5"
+ glyph: "🎮"
+ title: "PS5 串流"
+ sub: "局域网 Remote Play · 凭据加密保存在本机"
+ dialogWidth: 640
+ actions: [
+ { label: "取消" },
+ { label: "连接", primary: true }
+ ]
+ onActionTriggered: label => {
+ host.close()
+ if (label === "连接") host.startPs5()
+ }
+
+ DSection { text: "主机" }
+ DGroup {
+ VRow {
+ label: "串流状态"
+ hint: veyra.remotePlayState.length > 0 ? veyra.remotePlayState : "未连接"
+ }
+ VRow {
+ label: "主机地址"
+ hint: "PS5 设置 → 网络 → 连接状态 → 查看连接状态"
+ VTextField {
+ implicitWidth: 180
+ placeholder: "192.168.1.x"
+ onEdited: text => veyra.remotePlayHost = text
+ }
+ }
+ }
+ DSection { text: "配对" }
+ DGroup {
+ VRow {
+ label: "8 位配对码"
+ hint: "首次配对需要:PS5 远程游玩 → 关联设备"
+ VTextField {
+ implicitWidth: 150
+ placeholder: "••••••••"
+ onEdited: text => veyra.remotePlayPin = text
+ }
+ }
+ }
+ DNote {
+ text: "输入分辨率、编码(H.264 / H.265)、请求码率、解码方式、"
+ + "DualSense 转发与陀螺仪校准:尚未接入界面。外网串流暂未实现。"
+ }
+ }
+
+ // --- 屏幕捕获 ---------------------------------------------------------
+ DLayer {
+ visible: host.dialog === "screen"
+ glyph: "🖥"
+ title: "屏幕捕获"
+ sub: "把一个窗口或整块显示器作为片源"
+ dialogWidth: 700
+ actions: [
+ { label: "取消" },
+ { label: "开始捕获", primary: true }
+ ]
+ onActionTriggered: label => {
+ host.close()
+ if (label === "开始捕获") host.startScreen()
+ }
+
+ DSection { text: "目标" }
+ DGroup {
+ VRow {
+ label: "捕获目标"
+ hint: veyra.screenTargets.length === 0 ? "未找到可捕获的窗口或显示器" : ""
+ VSelect {
+ value: veyra.screenTargetLabel
+ options: veyra.screenTargets
+ onPicked: id => veyra.screenTargetId = id
+ }
+ }
+ VRow {
+ label: "重新枚举"
+ hint: "窗口打开或关闭后刷新列表"
+ VButton {
+ text: "刷新"
+ onClicked: veyra.refreshCaptureTargets()
+ }
+ }
+ }
+ DNote {
+ text: "捕获方式(Windows Graphics Capture / DXGI)、帧率上限、"
+ + "鼠标指针、裁剪与“填满窗口”:尚未接入界面;当前按整块目标区域采集。"
+ }
+ }
+
+ // --- 字幕设置 ---------------------------------------------------------
+ DLayer {
+ visible: host.dialog === "subtitle"
+ glyph: "🅰"
+ title: "字幕设置"
+ sub: "实时预览,设置对所有文件生效"
+ dialogWidth: 620
+ actions: [{ label: "完成", primary: true }]
+ onActionTriggered: host.close()
+
+ DNote {
+ text: "字幕轨选择、字号、字体、描边、背景条、底部距离与延时尚未接入:"
+ + "字幕样式与轨道由旧界面的字幕层持有,引擎侧没有对应设置,"
+ + "本轮不在这里维护第二份会与渲染结果不一致的状态。"
+ }
+ }
+
+ // --- 音频设置 ---------------------------------------------------------
+ DLayer {
+ visible: host.dialog === "audio"
+ glyph: "♪"
+ title: "音频设置"
+ dialogWidth: 560
+ actions: [{ label: "完成", primary: true }]
+ onActionTriggered: host.close()
+
+ DSection { text: "音轨" }
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 6
+ Text {
+ visible: veyra.audioTracks.length === 0
+ text: "当前源没有可选音轨。"
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsSmall
+ }
+ Repeater {
+ model: veyra.audioTracks
+ delegate: Rectangle {
+ required property var modelData
+ Layout.fillWidth: true
+ implicitHeight: 52
+ radius: 12
+ color: Theme.card2
+ border.width: 1
+ border.color: veyra.selectedAudioTrack === modelData.index ? Theme.accent : Theme.stroke
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 12
+ anchors.rightMargin: 12
+ spacing: 12
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 2
+ Text {
+ text: modelData.label
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ }
+ Text {
+ text: modelData.channels > 0 ? modelData.channels + " 声道" : ""
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ }
+ }
+ Text {
+ visible: veyra.selectedAudioTrack === modelData.index
+ text: "✓"
+ color: Theme.accent
+ font.pixelSize: 14
+ }
+ }
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: veyra.selectedAudioTrack = modelData.index }
+ }
+ }
+ }
+ DSection { text: "输出" }
+ DGroup {
+ VRow {
+ label: "音量"
+ value: Math.round(veyra.volume * 100) + "%"
+ VSlider {
+ implicitWidth: 170
+ from: 0; to: 1; value: veyra.volume
+ onMoved: veyra.volume = value
+ }
+ }
+ VRow {
+ label: "静音"
+ VSwitch {
+ checked: veyra.muted
+ onToggled: veyra.muted = checked
+ }
+ }
+ }
+ DSection { text: "音画同步" }
+ DGroup {
+ VRow {
+ label: "手动偏移"
+ hint: "负值 = 声音提前"
+ value: veyra.audioOffsetMs + " ms"
+ VSlider {
+ implicitWidth: 170
+ center: true
+ from: -500; to: 500; value: veyra.audioOffsetMs
+ onMoved: veyra.audioOffsetMs = Math.round(value / 10) * 10
+ }
+ }
+ }
+ DNote {
+ text: "输出设备选择与立体声下混尚未接入:当前跟随系统默认设备。"
+ }
+ }
+
+ // --- small building blocks the design's dialogs use --------------------
+ component DSection: RowLayout {
+ property string text: ""
+ Layout.fillWidth: true
+ Layout.topMargin: 14
+ Layout.bottomMargin: 4
+ spacing: 8
+ VEyebrow { text: parent.text }
+ Rectangle {
+ Layout.fillWidth: true
+ implicitHeight: 1
+ color: Theme.stroke
+ }
+ }
+
+ component DGroup: VGroup {
+ Layout.fillWidth: true
+ }
+
+ component DNote: Rectangle {
+ property string text: ""
+ Layout.fillWidth: true
+ Layout.topMargin: 8
+ implicitHeight: noteText.implicitHeight + 18
+ radius: 9
+ color: Qt.rgba(0.961, 0.784, 0.294, 0.06)
+ Text {
+ id: noteText
+ anchors.fill: parent
+ anchors.margins: 9
+ text: parent.text
+ color: Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsSmall
+ wrapMode: Text.WordWrap
+ }
+ }
+
+ component VTextField: Rectangle {
+ property string placeholder: ""
+ property alias text: field.text
+ signal edited(string text)
+ implicitHeight: 30
+ radius: 9
+ color: Qt.rgba(1, 1, 1, 0.04)
+ border.width: 1
+ border.color: field.activeFocus ? Theme.accent : Theme.stroke
+ TextInput {
+ id: field
+ anchors.fill: parent
+ anchors.leftMargin: 10
+ anchors.rightMargin: 10
+ verticalAlignment: TextInput.AlignVCenter
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ selectByMouse: true
+ onEditingFinished: parent.edited(text)
+ }
+ Text {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+ visible: field.text.length === 0
+ text: parent.placeholder
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ }
+ }
+}
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 65b42e09..c0e90798 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -143,6 +143,21 @@ Window {
SettingsPage { onRequestPage: p => root.page = p }
}
+ // The five dialogs sit above the pages and below the dock's own tooltips.
+ DialogHost {
+ id: dialogs
+ anchors.fill: parent
+ onStartCapture: {
+ if (veyra.captureDeviceId.length > 0) root.page = "min"
+ else toast.show("先选择一个采集设备", true)
+ }
+ onStartPs5: root.page = "min"
+ onStartScreen: {
+ if (veyra.screenTargetId.length > 0) root.page = "min"
+ else toast.show("先选择一个捕获目标", true)
+ }
+ }
+
// The dock floats above every page and retracts on its own.
TopDock {
id: dock
@@ -186,7 +201,15 @@ Window {
Connections {
target: veyra
function onNotice(text, isError) { toast.show(text, isError) }
- function onNavigate(p) { root.page = (p === "export" ? "exp" : p) }
+ function onNavigate(p) {
+ // A dialog key opens the dialog; anything else is a page.
+ if (p === "capture" || p === "ps5" || p === "screen"
+ || p === "subtitle" || p === "audio") {
+ dialogs.open(p)
+ return
+ }
+ root.page = (p === "export" ? "exp" : p)
+ }
}
// The film's aspect drives the window in cinema mode. Reported only: the
diff --git a/qml/Veyra/qmldir b/qml/Veyra/qmldir
index e384f397..1935b247 100644
--- a/qml/Veyra/qmldir
+++ b/qml/Veyra/qmldir
@@ -2,6 +2,7 @@ module Veyra
singleton Theme 1.0 Theme.qml
VAccordion 1.0 VAccordion.qml
VSubGroup 1.0 VSubGroup.qml
+DialogHost 1.0 DialogHost.qml
VButton 1.0 VButton.qml
VCard 1.0 VCard.qml
VDot 1.0 VDot.qml
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index 8f9efcb6..47afbeff 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -17,6 +17,8 @@
#include "veyra/Log.h"
#include "veyra/RuntimePaths.h"
+#include "veyra/source/CaptureCardSource.h"
+#include "veyra/source/ScreenCaptureSource.h"
namespace veyra::ui {
namespace {
@@ -67,6 +69,9 @@ struct QmlPlayerBridge::Impl {
bool exportHevc = false;
QString initialPageOverride;
QString currentPage;
+ std::wstring captureDevice;
+ QString screenTarget;
+ QString remotePlayHost, remotePlayPin;
QTimer* timer = nullptr;
@@ -394,6 +399,103 @@ void QmlPlayerBridge::copyDiagnostics() {
}
}
+
+// --- capture dialog ----------------------------------------------------------
+QVariantList QmlPlayerBridge::captureDevices() const {
+ // The source's own enumeration. An empty list means the machine reports no
+ // capture devices, and the dialog says so rather than listing examples.
+ QVariantList out;
+ for (const auto& name : source::CaptureCardSource::devices(false)) {
+ QVariantMap item;
+ item["id"] = utf8Of(name);
+ item["label"] = utf8Of(name);
+ out << item;
+ }
+ return out;
+}
+QString QmlPlayerBridge::captureDeviceId() const { return utf8Of(impl_->captureDevice); }
+void QmlPlayerBridge::setCaptureDeviceId(const QString& value) {
+ impl_->captureDevice = wideOf(value);
+ emit captureChanged();
+}
+QString QmlPlayerBridge::captureDeviceLabel() const {
+ const QString id = captureDeviceId();
+ return id.isEmpty() ? tr("未选择设备") : id;
+}
+
+// Force-SDR and vertical flip are real settings the engine already carries, so
+// these are genuine controls rather than placeholders.
+bool QmlPlayerBridge::captureForceSdr() const { return settings().forceSdrPreview; }
+void QmlPlayerBridge::setCaptureForceSdr(bool value) {
+ auto s = settings();
+ if (s.forceSdrPreview == value) return;
+ s.forceSdrPreview = value;
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+bool QmlPlayerBridge::captureFlipVertical() const { return settings().captureFlipVertical; }
+void QmlPlayerBridge::setCaptureFlipVertical(bool value) {
+ auto s = settings();
+ if (s.captureFlipVertical == value) return;
+ s.captureFlipVertical = value;
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+
+// --- screen capture ----------------------------------------------------------
+QVariantList QmlPlayerBridge::screenTargets() const {
+ // Enumerated from the source, both kinds, so the dialog can offer windows and
+ // monitors from what the machine actually has.
+ QVariantList out;
+ for (auto kind : {source::ScreenTargetKind::Window, source::ScreenTargetKind::Monitor}) {
+ for (const auto& target : source::ScreenCaptureSource::targets(kind)) {
+ QVariantMap item;
+ item["id"] = QString::number(target.handle);
+ QString label = QString::fromWCharArray(target.name.c_str());
+ if (target.width > 0)
+ label += QStringLiteral(" · %1x%2").arg(target.width).arg(target.height);
+ if (target.refresh > 0) label += QStringLiteral(" · %1Hz").arg(target.refresh);
+ item["label"] = label;
+ out << item;
+ }
+ }
+ return out;
+}
+QString QmlPlayerBridge::screenTargetId() const { return impl_->screenTarget; }
+void QmlPlayerBridge::setScreenTargetId(const QString& value) {
+ impl_->screenTarget = value;
+ emit captureChanged();
+}
+QString QmlPlayerBridge::screenTargetLabel() const {
+ const QString id = screenTargetId();
+ if (id.isEmpty()) return tr("未选择目标");
+ for (const auto& item : screenTargets()) {
+ if (item.toMap().value(QStringLiteral("id")).toString() == id)
+ return item.toMap().value(QStringLiteral("label")).toString();
+ }
+ return tr("目标已失效");
+}
+void QmlPlayerBridge::refreshCaptureTargets() {
+ // Re-enumeration is what the dialog's refresh does; the lists are read fresh on
+ // every call, so this only has to tell the UI to ask again.
+ emit captureChanged();
+}
+
+// --- ps5 dialog --------------------------------------------------------------
+QString QmlPlayerBridge::remotePlayHost() const { return impl_->remotePlayHost; }
+void QmlPlayerBridge::setRemotePlayHost(const QString& value) {
+ impl_->remotePlayHost = value;
+ emit settingsChanged();
+}
+QString QmlPlayerBridge::remotePlayPin() const { return impl_->remotePlayPin; }
+void QmlPlayerBridge::setRemotePlayPin(const QString& value) {
+ // Held only until the connect command runs; it is never written to the session
+ // file, and the engine keeps PSN credentials encrypted in the user data
+ // directory rather than here.
+ impl_->remotePlayPin = value;
+ emit settingsChanged();
+}
+
void QmlPlayerBridge::attachVideoWindow(qulonglong nativeHandle) {
impl_->videoWindow = reinterpret_cast<HWND>(nativeHandle);
}