@@ -17,9 +17,6 @@ COMMIT_ 04fe818fc703d8c5dcc3a6aabe1caeed8286bdbb
17
17
<KEY> script-binding load_plus/append_aid # 追加其它音轨(不切换)
18
18
<KEY> script-binding load_plus/append_sid # 追加其它字幕(切换)
19
19
20
- <KEY> script-binding load_plus/append_vfSub # 装载次字幕(滤镜型)
21
- <KEY> script-binding load_plus/toggle_vfSub # 隐藏/显示 当前的次字幕(滤镜型)
22
- <KEY> script-binding load_plus/remove_vfSub # 移除次字幕(滤镜型)
23
20
]]
24
21
25
22
local msg = require " mp.msg"
@@ -530,56 +527,6 @@ function append_sid()
530
527
end
531
528
end
532
529
533
- function append_vfSub ()
534
- local was_ontop = mp .get_property_native (" ontop" )
535
- if was_ontop then mp .set_property_native (" ontop" , false ) end
536
- local res = utils .subprocess ({
537
- args = {' powershell' , ' -NoProfile' , ' -Command' , [[ & {
538
- Trap {
539
- Write-Error -ErrorRecord $_
540
- Exit 1
541
- }
542
- Add-Type -AssemblyName PresentationFramework
543
- $u8 = [System.Text.Encoding]::UTF8
544
- $out = [Console]::OpenStandardOutput()
545
- $ofd = New-Object -TypeName Microsoft.Win32.OpenFileDialog
546
- $ofd.Multiselect = $false
547
- If ($ofd.ShowDialog() -eq $true) {
548
- ForEach ($filename in $ofd.FileNames) {
549
- $u8filename = $u8.GetBytes("$filename")
550
- $out.Write($u8filename, 0, $u8filename.Length)
551
- }
552
- }
553
- }]] },
554
- cancellable = false ,
555
- })
556
- if was_ontop then mp .set_property_native (" ontop" , true ) end
557
- if (res .status ~= 0 ) then return end
558
- for filename in string.gmatch (res .stdout , ' [^\n ]+' ) do
559
- local vfSub = " vf append ``@LUA-load_plus:subtitles=filename=\" " .. res .stdout .. " \" ``"
560
- mp .command (vfSub )
561
- end
562
- end
563
-
564
- function filter_state (label , key , value )
565
- local filters = mp .get_property_native (" vf" )
566
- for _ , filter in pairs (filters ) do
567
- if filter [" label" ] == label and (not key or key and filter [key ] == value ) then
568
- return true
569
- end
570
- end
571
- return false
572
- end
573
-
574
- function toggle_vfSub ()
575
- local vfSub = " vf toggle @LUA-load_plus"
576
- if filter_state (" LUA-load_plus" ) then mp .command (vfSub ) end
577
- end
578
-
579
- function remove_vfSub ()
580
- local vfSub = " vf remove @LUA-load_plus"
581
- if filter_state (" LUA-load_plus" ) then mp .command (vfSub ) end
582
- end
583
530
584
531
585
532
mp .register_event (" end-file" , remove_vfSub )
@@ -590,6 +537,3 @@ mp.add_key_binding(nil, "import_files", import_files)
590
537
mp .add_key_binding (nil , " import_url" , import_url )
591
538
mp .add_key_binding (nil , " append_aid" , append_aid )
592
539
mp .add_key_binding (nil , " append_sid" , append_sid )
593
- mp .add_key_binding (nil , " append_vfSub" , append_vfSub )
594
- mp .add_key_binding (nil , " toggle_vfSub" , toggle_vfSub )
595
- mp .add_key_binding (nil , " remove_vfSub" , remove_vfSub )
0 commit comments