Skip to content

Commit

Permalink
脚本: 移除 contextmenu_gui
Browse files Browse the repository at this point in the history
原先的原生菜单构建辅助脚本 menu_dyn 改名为 contextmenu_plus ;
增加此脚本对应的示例语法文件 input_contextmenu_plus.conf

如果需要独立于mpv窗口外的图形菜单,推荐改用原生的上下文菜单功能,否则建议使用uosc的osd菜单。

close #60
  • Loading branch information
hooke007 committed Aug 14, 2024
1 parent ccda13d commit 5c26025
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 2,158 deletions.
30 changes: 30 additions & 0 deletions portable_config/input_contextmenu_plus.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
##⇘⇘此文件仅展示 contextmenu_plus (mpv内建菜单的辅助脚本) 的上下文菜单的对应语法
##如不采用辅助脚本,而使用原始的菜单构建方法(自编辑脚本来实现),参见 https://mpv.io/manual/master/#command-interface-menu-data

# ignore #! ⇲ 轨道列表(聚合) > #@tracks
# ignore #! ⇲ 播放列表 > #@playlist
# playlist-shuffle #! 导航 > 播放列表乱序重排
# ignore #! 导航 > ⇲ 版本列表 > #@editions
# ignore #! 导航 > ⇲ 章节列表 > #@chapters
# ignore #! 导航 > ⇲ 视频轨列表 > #@tracks/video
# ignore #! 导航 > ⇲ 音频轨列表 > #@tracks/audio
# ignore #! 导航 > ⇲ 字幕轨列表 > #@tracks/sub
# ignore #! 导航 > ⇲ 次字幕轨列表 > #@tracks/sub-secondary

# screenshot video #! 截屏
# screenshot window #! 截屏(窗口)

# cycle-values hwdec "auto" "auto-copy" "no" #! 视频 > 切换 解码模式
# cycle deband #! 视频 > 切换 去色带状态
# cycle deinterlace #! 视频 > 切换 去隔行状态
# cycle icc-profile-auto #! 视频 > 切换 自动校色
# cycle correct-pts #! 视频 > 切换 时间码解析模式

# script-binding display-stats-toggle #! 工具 > 常驻显示统计信息
# script-binding console/enable #! 工具 > 显示控制台
# cycle border #! 工具 > 切换 窗口边框
# cycle ontop #! 工具 > 切换 窗口置顶
# ignore #! 工具 > ⇲ 音频输出设备列表 > #@audio-devices

# stop #! 停止
# quit #! 退出mpv
106 changes: 11 additions & 95 deletions portable_config/script-opts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -201,102 +201,18 @@



#########################
# 图形化上下文菜单 [组] #
#########################

##滤镜/着色器条目示例(这部分的实现很粗糙,可能存在语法冲突):
## **B是显示在按钮左侧的文本
## **D是执行的命令
## **G是控制点击后是否再次弹出菜单

script-opts-append = contextmenu_gui-filter01B=开/关 mvtools补帧方案一
script-opts-append = contextmenu_gui-filter01D=vf toggle vapoursynth="~~/vs/MEMC_MVT_LQ.vpy"
script-opts-append = contextmenu_gui-filter01G=no

script-opts-append = contextmenu_gui-filter02B=开/关 mvtools补帧方案二
script-opts-append = contextmenu_gui-filter02D=vf toggle vapoursynth="~~/vs/MEMC_MVT_STD.vpy"
script-opts-append = contextmenu_gui-filter02G=no

script-opts-append = contextmenu_gui-filter03B=开/关 svpflow补帧方案一
script-opts-append = contextmenu_gui-filter03D=vf toggle vapoursynth="~~/vs/MEMC_SVP_LQ.vpy"
script-opts-append = contextmenu_gui-filter03G=no

script-opts-append = contextmenu_gui-filter04B=开/关 svpflow补帧方案二
script-opts-append = contextmenu_gui-filter04D=vf toggle vapoursynth="~~/vs/MEMC_SVP_PRO.vpy"
script-opts-append = contextmenu_gui-filter04G=no

script-opts-append = contextmenu_gui-filter05B=开/关 rife补帧
script-opts-append = contextmenu_gui-filter05D=vf toggle vapoursynth="~~/vs/MEMC_RIFE_STD.vpy"
script-opts-append = contextmenu_gui-filter05G=no

script-opts-append = contextmenu_gui-filter06B=开/关 标记动态范围为有限
script-opts-append = contextmenu_gui-filter06D=vf toggle format=colorlevels=limited
script-opts-append = contextmenu_gui-filter06G=no

script-opts-append = contextmenu_gui-filter07B=开/关 填充16:9的黑边并居中
script-opts-append = contextmenu_gui-filter07D=vf toggle pad=aspect=16/9:x=-1:y=-1
script-opts-append = contextmenu_gui-filter07G=no

script-opts-append = contextmenu_gui-filter08B=开/关 画面旋转180°
script-opts-append = contextmenu_gui-filter08D=vf toggle rotate=angle=180*PI/180
script-opts-append = contextmenu_gui-filter08G=no

script-opts-append = contextmenu_gui-filter09B=开/关 画面垂直翻转
script-opts-append = contextmenu_gui-filter09D=vf toggle vflip
script-opts-append = contextmenu_gui-filter09G=no

script-opts-append = contextmenu_gui-filter10B=开/关 画面水平翻转
script-opts-append = contextmenu_gui-filter10D=vf toggle hflip
script-opts-append = contextmenu_gui-filter10G=no


script-opts-append = contextmenu_gui-shader01B=开/关 单项:KrigBilateral
script-opts-append = contextmenu_gui-shader01D=change-list glsl-shaders toggle "~~/shaders/KrigBilateral.glsl"
script-opts-append = contextmenu_gui-shader01G=no

script-opts-append = contextmenu_gui-shader02B=开/关 单项:AMD_FSR
script-opts-append = contextmenu_gui-shader02D=change-list glsl-shaders toggle "~~/shaders/AMD_FSR.glsl"
script-opts-append = contextmenu_gui-shader02G=no

script-opts-append = contextmenu_gui-shader03B=开/关 单项:ravu_zoom_r2_ddx
script-opts-append = contextmenu_gui-shader03D=change-list glsl-shaders toggle "~~/shaders/ravu_zoom_r2_ddx.glsl"
script-opts-append = contextmenu_gui-shader03G=no

script-opts-append = contextmenu_gui-shader04B=开/关 单项:Anime4K_Restore_CNN_M
script-opts-append = contextmenu_gui-shader04D=change-list glsl-shaders toggle "~~/shaders/Anime4K_Restore_CNN_M.glsl"
script-opts-append = contextmenu_gui-shader04G=no

script-opts-append = contextmenu_gui-shader05B=开/关 单项:Anime4K_Upscale_GAN_x2_M
script-opts-append = contextmenu_gui-shader05D=change-list glsl-shaders toggle "~~/shaders/Anime4K_Upscale_GAN_x2_M.glsl"
script-opts-append = contextmenu_gui-shader05G=no

script-opts-append = contextmenu_gui-shader06B=开/关 单项:FSRCNNX_x2_8_0_4_1
script-opts-append = contextmenu_gui-shader06D=change-list glsl-shaders toggle "~~/shaders/FSRCNNX_x2_8_0_4_1.glsl"
script-opts-append = contextmenu_gui-shader06G=no

script-opts-append = contextmenu_gui-shader07B=开/关 单项:adaptive_sharpen
script-opts-append = contextmenu_gui-shader07D=change-list glsl-shaders toggle "~~/shaders/adaptive_sharpen.glsl"
script-opts-append = contextmenu_gui-shader07G=no

script-opts-append = contextmenu_gui-shader08B=开/关 单项:nnedi3_nns64_win8x4
script-opts-append = contextmenu_gui-shader08D=change-list glsl-shaders toggle "~~/shaders/nnedi3_nns64_win8x4.glsl"
script-opts-append = contextmenu_gui-shader08G=no

script-opts-append = contextmenu_gui-shader09B=清理并依次挂载 组合:Anime4k的"DTDD"
script-opts-append = contextmenu_gui-shader09D=change-list glsl-shaders set "~~/shaders/Anime4K_Darken_HQ.glsl;~~/shaders/Anime4K_Thin_HQ.glsl;~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl;~~/shaders/Anime4K_Deblur_DoG.glsl"
script-opts-append = contextmenu_gui-shader09G=no

script-opts-append = contextmenu_gui-shader10B=清理并依次挂载 组合:双SSIM
script-opts-append = contextmenu_gui-shader10D=change-list glsl-shaders set "~~/shaders/SSimSuperRes.glsl;~~/shaders/SSimDownscaler.glsl"
script-opts-append = contextmenu_gui-shader10G=no

######################
# 上下文菜单构建辅助 #
######################

script-opts-append = contextmenu_gui_engine-tcltkBin=tclsh
# tcl/tk的目标路径,以不带扩展名的文件名作结尾。可以使用绝对路径
script-opts-append = contextmenu_gui_engine-fontFace=微软雅黑
# 绘制菜单GUI时使用的字体(默认 微软雅黑)
script-opts-append = contextmenu_gui_engine-fontSize=10 # 绘制菜单GUI时使用的字体大小(默认 10)
script-opts-append = contextmenu_plus-use_mpv_impl=yes # 是否启用mpv的原生菜单功能,默认 yes
script-opts-append = contextmenu_plus-input_conf=default
# 使用默认的 input.conf 文件作为菜单构建文件,默认 default ,或者手动指定其它文件
script-opts-append = contextmenu_plus-uosc_syntax=yes # 是否启用类uosc的语法(不会占用某个快捷键位),默认 yes
script-opts-append = contextmenu_plus-uosc_alt=no # 是否启用uosc作为个别功能的回退,默认 no
script-opts-append = contextmenu_plus-escape_title=yes # 是否启用标题转义,默认 yes
script-opts-append = contextmenu_plus-max_title_length=40 # 限制标题显示的字符数,0 为禁用,默认 40
script-opts-append = contextmenu_plus-max_playlist_items=20 # 限制播放列表显示的项目数,0 为禁用,默认 20



Expand Down
88 changes: 0 additions & 88 deletions portable_config/script-opts/contextmenu_gui.conf

This file was deleted.

9 changes: 0 additions & 9 deletions portable_config/script-opts/contextmenu_gui_engine.conf

This file was deleted.

20 changes: 20 additions & 0 deletions portable_config/script-opts/contextmenu_plus.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
###不支持参数后注释,须另起一行
###不允许选项和值之间存在多余的空格

# 是否启用mpv的原生菜单功能,默认 yes
use_mpv_impl=yes

# 使用默认的 input.conf 文件作为菜单构建文件,默认 default ,或者手动指定其它文件
input_conf=default

# 是否启用类uosc的语法(不会占用某个快捷键位),默认 yes
uosc_syntax=yes
# 是否启用uosc作为个别功能的回退,默认 no
uosc_alt=no

# 是否启用标题转义,默认 yes
escape_title=yes
# 限制标题显示的字符数,0 为禁用,默认 40
max_title_length=40
# 限制播放列表显示的项目数,0 为禁用,默认 20
max_playlist_items=20
Loading

0 comments on commit 5c26025

Please sign in to comment.