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++
fix(ui): scope playlist keys and complete fullscreen exit integration
Veyra Goal Agent28f6532ca1c0
diff --git a/README.md b/README.mdindex aa7e69fa..5d5cbc8a 100644--- a/README.md+++ b/README.md@@ -64,6 +64,8 @@ Turn local video, capture cards and game streaming into one real-time GPU enhanc**2.1.0 release, 2026-10-19:** AMD NR0.44 Small/Original models, independent anti-aliasing,468-point face beauty/restoration, capture format discovery/selection fixes, networking, AVerMedia audio and fullscreen/window capture improvements. [Full update report](docs/RELEASE_NOTES_2.1.0.md).+**Local integration after 2.1.0 (not released):** recording and AMD SR-off fixes, 90° picture rotation, per-layer NR percentage controls and video-export size support, asynchronous VRR queries, NR/NVAPI shutdown lifetime, fullscreen/playlist key handling, and timestamp-less capture sample handling. CV710 and the original RTX3090 shutdown report still require verification on the affected hardware. [Integration scope and validation](docs/CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.md).+**New-effect cost examples:** RTX5070 standard4K anti-aliasing fixtures: FXAA~0.15ms, SMAA/MLAA~0.30ms. Final single-face mesh beauty:1080p~0.93ms,4K~1.42ms. Costs vary with content/hardware; no local AMD speedup percentage was measured. [Conditions and limits](docs/RELEASE_NOTES_2.1.0.md).**[Veyra knowledge base](https://qcnv4i7tnd7l.feishu.cn/wiki/space/7688258025282358221?ccm_open_type=lark_wiki_spaceLink&open_tab_from=wiki_home)** — community guidance compiled from four group chats, covering software setup, common problems and capture cards.diff --git a/README_CN.md b/README_CN.mdindex bd218023..a5becd3c 100644--- a/README_CN.md+++ b/README_CN.md@@ -20,6 +20,8 @@ Windows 视频、图片、采集卡与串流增强工具。在同一处理链组**2.1.0正式发布,2026-10-19:** AMD NR升级0.44并支持Small/原模型;新增独立抗锯齿、美颜与468点人脸原画保护,修复采集卡分辨率/格式缺项,整合网络缓冲、圆刚音频、窗口捕获及全屏修复。[完整更新报告](docs/RELEASE_NOTES_2.1.0.md)。+**2.1.0之后的本地整合(尚未发布):** 录制与AMD超分关闭修复、90°画面旋转、每层NR手动百分比及视频导出尺寸、后台VRR查询、NR/NVAPI关闭生命周期、全屏/播放列表键归属,以及采集无时戳样本接收修复。CV710与原RTX3090关闭问题仍需受影响原机复测。[整合范围与验收](docs/CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.md)。+**本机新增效果开销示例:** RTX5070,4K标准测试抗锯齿FXAA约0.15ms、SMAA/MLAA约0.30ms;最终网格美颜一张脸1080p约0.93ms、4K约1.42ms。不同素材/显卡会变化;AMD新模型没有本机实卡性能百分比。[条件与限制](docs/RELEASE_NOTES_2.1.0.md)。**[Veyra软件知识库](https://qcnv4i7tnd7l.feishu.cn/wiki/space/7688258025282358221?ccm_open_type=lark_wiki_spaceLink&open_tab_from=wiki_home)**:整理四个群聊的消息汇总成的Veyra使用文档,大部分软件问题、采集卡问题都可以先在里面查找答案。diff --git a/docs/CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.md b/docs/CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.mdnew file mode 100644index 00000000..c15c5a72--- /dev/null+++ b/docs/CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.md@@ -0,0 +1,45 @@+# 采集音频卡画面排查与近期功能整合++本轮仅整合本地 main,正式发布仍为2.1.0;未推送、未发布。施工从207555b开始,#67以merge提交保留6199212原历史;其余最近功能均保留原提交。准确main/source/package身份见 `E:/项目/Veyra/reports/capture-audio-main-20261025/` 的 integration-audit.json、update-package.json 与 FINAL.json。主线入口仍为此 E盘施工树,旧桌面及其它工作树不覆盖。++## CV710 日志与修复边界++RAR内只有veyra-qml.log,原件SHA256为809F6301DFD05977A3E8668728897A3BBF2AC0D05B967DECE770A3F48B834FCD,存archives/capture-audio-main-20261025。日志为3080Ti、AVerMedia U3/CV710、1080p59.94 YUY2。关监听时约60fps;启用同设备内置PCM48k/16bit/stereo后,音频持续299块,视频接收计数为0。默认/系统时钟轮换三次均不能恢复。音频首个无时间戳样本还造成host/流时钟切换和reset;这不证明它阻塞视频,也不能把平均输入不稳认定为原因。++确认源码缺陷:两个原生视频投递回调把GetTime的VFW_E_SAMPLE_TIME_NOT_SET直接作为失败返回给生产者。未设置时间戳是合法样本状态,流生产者可能在Receive失败后停止后续视频。现在只对这个明确状态返回S_OK并跳过,不生成帧、不补造PTS;真正错误继续返回。有效start但无stop仍保留真实start。加首3个视频Receive和限频的缺失/恢复日志,区分驱动从未调用与样本在处理前被拒绝。++这是已复现的接收合同错误修复,**不是已证实CV710现场根因/原卡验收通过**。没有CV710/3080Ti原机;下一次原卡日志的capture-video-delivery/capture-video-time可验证这一假设。若仍无视频投递,不继续盲猜时钟或强行修改驱动/缓冲。没有改10ms音频协商、驱动、运行库或模型。++依据:[Microsoft IMediaSample::GetTime](https://learn.microsoft.com/en-us/windows/win32/api/strmif/nf-strmif-imediasample-gettime) 区分VFW_E_SAMPLE_TIME_NOT_SET和VFW_S_NO_STOP_TIME;[libdshowcapture接收路径](https://github.com/obsproject/libdshowcapture/blob/master/source/device.cpp) 对缺时戳原始数据不送用户回调。这是契约参考,未复制第三方实现。++## 全屏退出补丁的追加纠偏++完整存档原main-merge-20261002的未提交补丁、7个文件及哈希,原树保持不动。顶部还原在全屏调用既有toggleFullscreen,保留进入前的窗口/最大化状态。节点重复Esc合并,隐藏页不抢键,专业保护绘制与全屏Esc互斥。++原待合补丁不完整:仅凭playlistWindow.active禁用主Esc;真实测试证实,隐藏的播放列表仍可能active=true。只补visible仍不足以正确表达工具窗口焦点。最终将播放列表Esc/Delete/Return放到它自己的FocusScope/Keys路径,ShortcutOverride防止主Esc抢键;主全屏Esc统一调度。这同时覆盖隐藏、显示但失焦、显示且获得焦点三种状态。++## 已整合范围++- Claude接手的录制生命周期/声音、AMD超分关闭修复。+- 极简/专业共用90°画面旋转和随画面调整的呈现/坐标。+- 每层NR手动25%–100%,保存/复制/节点/预设兼容。+- fg1后台VRR查询,保留预算/告警/真实PTS。+- 视频NR导出固定档与手动百分比,最终输出尺寸不变、图片完整处理、AMD预算保留。+- #67进程级System32 NVAPI保留与成对关闭日志。+- 本轮采集无时戳预备样本修复与上述全屏/Esc修复。++Lecram仍暂停;旧FSR4/NVIDIA实验等历史分支不混入。清理/依赖迁移文档随原提交保留,不再次删除历史目录。++## 验证与局限++复用build/claude-screen-recording-20261022,脚本build-recording-handoff.py,标签2.1.0-int1,-j2,每次构建<=900秒;所有测试进程<=300秒。9个目标全部通过:采集颜色/原生接收285项(真实DirectShow allocator/IMediaSample复现缺时戳HRESULT、后续有时戳恢复、真错误仍传播)、NVAPI并发/模块固定、Repair272、UI384布局、EffectChain1008组合、异步显示查询、NR模型全76百分比与存储、真实WASAPI音频、QtQuick115项。++真实引擎运行:SF性能/旧模型/原版切换均实际推理并保存图;NR开启状态停止157.685ms,同进程再次打开并NR开启停止通过,NGX Shutdown1成对成功。不冒充原3090/616.92复现通过。整合后再次真实worker导出4K/37%+NVOF,NR创建1420x798,HEVC输出3840x2160共6帧,ffprobe完整解码。++本机KUHAIMI G50显式请求2560x1440p60 NV12,独立HDMI音频48k短接收检查通过:configure不启动、Run后真实帧/52块音频、读者持帧时生产者继续、邮箱有界/Drop重置。此测试只有约1.2秒,含驱动启动期,打印callbackFps10.003;**不能用它宣称稳态60fps或CV710内置音频已恢复**。之前fg1的39秒2K60补帧A/B证据仍是之前提交的证据。++computer-use原生输入:软件UI专业F11/Esc、顶部还原、极简退出;GPU D3D11 UI F11/Esc;明确确认切换到实际节点模式,再测Ctrl+L锁定/Esc、窗口最大化→全屏→Esc恢复。暂停退出画面保留。日志native-software-final/native-gpu-final/native-gpu-node。播放列表三态按键由真实QML窗口、实际焦点QWindow事件测试覆盖。没有做全保护绘制/连线组合、真实CV710、HDR/长期或屏幕光学延迟验收,不承诺绝无bug。++失败保留:首次命令误写测试目标nr_model_policy,Ninja未开始编译,修正为已有nr_model_settings;初始全屏夹具把QQuickView传给QML Window类型失败,后续QTest按键和active标志不能代表真实焦点,反复失败真实保留。最终夹具使用独立QML Window、等待QGuiApplication::focusWindow、给实际焦点窗口送Qt事件;Windows平台115通过。offscreen不能用来证明这类原生激活/键归属。新增测试辅助类不进入产品二进制。运行库177项SHA保持,未复制凭据/真实配置。++命令:`python -X utf8 -B -I scripts/acceptance/capture-audio-main.py prepare|contracts|quick|gpu`,native launch用独立mode;构建/失败/运行原日志均在本任务logs。最终核对100个其它工作树的HEAD/status、全屏原脏文件哈希及旧refs,main用正常快进合并;保留隔离分支和检查点,不force/push/Release。diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.mdindex 2f3d9f1d..1c2dc76c 100644--- a/docs/CURRENT_STATUS.md+++ b/docs/CURRENT_STATUS.md@@ -1,5 +1,9 @@# 当前项目状态 / Current Status+## 2026-10-25 近期功能与修复本地整合++用户已授权合入本地main:录制/AMD超分关闭、90°旋转、NR每层手动百分比、FG后台VRR查询、NR视频导出尺寸、#67 NVAPI生命周期,以及本轮采集无时戳预备样本/全屏与播放列表键归属修复。Windows构建、9个定向测试目标、115项QML、真实NR切换/关闭/重开、4K37%+NVOF导出与原生全屏操作通过。CV710原卡/原3090关闭问题仍需现场复测,不冒充已确认根因。详见[整合报告](CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.md);准确main与包身份在E盘reports/capture-audio-main-20261025。正式发布仍为2.1.0;无push/Release,Lecram暂停。以下“未合main”为各历史时点记录,不覆盖本次整合。+## 2026-10-21 Claude 中断任务本地接手隔离分支 `codex/claude-handoff-20261022` 完成 AMD 超分关闭修复与带声音实时录制的生命周期/队列/收尾修复,真实 Radeon 核显开关、NVENC/MF实录、约62秒录制、4K文件、限帧/静音/暂停/改效果/尺寸分段/补帧及错误路径有本机证据。详细范围、命令、已测与未测见 [接手报告](CLAUDE_HANDOFF_REPORT_2026-10-22.md)。Lecram 按用户明确指令暂停。此分支没有合并 main、推送或发布,正式版本仍为2.1.0;隔离环境中 DLSS SR 首次初始化卡顿在原2.1.0也复现,未算通过。diff --git a/docs/FULLSCREEN_EXIT_PLAN_2026-10-21.md b/docs/FULLSCREEN_EXIT_PLAN_2026-10-21.mdnew file mode 100644index 00000000..517c08e4--- /dev/null+++ b/docs/FULLSCREEN_EXIT_PLAN_2026-10-21.md@@ -0,0 +1,19 @@+# 全屏退出按钮和 Esc 修复++用户反馈 2.1.0 全屏后顶部按钮和 Esc 均无法退出。存档 checkpoint/pre-fullscreen-exit-20261021,起点 4ae285b,隔离分支 codex/fullscreen-exit-20261021;产物 E:/项目/Veyra/{tests,tmp,logs,reports,archives}/fullscreen-exit-20261021。++## 已复现及来源++- 发布包私有副本、独立配置、GTA4K 原视频,真实鼠标点击顶部按钮无状态变化;toggleMaximized 在 fullscreen 直接 return,按钮仍显示“最大化”。该代码来自 4fbc2b0(10月1日),不是最近 UI 软件绘制修复新增。+- 真实 Escape 无效而 F11 正常。仅测试副本加 activatedAmbiguously 日志证实 Esc 冲突;单独给播放列表 Escape 加 visible && active 后,真实 Escape 成功退出。播放列表未限定的 Escape 来自 e6ead9f(10月9日),隐藏工具窗口也参与匹配。+- 同查发现节点页有两条相同连线 Escape 和一条多选 Escape;合并为单一可见状态动作,避免连线/多选再次冲突。专业保护绘制 Esc 与全屏动作也需互斥。++## 施工范围++仅 Main/PlaylistWindow/NodePage/ProPage QML 窗口和快捷键接点、必要回归及文档。顶部按钮在全屏走既有 toggleFullscreen 恢复原窗口状态,提示显示还原。列表 Esc/Delete/Return 只在列表可见且激活时启用。全屏 Esc 统一调度,先取消可见的保护绘制或节点操作、游戏模式先收起面板,其余退出;隐藏页不抢键。++不改 GPU/软件 UI 默认、不加刷新 Timer/requestUpdate、不改33ms/250ms或视频/增强/补帧/驱动/运行库,不触碰用户配置/其他工作树;无子 Agent、main合并/push/Release/关机。++## 验证++使用 computer-use skill 原生输入复现和回归 GPU/软件界面的极简/专业/节点全屏按钮、Esc、锁定、窗口/最大化恢复,保留暂停状态;验证隐藏和激活播放列表的键归属及节点取消。测试副本隔离,不修改原发布目录。定向 Qt Quick 测试与既有组件/布局检查、构建检查;单测试≤300秒,构建≤900秒限并发。报告真实通过及未覆盖项,不把短测当性能或全硬件验收。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 61e73370..35fc66c9 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -9982,3 +9982,20 @@ GPU图探针stack1-percent-still/stack2-percent-export各2帧,前者手动50%实际命令:py -3.11 -X utf8 -B E:/项目/Veyra/tmp/issue67-nvapi-shutdown-20261021/build.py(调用本树参数化claude-beauty-build.py,取bilibili-2.1.0缓存、Ninja并发2);7目标241.2秒通过,日志logs/issue67-nvapi-shutdown-20261021/build-20261021-222653。py -3.11 -X utf8 -B E:/项目/Veyra/tmp/issue67-nvapi-shutdown-20261021/checks.py:NVAPI并发/PIN、架构策略、模型预设、旧兼容IAT三次恢复、真实NGX core生命周期、两次独立进程SF/原版视频切换全部通过,单测<14秒。真实GTA6 4K、NR开启状态直接stop为233.588/201.799ms,两轮都能同进程重开并正常再次停止,退出0。各进程NVAPI只固定一次、5次NR卸载、4次Shutdown1全部返回,8张输出3840×2160非黑;无engine-hang,两NR原件SHA未变。完整命令/输出/索引reports/issue67-nvapi-shutdown-20261021/final.json;所有产物全E盘。汇总脚本一次纯UTF8读混合编码日志失败,容错读ASCII字段后通过,原日志未改;一次停止时FFmpeg输出截断packet/NAL警告,另有既存d3d12 swscaler警告,两轮重开均正常,本轮不宣称修复这些解码文字。仅RTX5070/616.56通过,没有3090/616.92或用户dump,不称原用户根因已证实或硬件问题已彻底修好。只保留驱动模块映射,不保留NR feature/模型/GPU资源。不合main/push/发布/评论/关机,不派Agent。+++## 2026-10-25 CV710监听卡画面与全部近期修复本地main整合++用户明确要求修复所附veyra-qml(1).rar并合并近期全部修复/功能到main。207555b开codex/capture-audio-main-20261025,原main4ae285b与开工点打checkpoint;snapshot脚本存101树状态/全refs、全屏原脏补丁/7文件ZIP/SHA。原RAR仅日志,SHA809F6301...834FCD。单Agent、全E盘、不改原配置/运行库/模型/驱动/旧树,无push/Release/Lecram。++CV710/3080Ti/1080p59.94YUY2:音频关约60fps,开同设备PCM48k后299块音频但0视频,默认/系统时钟交替三次均失败。确认原GetTime缺时戳失败直接返回驱动的接收错误;timedCaptureDelivery只对此状态S_OK跳过,不生成PTS/帧,其它真错误传播,首3次Receive及缺时戳/恢复限频日志。真实allocator/IMediaSample回归复现旧返回失败、零时戳/缺stop/后续恢复/真错误。原日志没记录视频Receive原因,不能宣称CV710原机根因已证实,需原卡新日志复测。++6199212的#67生命周期以dd182be保留历史合入,仅AGENTS/WORKLOG追加冲突两边保留;CMake源码/测试同时保留。全屏原脏补丁导入后真实Esc仍失败:隐藏playlist.active仍true;visible加active也不能代表实际焦点。最终playlist转本窗口FocusScope/Keys+ShortcutOverride,主Esc统一分配;节点重复Esc合一,保护绘制互斥,顶部还原走既有toggleFullscreen。原树逐SHA保持。++命令build-recording-handoff.py --task codex-capture-audio-main-20261025 --root 当前E树 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --reconfigure --label 2.1.0-int1,-j2。初次误写目标nr_model_policy被Ninja拒绝、未开始编译,改nr_model_settings后40.5秒通过,后续定向4.7/4.6秒;Qt夹具3.6秒。初始Quick夹具owner类型和focus/active假设失败保存日志,不用offscreen证明窗口键归属;最终独立QML Window、等待真实focusWindow、实际Qt键事件,Windows/software115通过。9定向目标均0:Capture285、NVAPI并发PIN、Repair272、UI384布局、EffectChain1008、AsyncDisplay、NR Model76比例与存储、WASAPI音频约22秒、Quick115。++实际5070 NR/SF模型/原版切换、4张输出、NR开启停止157.685ms、同进程重开NR再停与Shutdown1成对成功;不外推原3090。整合后真实worker 4K/37%+NVOF导出,NR1420x798、HEVC3840x2160/6帧全解码。G50真实请求2K60NV12+HDMI独立48k音频短接收1.2秒,通过生产/持帧/邮箱/Drop/52块音频,启动期callbackFps10.003,不算稳态60或CV710恢复。++computer-use技能原生按键/点击:软件专业F11/Esc、顶部还原、极简退出;GPU D3D11 F11/Esc;实际确认进入节点模式后Ctrl+L/Esc、最大化->全屏->Esc。软件首轮误以为切到节点,实际弹确认框未确认,故另起gpu-node明确确认并核对mode=node后验收,未把初轮当节点通过。所有私有播放器正常退出。日志native-software-final/gpu-final/gpu-node。++详细报告CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.md;证据reports/capture-audio-main-20261025,日志logs同名,原档archives同名。finalize脚本核对100其它工作树HEAD/status、原全屏7文件哈希、旧refs(只本整合branch/main允许变化)。保留原分支与checkpoint,用正常快进整合本地主main;准确提交及包在integration-audit.json/update-package.json/FINAL.json,不从本条计划推断实际合并已执行。小更新共同EXE/QML需原2.1.0完整NVIDIA/AMD底包,不含运行库/模型/配置。diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qmlindex d7ee622c..34df5758 100644--- a/qml/Veyra/Main.qml+++ b/qml/Veyra/Main.qml@@ -59,7 +59,9 @@ Window {readonly property bool maximized: visibility === Window.Maximizedreadonly property bool screenSized: fullTarget || maximizedfunction toggleMaximized() {- if (fullscreen) return+ // The dock's restore button must also leave fullscreen, using the same+ // saved window state and cleanup as F11 / the transport button.+ if (fullscreen) { toggleFullscreen(); return }visibility = maximized ? Window.Windowed : Window.Maximizedveyra.logUi("ui-window", "maximized=" + (visibility === Window.Maximized))}@@ -324,7 +326,7 @@ Window {anchors.horizontalCenter: parent.horizontalCenter// The node page is the professional mode's node view.currentPage: root.page === "node" ? "pro" : root.page- maximized: root.maximized+ maximized: root.maximized || root.fullscreenpinned: root.test.dockPinned === true || veyra.preferences.dockPinned === truelocked: root.fullLockedforcedTip: root.test.tip !== undefined ? root.test.tip : ""@@ -717,7 +719,17 @@ Window {Shortcut {sequence: "Esc"enabled: root.fullscreen- onActivated: veyra.gameMode && root.quickPanelShown ? root.closeQuickPanel() : root.toggleFullscreen()+ onActivated: {+ // Visible editing operations own the first Escape. Hidden pages and+ // the hidden playlist must never compete with fullscreen's shortcut.+ if (root.quickPanelShown && veyra.protectionDrawShape.length > 0)+ veyra.beginProtectionDraw("")+ else if (root.quickPanelShown && root.page === "node" &&+ (nodePage.wireFrom >= 0 || nodePage.marked.length > 0))+ nodePage.clearSelection()+ else if (veyra.gameMode && root.quickPanelShown) root.closeQuickPanel()+ else root.toggleFullscreen()+ }}// Home: the fullscreen quick-adjust panel, from 极简 or 专业 (list or node view).Shortcut {diff --git a/qml/Veyra/NodePage.qml b/qml/Veyra/NodePage.qmlindex a5471b5c..dbd78d55 100644--- a/qml/Veyra/NodePage.qml+++ b/qml/Veyra/NodePage.qml@@ -127,7 +127,17 @@ VPage {enabled: root.visible && (root.marked.length > 0 || root.selectedId > 1)onActivated: root.deleteSelected()}- Shortcut { sequence: "Escape"; enabled: root.visible && root.marked.length > 0; onActivated: root.marked = [] }+ // One local Escape action: the old overlapping wire/selection shortcuts+ // became ambiguous. In fullscreen the shell arbitrates visible operations.+ Shortcut {+ sequence: "Escape"+ enabled: root.visible && (!root.shell || !root.shell.fullscreen) &&+ (root.wireFrom >= 0 || root.marked.length > 0)+ onActivated: {+ if (root.wireFrom >= 0) root.clearSelection()+ else root.marked = []+ }+ }// Every box with its TARGET position (where the spring is heading), not the// animated on-screen one; a box being dragged uses where the pointer holds it.function boxes() {@@ -315,7 +325,6 @@ VPage {}function onNodeAnchorsChanged() { wires.requestPaint() }}- Shortcut { sequence: "Escape"; enabled: root.wireFrom >= 0; onActivated: root.clearSelection() }// Card sizes are only known after their editors lay out (and change on// collapse / section switches): settle once the sizes stop changing.// A layout that overlaps once the cards have their real sizes after the page@@ -341,7 +350,6 @@ VPage {}onVisibleChanged: if (visible) { layoutChecked = false; settleTimer.restart() }Component.onCompleted: settleTimer.restart()- Shortcut { sequence: "Escape"; enabled: root.wireFrom >= 0; onActivated: root.wireFrom = -1 }onPanXChanged: { canvasGrid.requestPaint(); wires.requestPaint() }onPanYChanged: { canvasGrid.requestPaint(); wires.requestPaint() }diff --git a/qml/Veyra/PlaylistWindow.qml b/qml/Veyra/PlaylistWindow.qmlindex bbb782f5..295cd332 100644--- a/qml/Veyra/PlaylistWindow.qml+++ b/qml/Veyra/PlaylistWindow.qml@@ -68,13 +68,26 @@ Window {function onClosing(event) { win.hide() }}Timer { id: errorTimer; interval: 6000; onTriggered: win.failure = "" }- Shortcut { sequence: "Escape"; onActivated: win.hide() }- Shortcut { sequence: "Delete"; onActivated: win.removeSelected() }- Shortcut {- sequence: "Return"- onActivated: win.playlist.play(win.playlist.indexOfPath(win.selectedPath))- }-+ // Window.active also includes an owned activation group and can stay true+ // while hidden. Handle these keys only along this window's actual focus+ // path; ShortcutOverride keeps the owner's fullscreen Escape out of it.+ FocusScope {+ anchors.fill: parent+ focus: true+ Keys.onShortcutOverride: event => {+ if (win.visible && (event.key === Qt.Key_Escape || event.key === Qt.Key_Delete ||+ event.key === Qt.Key_Return || event.key === Qt.Key_Enter))+ event.accepted = true+ }+ Keys.onPressed: event => {+ if (!win.visible) return+ if (event.key === Qt.Key_Escape) win.hide()+ else if (event.key === Qt.Key_Delete) win.removeSelected()+ else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)+ win.playlist.play(win.playlist.indexOfPath(win.selectedPath))+ else return+ event.accepted = true+ }Rectangle {anchors.fill: parentradius: Theme.rWindow@@ -306,4 +319,5 @@ Window {onPressed: win.startSystemResize(modelData.e)}}+ }}diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qmlindex 7de758ef..81707a06 100644--- a/qml/Veyra/ProPage.qml+++ b/qml/Veyra/ProPage.qml@@ -800,7 +800,8 @@ VPage {}Shortcut {sequence: "Escape"- enabled: veyra.protectionDrawShape.length > 0+ enabled: root.visible && (!root.shell || !root.shell.fullscreen) &&+ veyra.protectionDrawShape.length > 0onActivated: veyra.beginProtectionDraw("")}Text {diff --git a/scripts/acceptance/capture-audio-main-finalize.py b/scripts/acceptance/capture-audio-main-finalize.pynew file mode 100644index 00000000..8e02d087--- /dev/null+++ b/scripts/acceptance/capture-audio-main-finalize.py@@ -0,0 +1,40 @@+"""Audit the tested local integration, preserved checkouts and native UI logs."""+from pathlib import Path+import hashlib,json,re,subprocess+B=Path('E:/项目/Veyra');T='capture-audio-main-20261025';R=Path(__file__).resolve().parents[2];O=B/'reports'/T;L=B/'logs'/T;S=B/'archives'/T+def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()+def git(root,*args):return subprocess.check_output(['git','-C',str(root),*args])+assert all(x['exit']==0 for x in json.loads((O/'contracts.json').read_text('utf8')))+assert all(x['exit']==0 for x in json.loads((O/'capture-final.json').read_text('utf8')))+assert json.loads((O/'nr-switch.json').read_text('utf8'))['exit']==0+assert json.loads((O/'integrated-export.json').read_text('utf8'))['passed']+rows=[]+for mode in ['software-final','gpu-final','gpu-node']:+ text=(L/('native-'+mode+'-console.log')).read_text('utf8',errors='replace')+ entered=text.count('[ui-fullscreen] enabled=true');left=text.count('[ui-fullscreen] enabled=false')+ assert entered>=1 and entered==left,(mode,entered,left)+ assert not re.search(r'\[ERROR\]|ReferenceError:|TypeError:|Cannot assign to non-existent',text),mode+ if mode=='gpu-node':assert 'mode=node' in text and '[ui-window] maximized=true' in text and 'locked=true shortcut=Ctrl+L' in text+ if mode.startswith('gpu'):assert 'interface=GPU' in text+ else:assert 'software UI:' in text+ rows.append(dict(mode=mode,entered=entered,left=left,log=str(L/('native-'+mode+'-console.log'))))+(O/'native-ui.json').write_text(json.dumps(rows,ensure_ascii=False,indent=1),'utf8')+before=json.loads((S/'worktrees-before.json').read_text('utf8'));preserved=[]+for row in before:+ p=Path(row['worktree'])+ if p.resolve()==R.resolve():continue+ assert git(p,'status','--porcelain=v1','-z').decode('utf8')==row['status'],str(p)+ assert git(p,'rev-parse','HEAD').decode().strip()==row['HEAD'],str(p)+ preserved.append(str(p))+fullscreen=Path('E:/项目/Veyra/worktrees/main-merge-20261002')+for name,digest in json.loads((S/'fullscreen-hashes.json').read_text('utf8')).items():assert sha(fullscreen/name)==digest,name+refs=dict(line.split(' ',1)[::-1] for line in (S/'refs-before.txt').read_text('utf8').splitlines())+now=dict(line.split(' ',1)[::-1] for line in git(R,'show-ref').decode().splitlines())+changed=[name for name,value in refs.items() if now.get(name)!=value]+assert set(changed)<=set(['refs/heads/main','refs/heads/codex/capture-audio-main-20261025']),changed+source=Path('E:/wechat/xwechat_files/wxid_kcmlgkgv70mv22_d585/msg/file/2026-10/veyra-qml(1).rar')+assert sha(source)==sha(S/'user-log.rar')=='809f6301dfd05977a3e8668728897a3bbf2ac0d05b967dece770a3f48b834fcd'+head=git(R,'rev-parse','HEAD').decode().strip()+result=dict(sourceCommit=head,mainCommit=git(R,'rev-parse','main').decode().strip(),otherWorktreesPreserved=len(preserved),originalFullscreenFilesPreserved=True,changedRefs=changed,testsPassed=True,nativeUi=rows,cv710HardwareRetested=False,pushed=False,published=False)+(O/'integration-audit.json').write_text(json.dumps(result,ensure_ascii=False,indent=1),'utf8');print(json.dumps(result,ensure_ascii=False))diff --git a/scripts/acceptance/capture-audio-main.py b/scripts/acceptance/capture-audio-main.pynew file mode 100644index 00000000..5341928f--- /dev/null+++ b/scripts/acceptance/capture-audio-main.py@@ -0,0 +1,72 @@+"""Bounded local integration checks; no real user state or proprietary changes."""+from pathlib import Path+import argparse,hashlib,json,os,shutil,subprocess,time+B=Path('E:/项目/Veyra');T='capture-audio-main-20261025';R=Path(__file__).resolve().parents[2]+D=B/'build/claude-screen-recording-20261022';A=B/'tests'/T/'app';O=B/'reports'/T;L=B/'logs'/T;TMP=B/'tmp'/T+for p in [O,L,TMP]:p.mkdir(parents=True,exist_ok=True)+arg=argparse.ArgumentParser();arg.add_argument('stage',choices=['prepare','contracts','quick','gpu','launch']);arg.add_argument('--mode',default='software');a=arg.parse_args()+def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()+def replace(dst,src):+ dst.parent.mkdir(parents=True,exist_ok=True)+ if dst.exists():dst.unlink() # detach mutable code from immutable donor hardlinks+ shutil.copyfile(src,dst)+def env_for(name):+ p=B/'tests'/T/('profile-'+name);tmp=TMP/name+ p.mkdir(parents=True,exist_ok=True);tmp.mkdir(parents=True,exist_ok=True)+ env={k:v for k,v in os.environ.items() if not k.upper().startswith(('VEYRA_','QT_','QSG_','QML_'))}+ env.update(TEMP=str(tmp),TMP=str(tmp),APPDATA=str(p/'AppData'),LOCALAPPDATA=str(p/'LocalAppData'),CUDA_CACHE_PATH=str(TMP/'cuda'),QML_DISABLE_DISK_CACHE='1',QT_FORCE_STDERR_LOGGING='1')+ env['PATH']=str(B/'deps/qt/6.8.3/msvc2022_64/bin')+';'+str(B/'deps/ffmpeg-filter-issues41-45-20261016/bin')+';'+env['PATH']+ return env,p+def run(name,cmd,cwd=D,env=None,timeout=280):+ f=L/(name+'.log');start=time.monotonic()+ with f.open('wb') as stream:+ c=subprocess.run(list(map(str,cmd)),cwd=cwd,env=env or env_for(name)[0],stdout=stream,stderr=subprocess.STDOUT,timeout=timeout)+ row=dict(name=name,exit=c.returncode,seconds=round(time.monotonic()-start,3),log=str(f));print(json.dumps(row),flush=True);return row+if a.stage=='prepare':+ donor=B/'releases/release-2.1.0-20261019/runtime-base/NVIDIA';dm=json.loads((donor/'package-manifest.json').read_text('utf8'))+ if not A.exists():+ A.mkdir(parents=True)+ for e in dm['files']:+ rel=e['path'];p=A/rel+ if rel.startswith('logs/') or any(x.startswith('user-data-') for x in Path(rel).parts):continue+ p.parent.mkdir(parents=True,exist_ok=True);os.link(donor/rel,p)+ shutil.copyfile(donor/'package-manifest.json',A/'package-manifest.json')+ for name in ['veyra_qml_ui','veyra_nr_runtime_switch_tests','veyra_capture_tests','veyra_nr_export_size_tests']:replace(A/(name+'.exe'),D/(name+'.exe'))+ for folder in ['qml','i18n']:+ for p in (R/folder).rglob('*'):+ if p.is_file():replace(A/folder/p.relative_to(R/folder),p)+ runtime=[e for e in dm['files'] if Path(e['path']).suffix.lower() in ['.dll','.onnx','.tflite','.hsaco','.dxil']]+ assert all(sha(A/e['path'])==e['sha256'] for e in runtime)+ (O/'prepared.json').write_text(json.dumps(dict(app=str(A),exeSha256=sha(A/'veyra_qml_ui.exe'),runtimeFiles=len(runtime)),ensure_ascii=False,indent=1),'utf8')+ print('Prepared private app; unchanged runtime files:',len(runtime))+elif a.stage in ['contracts','quick']:+ for p in (R/'tests/qml/quick').glob('tst_*.qml'):replace(D/'qml-tests'/p.name,p)+ results=[]+ targets=['capture_color','nvapi_lifetime','repair_contract','ui_contract','effect_chain','async_display_query','nr_model_settings','capture_audio','qml_quick']+ if a.stage=='quick':+ targets=['qml_quick'];results=[x for x in json.loads((O/'contracts.json').read_text('utf8')) if x['name']!='qml_quick']+ if not (O/'contracts-initial.json').exists():+ shutil.copyfile(O/'contracts.json',O/'contracts-initial.json');shutil.copyfile(L/'qml_quick.log',L/'qml_quick-initial.log')+ for name in targets:+ env,p=env_for('contracts-'+name);cmd=[D/('veyra_'+name+'_tests.exe')]+ if name=='nr_model_settings':cmd.append(B/'tests'/T/'model-policy')+ if name=='qml_quick':env.update(QT_QPA_PLATFORM='windows',QT_QUICK_BACKEND='software')+ row=run(name,cmd,env=env);results.append(row)+ (O/'contracts.json').write_text(json.dumps(results,ensure_ascii=False,indent=1),'utf8')+ assert all(x['exit']==0 for x in results)+elif a.stage=='gpu':+ assert not any(line.lower().startswith('"veyra') for line in subprocess.check_output(['tasklist','/fo','csv','/nh'],text=True,errors='replace').splitlines())+ media=B/'tests/nr-manual-scale-20261024/media/nr-1080p30.mp4'+ row=run('nr-runtime-switch', [A/'veyra_nr_runtime_switch_tests.exe',media,B/'tests'/T/'nr-switch'],cwd=A,timeout=270)+ (O/'nr-switch.json').write_text(json.dumps(row,indent=1),'utf8');assert row['exit']==0+elif a.stage=='launch':+ env,p=env_for('native-'+a.mode);assert not (p/'qml-preferences.v1.json').exists(),'use a fresh test mode name'+ (p/'qml-preferences.v1.json').write_text(json.dumps(dict(language='zh-CN',autoResume=False,prewarmEnhancement=False)),'utf8')+ env['VEYRA_LOG_FILE']=str(L/('native-'+a.mode+'-engine.log'))+ if a.mode.startswith('software'):env['QT_QUICK_BACKEND']='software'+ else:env['VEYRA_UI_RHI']='d3d11'+ cmd=[str(A/'veyra_qml_ui.exe'),'--data-dir',str(p),'--page','pro','--size','1280x800','--exit-after','260000',str(B/'tests/nr-manual-scale-20261024/media/nr-1080p30.mp4')]+ if a.mode.startswith('software'):cmd.append('--obs-game-capture')+ with (L/('native-'+a.mode+'-console.log')).open('wb') as f:proc=subprocess.Popen(cmd,cwd=A,env=env,stdout=f,stderr=subprocess.STDOUT)+ (O/('native-'+a.mode+'.json')).write_text(json.dumps(dict(pid=proc.pid,command=cmd,exeSha256=sha(A/'veyra_qml_ui.exe')),ensure_ascii=False,indent=1),'utf8');print('Private UI pid',proc.pid)diff --git a/scripts/acceptance/package-capture-audio-main.py b/scripts/acceptance/package-capture-audio-main.pynew file mode 100644index 00000000..4fca6d2d--- /dev/null+++ b/scripts/acceptance/package-capture-audio-main.py@@ -0,0 +1,46 @@+"""Seal the common EXE/QML update without any runtime/model/configuration files."""+from pathlib import Path+import hashlib,json,subprocess,zipfile,shutil+B=Path('E:/项目/Veyra');T='capture-audio-main-20261025';R=Path(__file__).resolve().parents[2];O=B/'reports'/T;D=B/'build/claude-screen-recording-20261022';A=B/'tests'/T/'app';P=B/'test-packages'/T/'Veyra-2.1.0-int1-NVIDIA-AMD-update'+assert not subprocess.check_output(['git','-C',str(R),'status','--porcelain']).strip(),'commit the reviewed source first'+head=subprocess.check_output(['git','-C',str(R),'rev-parse','HEAD'],text=True).strip()+assert subprocess.check_output(['git','-C',str(R),'rev-parse','main'],text=True).strip()==head,'merge local main first'+audit=json.loads((O/'integration-audit.json').read_text('utf8'));assert audit['sourceCommit']==head and audit['mainCommit']==head and audit['testsPassed']+def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()+assert sha(D/'veyra_qml_ui.exe')==sha(A/'veyra_qml_ui.exe')==json.loads((O/'prepared.json').read_text('utf8'))['exeSha256']+assert not P.exists();P.mkdir(parents=True)+def copy(src,rel):+ dst=P/rel;dst.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(src,dst)+copy(D/'veyra_qml_ui.exe','veyra_qml_ui.exe')+for folder in ['qml','i18n']:+ for p in (R/folder).rglob('*'):+ if p.is_file():+ assert sha(A/folder/p.relative_to(R/folder))==sha(p),p+ copy(p,Path(folder)/p.relative_to(R/folder))+for name in ['CAPTURE_AUDIO_MAIN_REPORT_2026-10-25.md','EXPORT_NR_SCALE_REPORT_2026-10-25.md','FG_SCHEDULING_REPAIR_REPORT_2026-10-24.md']:copy(R/'docs'/name,Path('docs')/name)+for name in ['LICENSE','THIRD_PARTY_NOTICES.md']:copy(R/name,name)+(P/'README-INT1.zh-CN.md').write_text('''# Veyra 2.1.0-int1 本地整合更新++需要已有完整2.1.0 NVIDIA或AMD便携包。先退出播放器,再把本目录内容复制到原包根目录(veyra_qml_ui.exe所在目录)覆盖同名文件。保留原包即可回退。本更新只有共同程序/UI/说明,不含任何DLL、模型、驱动、用户配置或日志,不是完整便携包。NVIDIA和AMD使用同一个EXE,原包各自的运行组件保持原样;原package-manifest仅代表底包,更新程序身份见LOCAL_UPDATE.json。++包含:录制/AMD超分关闭、90°旋转、NR25%–100%手动比例、后台VRR查询、NR视频导出固定/百分比尺寸、#67 NR关闭生命周期、全屏按钮/Esc/播放列表键归属、采集无时戳预备样本正常接收与诊断。++CV710修复的是已确认的接收错误:缺时戳样本不再向驱动返回失败,不伪造PTS。没有CV710原卡复测,不能保证这就是原卡现场根因。若仍卡住,请保留新日志,capture-video-delivery/time能区分驱动没送视频与样本接收问题。原3090关闭问题也需原机复测。Lecram仍暂停。++本轮通过Windows构建、9个定向目标、115项QtQuick、5070真实NR切换/开启状态关闭/重开、4K37%+NVOF六帧导出、软件/GPU界面原生全屏操作。本机G50视频与48k音频仅短接收,不代表CV710或稳定60fps/长期验收。AMD新NR实卡/HDR/长期未重测,原AMD SR关/录制验证沿用对应提交证据。详见docs整合报告。++仅本地main整合,未push/Release。显示版本2.1.0-int1,不改变正式发布版本。+''','utf8')+files=[dict(path=p.relative_to(P).as_posix(),bytes=p.stat().st_size,sha256=sha(p)) for p in sorted(P.rglob('*')) if p.is_file()]+assert not any(Path(e['path']).suffix.lower() in ['.dll','.onnx','.tflite','.lib','.pdb','.hsaco','.dxil','.log'] for e in files)+(P/'LOCAL_UPDATE.json').write_text(json.dumps(dict(version='2.1.0-int1-local-update',base='Complete 2.1.0 NVIDIA or AMD portable package',sourceCommit=head,localOnly=True,releaseReady=False,containsRuntime=False,files=files),ensure_ascii=False,indent=1),'utf8')+zpath=P.parent/(P.name+'.zip');assert not zpath.exists()+with zipfile.ZipFile(zpath,'x',zipfile.ZIP_DEFLATED,compresslevel=6) as z:+ for p in P.rglob('*'):+ if p.is_file():z.write(p,p.relative_to(P).as_posix())+with zipfile.ZipFile(zpath) as z:+ assert z.testzip() is None+ for e in files:assert hashlib.sha256(z.read(e['path'])).hexdigest()==e['sha256']+row=dict(sourceCommit=head,zip=str(zpath),bytes=zpath.stat().st_size,sha256=sha(zpath),exeSha256=sha(P/'veyra_qml_ui.exe'),manifestFiles=len(files),runtimeFiles=0)+(O/'update-package.json').write_text(json.dumps(row,ensure_ascii=False,indent=1),'utf8');print(json.dumps(row,ensure_ascii=False))diff --git a/src/source/NativeCaptureSink.cpp b/src/source/NativeCaptureSink.cppindex 66e5dacf..bcb931b8 100644--- a/src/source/NativeCaptureSink.cpp+++ b/src/source/NativeCaptureSink.cpp@@ -12,12 +12,12 @@namespace veyra::source {using Microsoft::WRL::ComPtr;std::function<HRESULT(IMediaSample*)> timedCaptureDelivery(std::function<HRESULT(double,IMediaSample*)> deliver){- return [deliver=std::move(deliver),untimed=uint64_t{0}](IMediaSample* sample) mutable -> HRESULT {+ return [deliver=std::move(deliver),untimed=uint64_t{0},pending=uint64_t{0},recoveries=uint64_t{0}](IMediaSample* sample) mutable -> HRESULT {if(!sample)return E_POINTER;REFERENCE_TIME begin=0,end=0;const auto hr=sample->GetTime(&begin,&end);if(hr==VFW_E_SAMPLE_TIME_NOT_SET){- ++untimed;+ ++untimed;++pending;if(untimed==1||untimed%300==0)log::warn("capture-video-time",std::format("untimedSamples={} GetTime hr=0x{:08X} bytes={} acknowledged=1 delivered=0 (waiting for real video timestamps)",untimed,uint32_t(hr),sample->GetActualDataLength()));return S_OK;@@ -26,7 +26,12 @@ std::function<HRESULT(IMediaSample*)> timedCaptureDelivery(std::function<HRESULTlog::error("capture-video-time",std::format("GetTime hr=0x{:08X}",uint32_t(hr)));return hr;}- if(untimed){log::info("capture-video-time",std::format("timed video resumed after {} untimed samples firstPts100ns={} fabricatedPts=0",untimed,begin));untimed=0;}+ if(pending){+ ++recoveries;+ if(recoveries==1||recoveries%300==0)+ log::info("capture-video-time",std::format("timed video resumed after {} untimed samples firstPts100ns={} recoveries={} fabricatedPts=0",pending,begin,recoveries));+ pending=0;+ }return deliver(double(begin)/1e7,sample);};}@@ -90,6 +95,7 @@ class NativeSink final:public IBaseFilter,public IPin,public IMemInputPin,publicstd::function<HRESULT(IMediaSample*)> callback_;bool audio_=false;bool compressed_=false;+ uint64_t videoSamples_=0;CaptureAllocatorMode allocatorMode_=CaptureAllocatorMode::SinkDefault;public:NativeSink(const AM_MEDIA_TYPE& type,std::function<HRESULT(IMediaSample*)> cb,bool compressed=false,CaptureAllocatorMode allocatorMode=CaptureAllocatorMode::SinkDefault):callback_(std::move(cb)),allocatorMode_(allocatorMode){@@ -181,6 +187,10 @@ public:// remaining hold covers only validation and pointer publication.HRESULT STDMETHODCALLTYPE Receive(IMediaSample* sample)override{if(!sample)return E_POINTER;std::lock_guard lock(mutex_);if(flushing_)return S_FALSE;if(state_==State_Stopped)return VFW_E_WRONG_STATE;+ if(!audio_&&videoSamples_++<3){+ REFERENCE_TIME begin=0,end=0;const auto timeHr=sample->GetTime(&begin,&end);+ log::info("capture-video-delivery",std::format("sample={} bytes={} GetTime hr=0x{:08X} start100ns={} end100ns={} compressed={}",videoSamples_,sample->GetActualDataLength(),uint32_t(timeHr),begin,end,compressed_));+ }// A device mode change needs full source/graph recreation, never a// silent reinterpretation using the previous frame's pitch/format.AM_MEDIA_TYPE* changed=nullptr;const auto typeHr=sample->GetMediaType(&changed);diff --git a/tests/qml/QuickSmokeTests.cpp b/tests/qml/QuickSmokeTests.cppindex 8e8541aa..dcb0d7b2 100644--- a/tests/qml/QuickSmokeTests.cpp+++ b/tests/qml/QuickSmokeTests.cpp@@ -9,11 +9,30 @@#include <QQmlComponent>#include <QtQml/qqml.h>#include <QtQuickTest/quicktest.h>+#include <QGuiApplication>+#include <QTest>++// Quick Test's keyClick targets its QQuickView host. Multi-window ownership+// tests need events delivered to the actual focused QML Window instead.+class ActiveWindowKeys : public QObject {+ Q_OBJECT+public:+ using QObject::QObject;+ Q_INVOKABLE bool focused(QObject* window) { return QGuiApplication::focusWindow() == window; }+ Q_INVOKABLE bool press(int key) {+ auto* window = QGuiApplication::focusWindow();+ if (!window) return false;+ QTest::keyClick(window, Qt::Key(key));+ QCoreApplication::processEvents();+ return true;+ }+};class Setup : public QObject {Q_OBJECTpublic slots:void qmlEngineAvailable(QQmlEngine* engine) {+ engine->rootContext()->setContextProperty(QStringLiteral("testWindowKeys"), new ActiveWindowKeys(engine));engine->rootContext()->setContextProperty(QStringLiteral("exportTestOutputDirectory"),qEnvironmentVariable("VEYRA_EXPORT_TEST_ARTIFACTS"));engine->addImportPath(QDir(QCoreApplication::applicationDirPath()).filePath(QStringLiteral("qml")));// The registered inline NR card has the engine's creation context,diff --git a/tests/qml/quick/tst_playlist_shortcuts.qml b/tests/qml/quick/tst_playlist_shortcuts.qmlnew file mode 100644index 00000000..d767e81a--- /dev/null+++ b/tests/qml/quick/tst_playlist_shortcuts.qml@@ -0,0 +1,104 @@+import QtQuick+import QtQuick.Window+import QtTest++Item {+ Window {+ id: ownerWindow+ visible: true+ width: 800; height: 650+ Item {+ id: root+ width: 800; height: 650+ property var playlistWindow: null+ property int ownerEscapes: 0+ property int ambiguousEscapes: 0++ ListModel {+ id: playlist+ property bool busy: false+ property int sortMode: 0+ property int currentIndex: -1+ property int removed: 0+ property int played: 0+ property bool playing: false+ property bool autoAdvance: false+ signal error(string text)+ function indexOfPath(path) { return path === "selected.mp4" ? 0 : -1 }+ function remove(row) { ++removed }+ function play(row) { ++played }+ }+ // Same ownership as Main.qml: the main window handles Escape, except+ // while the independent playlist owns focus.+ Shortcut {+ sequence: "Escape"+ onActivated: ++root.ownerEscapes+ onActivatedAmbiguously: ++root.ambiguousEscapes+ }+ TestCase {+ name: "PlaylistShortcutOwnership"+ when: windowShown+ function initTestCase() {+ // The production test runner resolves all QML from its staging tree.+ const component = Qt.createComponent("../qml/Veyra/PlaylistWindow.qml")+ compare(component.status, Component.Ready, component.errorString())+ root.playlistWindow = component.createObject(root, {+ owner: ownerWindow,+ playlist: playlist, selectedPath: "selected.mp4"+ })+ verify(root.playlistWindow !== null)+ }+ function cleanupTestCase() { root.playlistWindow.destroy(); root.playlistWindow = null; ownerWindow.hide() }+ function init() {+ verify(root.Window.window !== null)+ compare(root.playlistWindow.owner, ownerWindow)+ root.playlistWindow.hide()+ ownerWindow.requestActivate()+ tryCompare(ownerWindow, "active", true)+ tryVerify(function() { return testWindowKeys.focused(ownerWindow) })+ root.ownerEscapes = 0; root.ambiguousEscapes = 0+ playlist.removed = 0; playlist.played = 0+ }+ function test_hidden_playlist_does_not_steal_keys() {+ verify(testWindowKeys.press(Qt.Key_Escape))+ tryCompare(root, "ownerEscapes", 1)+ compare(root.ambiguousEscapes, 0)+ verify(testWindowKeys.press(Qt.Key_Delete))+ verify(testWindowKeys.press(Qt.Key_Return))+ compare(playlist.removed, 0)+ compare(playlist.played, 0)+ }+ function test_visible_inactive_playlist_does_not_steal_keys() {+ root.playlistWindow.open()+ tryCompare(root.playlistWindow, "active", true)+ tryVerify(function() { return testWindowKeys.focused(root.playlistWindow) })+ ownerWindow.requestActivate()+ tryCompare(ownerWindow, "active", true)+ tryVerify(function() { return testWindowKeys.focused(ownerWindow) })+ verify(root.playlistWindow.visible)+ verify(testWindowKeys.press(Qt.Key_Escape))+ tryCompare(root, "ownerEscapes", 1)+ compare(root.ambiguousEscapes, 0)+ verify(root.playlistWindow.visible)+ verify(testWindowKeys.press(Qt.Key_Delete))+ verify(testWindowKeys.press(Qt.Key_Return))+ compare(playlist.removed, 0)+ compare(playlist.played, 0)+ }+ function test_active_playlist_keeps_its_keys() {+ root.playlistWindow.open()+ tryCompare(root.playlistWindow, "active", true)+ tryVerify(function() { return testWindowKeys.focused(root.playlistWindow) })+ verify(testWindowKeys.press(Qt.Key_Delete))+ verify(testWindowKeys.press(Qt.Key_Return))+ tryCompare(playlist, "removed", 1)+ tryCompare(playlist, "played", 1)+ verify(testWindowKeys.press(Qt.Key_Escape))+ tryCompare(root.playlistWindow, "visible", false)+ compare(root.ownerEscapes, 0)+ compare(root.ambiguousEscapes, 0)+ }+ }+ }+ }+}