Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27dc98af21 | ||
|
|
ce12eb61fd | ||
|
|
8ed62df8e2 | ||
|
|
f4b4be5466 | ||
|
|
9a33bea7e7 | ||
|
|
3f469897b0 | ||
|
|
1aa380f768 | ||
|
|
b0c3988a9d | ||
|
|
8c02bb59ee | ||
|
|
d60bf050cf | ||
|
|
a0f2e8bd92 | ||
|
|
63db623d07 | ||
|
|
ab0b2c4da2 | ||
|
|
091e159d10 | ||
|
|
91fa89b058 |
@@ -1,9 +1,31 @@
|
||||
|
||||
5.8.0.0 Beta (2022-04-02)
|
||||
|
||||
- Fix crash on Windows 7 systems without PowerShell.
|
||||
- Fix showing incorrect timestamps in About dialog of Store version.
|
||||
- Fix Store page showing non existant ARM and x86 support.
|
||||
- Fix opening zip files.
|
||||
- The list of available input commands is like before shown
|
||||
by the text editor, so it's like everything else searchable.
|
||||
- Media Info isn't shown directly, instead the command palette
|
||||
shows several choices. The command palette can be bypassed
|
||||
using the arguments: msgbox, editor, full, raw.
|
||||
https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#show-media-info-flags
|
||||
- mpv.net specific commands, the command palette, auto-play property
|
||||
and various other things are documented in the manual.
|
||||
- The action used for the right mouse button can be configured.
|
||||
https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#show-menu
|
||||
- Workaround not reproducible logo drawing crash.
|
||||
- Info command shows the length.
|
||||
- New mpv.net specific option `show-logo` that allows to disable
|
||||
the drawing of the blue mpv.net logo ontop of the native OSC logo.
|
||||
- MediaInfo 22.03
|
||||
|
||||
|
||||
5.7.0.0 Stable (2022-03-09)
|
||||
|
||||
- Improved title and chapter menu for Blu-Rays.
|
||||
- Fix of conf folder virtualization issue of MS Store version.
|
||||
- MS Store page no longer displays ARM and x86 support.
|
||||
|
||||
5.6.2.0 Beta (2022-03-05)
|
||||
|
||||
|
||||
241
docs/Manual.md
241
docs/Manual.md
@@ -13,8 +13,10 @@ Table of contents
|
||||
* [Support](#support)
|
||||
* [Settings](#settings)
|
||||
* [Input and context menu](#input-and-context-menu)
|
||||
* [Command Palette](#command-palette)
|
||||
* [Command Line Interface](#command-line-interface)
|
||||
* [Terminal](#terminal)
|
||||
* [mpv.net specific commands](#mpvnet-specific-commands)
|
||||
* [mpv.net specific options](#mpvnet-specific-options)
|
||||
* [External Tools](#external-tools)
|
||||
* [Scripting](#scripting)
|
||||
@@ -57,7 +59,9 @@ Installation
|
||||
|
||||
mpv.net requires the .NET Framework 4.8 and Windows 7 or higher and a modern graphics card.
|
||||
|
||||
For internet streaming yt-dlp must be downloaded and installed manually.
|
||||
For internet streaming from YouTube and similar sites, yt-dlp must be
|
||||
copied into the mpv.net folder or the user environment variable PATH
|
||||
must be edited to include the yt-dlp folder.
|
||||
|
||||
#### File Associations
|
||||
|
||||
@@ -80,7 +84,7 @@ the files are opened in mpv.net in random order, this works with maximum 15 file
|
||||
Support
|
||||
-------
|
||||
|
||||
Before making a support request, please try a newer beta version first.
|
||||
Before making a support request, please try the newest version first.
|
||||
|
||||
Bugs and feature requests can be made on the github [issue tracker](../../../issues),
|
||||
feel free to use for anything mpv.net related, usage questions are welcome.
|
||||
@@ -105,9 +109,7 @@ Input and context menu
|
||||
----------------------
|
||||
|
||||
The input (key/mouse) bindings and the context menu definitions are stored in the
|
||||
input.conf file, if it's missing mpv.net generates it with the following defaults:
|
||||
|
||||
[input.conf defaults](../../../tree/master/src/Resources/input.conf.txt)
|
||||
input.conf file, if it's missing mpv.net generates it with default values.
|
||||
|
||||
Please be aware that once input.conf exists, mpv.net cannot update it, this means
|
||||
the menu becomes outdated when mpv.net is updated with new or changed default menu
|
||||
@@ -137,6 +139,37 @@ https://mpv.io/manual/master/#list-of-input-commands
|
||||
mpv input options:
|
||||
https://mpv.io/manual/master/#input
|
||||
|
||||
|
||||
Command Palette
|
||||
---------------
|
||||
|
||||
The command palette is designed to quickly find,
|
||||
select and execute commands.
|
||||
|
||||
It can also be used to easily find shortcut keys.
|
||||
|
||||
The following functionality is presented with the Command Palette:
|
||||
|
||||
- Show media info in different ways.
|
||||
- Show and select audio tracks.
|
||||
- Show and select subtitle tracks.
|
||||
- Show and select playlist files.
|
||||
- Show and select recent files.
|
||||
- Show available mpv properties.
|
||||
- Show available decoders.
|
||||
- Show available demuxers.
|
||||
- Show available keys.
|
||||
- Show available protocols.
|
||||
|
||||
| Key | Action |
|
||||
| ------ | --------------------------- |
|
||||
| F1 | Shows the command palette. |
|
||||
| Escape | Hides the command palette. |
|
||||
| Enter | Executes the selected item. |
|
||||
| Up | Moves the selection up. |
|
||||
| Down | Moves the selection down. |
|
||||
|
||||
|
||||
Command Line Interface
|
||||
----------------------
|
||||
|
||||
@@ -162,12 +195,12 @@ Supported are all mpv properties, they are documented here:
|
||||
https://mpv.io/manual/master/#properties
|
||||
|
||||
|
||||
mpv.net has a feature to list all properties:
|
||||
mpv.net has a feature to list all available properties:
|
||||
|
||||
_Context Menu > View > Show Properties_
|
||||
_Context Menu > View > Advanced > Show Properties_
|
||||
|
||||
|
||||
Non property switches are generally not supported in mpv.net!
|
||||
mpv has a few non property based switches which are generally not supported in mpv.net.
|
||||
|
||||
|
||||
Terminal
|
||||
@@ -176,12 +209,155 @@ Terminal
|
||||
When mpv.net is started from a terminal it will output status,
|
||||
error and debug messages to the terminal and accept input keys from the terminal.
|
||||
|
||||
In the context menu under _Tools > Setup_ a button can be found to add
|
||||
mpv.net to the path environment variable.
|
||||
|
||||
A common task for the terminal is debugging scripts.
|
||||
|
||||
|
||||
mpv.net specific commands
|
||||
-------------------------
|
||||
|
||||
`script-message mpv.net <command> <arguments>`
|
||||
|
||||
mpv.net commands are used when mpv commands don't exist or lack a feature.
|
||||
|
||||
### cycle-audio
|
||||
Switches to the next audio track and shows info about that track.
|
||||
|
||||
### load-audio
|
||||
Shows a file browser dialog to open external audio files.
|
||||
|
||||
### load-sub
|
||||
Shows a file browser dialog to open external subtitle files.
|
||||
|
||||
### open-conf-folder
|
||||
Opens the config folder with Windows File Explorer.
|
||||
|
||||
### open-files [\<flags\>]
|
||||
**no-folder**
|
||||
For single files prevents loading the complete folder into the playlist.
|
||||
|
||||
**append**
|
||||
Appends files to the playlist.
|
||||
|
||||
Opens a file browser dialog in order to select files to be opened.
|
||||
The file browser dialog supports multiselect to load multiple files
|
||||
at once. Pressing CTRL appends the files to the playlist.
|
||||
|
||||
### open-optical-media
|
||||
Shows a folder browser dialog to open a DVD or BD folder.
|
||||
ISO images don't have to be mounted, but instead can be
|
||||
opened directly with the open-files command.
|
||||
|
||||
### open-clipboard
|
||||
Opens a single URL or filepath from the clipboard,
|
||||
or multiple files in the file clipboard format.
|
||||
|
||||
### play-pause
|
||||
Cycles the pause property. In case the playlist is empty,
|
||||
the most recent file from the recent files list is loaded.
|
||||
|
||||
### playlist-first
|
||||
Jumps to the first playlist entry, if the loaded file is
|
||||
already the first entry, nothing happens.
|
||||
|
||||
### playlist-last
|
||||
Jumps to the last playlist entry, if the loaded file is
|
||||
already the last entry, nothing happens.
|
||||
|
||||
### reg-file-assoc \<audio|video|image\>
|
||||
Registers the file associations.
|
||||
|
||||
### scale-window \<factor\>
|
||||
Decreases or increases the Window size.
|
||||
|
||||
### shell-execute \<file|URL\>
|
||||
Shell executes a single file or URL.
|
||||
|
||||
### show-about
|
||||
Shows the about dialog.
|
||||
|
||||
### show-audio-devices
|
||||
Shows available audio devices in a message box.
|
||||
|
||||
### show-audio-tracks
|
||||
Shows available audio tracks in the command palette
|
||||
and allows to load the selected audio track.
|
||||
|
||||
### show-command-palette
|
||||
Shows the command palette.
|
||||
|
||||
### show-commands
|
||||
Shows available mpv imput commands.
|
||||
|
||||
### show-conf-editor
|
||||
Shows the conf editor.
|
||||
|
||||
### show-decoders
|
||||
Shows available decoders.
|
||||
|
||||
### show-demuxers
|
||||
Shows available demuxers.
|
||||
|
||||
### show-history
|
||||
|
||||
Shows the history file when existing.
|
||||
|
||||
### show-info
|
||||
Shows a simple file info.
|
||||
|
||||
### show-input-editor
|
||||
Shows the input editor.
|
||||
|
||||
### show-keys
|
||||
Shows available keys (as shown with `--input-keylist`) in the command palette.
|
||||
|
||||
### show-media-info [\<flags\>]
|
||||
**msgbox**
|
||||
Shows media info in a messsge box.
|
||||
|
||||
**editor**
|
||||
Shows media info in the text editor.
|
||||
|
||||
**full**
|
||||
Shows fully detailed media info.
|
||||
|
||||
**raw**
|
||||
Shows media info with raw property names.
|
||||
|
||||
### show-menu
|
||||
Shows the context menu.
|
||||
|
||||
### show-playlist
|
||||
Shows the playlist in the command palette
|
||||
and allows to play the selected entry.
|
||||
|
||||
### show-profiles
|
||||
Shows available profiles with a message box.
|
||||
|
||||
### show-progress
|
||||
Shows a simple OSD progress message.
|
||||
|
||||
### show-properties
|
||||
Shows available properties in the command palette and
|
||||
allows to display the property value of the selected property.
|
||||
|
||||
### show-protocols
|
||||
Shows available protocols in the command palette.
|
||||
|
||||
### show-recent
|
||||
Shows recently played files and URLs in the
|
||||
command palette and allows to select and play entries.
|
||||
|
||||
### show-subtitle-tracks
|
||||
Shows available subtitles in the command palette
|
||||
and allows to activate the selected subtitle.
|
||||
|
||||
### show-text \<text\> \<duration\> \<font-size\>
|
||||
Shows a OSD message with given text, duration and font size.
|
||||
|
||||
### window-scale \<factor\>
|
||||
Works similar as the [window-scale](https://mpv.io/manual/master/#command-interface-window-scale) mpv property.
|
||||
|
||||
|
||||
mpv.net specific options
|
||||
------------------------
|
||||
|
||||
@@ -233,21 +409,18 @@ Window size is remembered in the current session.
|
||||
**always**
|
||||
Window size is always remembered.
|
||||
|
||||
|
||||
#### --start-threshold=\<milliseconds\>
|
||||
|
||||
Threshold in milliseconds to wait for libmpv returning the video
|
||||
resolution before the window is shown, otherwise default dimensions
|
||||
are used as defined by autofit and start-size. Default: 1500
|
||||
|
||||
|
||||
#### --minimum-aspect-ratio=\<float\>
|
||||
|
||||
Minimum aspect ratio, if the AR is smaller than the defined value then
|
||||
the window AR is set to 16/9. This avoids a square window for Music
|
||||
with cover art. Default: 1.2
|
||||
|
||||
|
||||
#### --remember-window-position=\<yes|no\>
|
||||
|
||||
Save the window position on exit. Default: no
|
||||
@@ -260,6 +433,11 @@ Save the window position on exit. Default: no
|
||||
For single files automatically load the entire directory into the playlist.
|
||||
Can be suppressed via shift key. Default: yes
|
||||
|
||||
#### --auto-play=\<yes|no\>
|
||||
|
||||
If the player is paused and another file is loaded,
|
||||
playback automatically resumes.
|
||||
|
||||
|
||||
### General
|
||||
|
||||
@@ -280,27 +458,22 @@ Force a single process everytime the shell starts mpv.net. Default
|
||||
**queue**
|
||||
Force a single process and add files to playlist.
|
||||
|
||||
|
||||
#### --recent-count=\<int\>
|
||||
|
||||
Amount of recent files to be remembered. Default: 15
|
||||
|
||||
|
||||
#### --video-file-extensions=\<string\>
|
||||
|
||||
Video file extensions used to create file associations and used by the auto-load-folder feature.
|
||||
|
||||
|
||||
#### --audio-file-extensions=\<string\>
|
||||
|
||||
Audio file extensions used to create file associations and used by the auto-load-folder feature.
|
||||
|
||||
|
||||
#### --image-file-extensions=\<string\>
|
||||
|
||||
Image file extensions used to create file associations and used by the auto-load-folder feature.
|
||||
|
||||
|
||||
#### --debug-mode=\<yes|no\>
|
||||
|
||||
Enable this only when a developer asks for it. Default: no
|
||||
@@ -320,20 +493,23 @@ Available on Windows 10 or higher.
|
||||
|
||||
**never**
|
||||
|
||||
|
||||
#### ---dark-theme=\<string\>
|
||||
#### --dark-theme=\<string\>
|
||||
|
||||
Color theme used in dark mode. Default: dark
|
||||
|
||||
[Color Themes](#color-theme)
|
||||
|
||||
|
||||
#### --light-theme=\<string\>
|
||||
|
||||
Color theme used in light mode. Default: light
|
||||
|
||||
[Color Themes](#color-theme)
|
||||
|
||||
#### --show-logo=\<yes|no\>
|
||||
|
||||
Draws the blue mpv.net logo ontop of the native OSC logo.
|
||||
Changes take effect after application restart. Default: yes
|
||||
|
||||
|
||||
External Tools
|
||||
--------------
|
||||
@@ -384,6 +560,16 @@ My primary remote control solution however is a One For All Contour URC1210
|
||||
using Philips code 0556 together with FLIRC USB (gen2).
|
||||
|
||||
|
||||
### External Application Button
|
||||
|
||||
Videos can be streamed or downloaded easily with the Chrome extension
|
||||
External Application Button, for download (recommended):
|
||||
|
||||
path: `wt`
|
||||
|
||||
args: `-- pwsh -NoLogo -Command "yt-dlp --ignore-errors --download-archive 'C:\External Application Button.txt' --output 'C:\YouTube\%(channel)s - %(title)s.%(ext)s' ('[HREF]' -replace '&list=.+','')"`
|
||||
|
||||
|
||||
Scripting
|
||||
---------
|
||||
|
||||
@@ -395,14 +581,17 @@ Location: `<config folder>\scripts`
|
||||
|
||||
The Lua script host is built into libmpv.
|
||||
|
||||
There is no debugging support, only error and debug messages printed on the terminal.
|
||||
Error and debug messages are printed on the terminal.
|
||||
|
||||
Lua scripts are loaded before the first media file loads.
|
||||
|
||||
[mpv Lua documentation](https://mpv.io/manual/master/#lua-scripting)
|
||||
|
||||
[mpv user scripts](https://github.com/mpv-player/mpv/wiki/User-Scripts)
|
||||
[mpv user scripts in the wiki](https://github.com/mpv-player/mpv/wiki/User-Scripts)
|
||||
|
||||
[mpv user scripts on GitHub](https://github.com/topics/mpv-script)
|
||||
|
||||
[mpv user scripts found by Google](https://www.google.com/search?q=mpv+script)
|
||||
|
||||
#### JavaScript
|
||||
|
||||
@@ -412,7 +601,7 @@ Location: `<config folder>\scripts`
|
||||
|
||||
The JavaScript script host is built into libmpv.
|
||||
|
||||
There is no debugging support, only error and debug messages printed on the terminal.
|
||||
Error and debug messages are printed on the terminal.
|
||||
|
||||
JavaScript scripts are loaded before the first media file loads.
|
||||
|
||||
@@ -449,6 +638,8 @@ Script code can be written within a C# [extension](../../../tree/master/src/Exte
|
||||
that way full code completion and debugger support is available.
|
||||
Once the code was developed and debugged, it can be moved
|
||||
from the extension to a lightweight standalone script.
|
||||
The script host uses an old C# version, modern features
|
||||
like string interpolation are not available.
|
||||
|
||||
The C# scripting host is like [extensions](../../../tree/master/src/Extensions)
|
||||
not initialized before media files are loaded.
|
||||
|
||||
@@ -14,7 +14,7 @@ mpv.net手册
|
||||
* [安装](#安装)
|
||||
* [支持](#支持)
|
||||
* [设置](#设置)
|
||||
* [快捷键输入绑定](#快捷键输入绑定)
|
||||
* [快捷键和上下文菜单](#快捷键和上下文菜单)
|
||||
* [命令行界面](#命令行界面)
|
||||
* [终端](#终端)
|
||||
* [mpv.net的专属选项](#mpvnet的专属选项)
|
||||
@@ -43,48 +43,30 @@ mpv专注命令行与终端的使用,而mpv.net保留了这些并加入了现
|
||||
下载
|
||||
--------
|
||||
|
||||
1. [Microsoft Store 的稳定版](https://www.microsoft.com/store/productId/9N64SQZTB3LM)
|
||||
|
||||
2. [Github 的稳定与测试版](../../../releases)
|
||||
|
||||
3. `winget install mpv.net`
|
||||
|
||||
[更新日志](Changelog.md)
|
||||
|
||||
|
||||
### 稳定版
|
||||
|
||||
[发布页面](../../../releases)
|
||||
|
||||
|
||||
### 测试版
|
||||
|
||||
[OneDrive](https://1drv.ms/u/s!ArwKS_ZUR01g1ldoLA90tX9DzKTj?e=xITXbC)
|
||||
|
||||
[DropBox](https://www.dropbox.com/sh/t54p9igdwvllbpl/AADKyWpaFnIhdyosxyP5d3_xa?dl=0)
|
||||
|
||||
|
||||
安装
|
||||
------------
|
||||
|
||||
mpv.net需要.NET Framework 4.8运行库和高于win7版本的系统以及一张不太旧的显卡。
|
||||
|
||||
安装版和便携版可供下载。
|
||||
|
||||
安装新版本之前应完全卸载旧版本,使用旧版本覆盖安装新版本通常不是推荐的做法,
|
||||
安装工具不强制执行这项操作,因为它难以实现。
|
||||
|
||||
对于网络串流,必须手动下载安装youtube-dl,它必须位于环境变量 PATH 或启动目录中。
|
||||
|
||||
mpv.net不限制系统平台,win32的用户必须替换目录中的3个工具:
|
||||
|
||||
- mpv-1.dll
|
||||
- MediaInfo.dll
|
||||
- mpvnet.com
|
||||
|
||||
对于网络串流,必须手动下载安装yt-dlp,它必须位于环境变量 PATH 或启动目录中。
|
||||
|
||||
#### 文件关联
|
||||
|
||||
可以使用上下文菜单创建文件关联。 'Tools > Setup'
|
||||
可以使用上下文菜单注册文件关联。 'Settings > Setup'
|
||||
|
||||
注册完文件关联后,进入 "Windows设置 > 应用 > 默认应用",或者从powershell
|
||||
执行 `ms-settings:defaultapps` ,然后选择mpv. net作为视频/音频/图像的默认程序。
|
||||
注册完文件关联后,进入 "Windows设置 > 应用 > 默认应用" (Win+I, ms-settings:defaultapps)
|
||||
然后选择mpv. net作为视频/音频/图像的默认程序。
|
||||
|
||||
可以使用资源管理器的上下文菜单的'Open with'功能更改默认应用程序。
|
||||
另一种注册文件关联的方式是使用文件资源管理器,选中媒体文件后,选择上下文菜单的 '打开方式 > 选择其它应用' 。
|
||||
|
||||
[Open with++](#open-with) 可用来扩展资源管理器的上下文菜单
|
||||
[Play with mpv.net](https://github.com/stax76/OpenWithPlusPlus#play-with-mpvnet) 和
|
||||
@@ -97,13 +79,12 @@ mpv.net不限制系统平台,win32的用户必须替换目录中的3个工具
|
||||
支持
|
||||
-------
|
||||
|
||||
在提出支持请求之前,先尝试最新的[测试版](#测试版)。
|
||||
在提出支持请求之前,先尝试最新的测试版。
|
||||
|
||||
程序错误和功能请求可以在github的 [问题追踪](../../../issues) 上提出,
|
||||
任何与mpv. net相关的东西都可以使用,欢迎提交使用上出现的问题。
|
||||
|
||||
或者浏览VideoHelp论坛的讨论帖。
|
||||
[support thread](https://forum.videohelp.com/threads/392514-mpv-net-a-extendable-media-player-for-windows)
|
||||
或者浏览VideoHelp论坛的 [讨论帖](https://forum.videohelp.com/threads/392514-mpv-net-a-extendable-media-player-for-windows)
|
||||
|
||||
|
||||
设置
|
||||
@@ -119,7 +100,7 @@ mpv.net的专属选项保存在 mpvnet.conf 文件中,
|
||||
参数解释请参阅 [此处](#mpvnet的专属选项)
|
||||
|
||||
|
||||
快捷键输入绑定
|
||||
快捷键和上下文菜单
|
||||
----------------------
|
||||
|
||||
键鼠的快捷键和上下文菜单的操作保存在 input.conf 文件中,
|
||||
@@ -127,9 +108,32 @@ mpv.net的专属选项保存在 mpvnet.conf 文件中,
|
||||
|
||||
[input.conf defaults](../../../tree/master/src/Resources/input.conf.txt)
|
||||
|
||||
请注意,一旦 input.conf 存在, mpv.net 就不能更新它,这意味着当 mpv.net 升级了
|
||||
新的版本或改变了的默认菜单项时,菜单条目就会过时。获得最新菜单的唯一方法是
|
||||
通过删除 input.conf 来重置菜单,或者通过手动编辑 input.conf 来更新它。
|
||||
|
||||
通过 global-input.conf 文件支持全局热键。
|
||||
|
||||
配置文件夹可以从上下文菜单中打开: `Settings > Open Config Folder`
|
||||
设置文件夹可以从上下文菜单中打开: `Settings > Open Config Folder`
|
||||
|
||||
input 和 config editor 可以在上下文菜单的该条目中找到 'Settings'
|
||||
|
||||
输入测试模式可以通过命令行启动: --input-test
|
||||
|
||||
输入的键位列表可由该参数输出 --input-keylist
|
||||
或从上下文菜单的该条目获取 `View > Advanced > Show Keys`
|
||||
|
||||
mpv.net的默认input.conf文件:
|
||||
https://github.com/stax76/mpv.net/blob/master/src/Resources/input.conf.txt
|
||||
|
||||
mpv的默认input.conf文件:
|
||||
https://github.com/mpv-player/mpv/blob/master/etc/input.conf
|
||||
|
||||
mpv的命令:
|
||||
https://mpv.io/manual/master/#list-of-input-commands
|
||||
|
||||
mpv的input选项:
|
||||
https://mpv.io/manual/master/#input
|
||||
|
||||
|
||||
命令行界面
|
||||
@@ -640,8 +644,6 @@ input.conf 定义mpv的快捷键,同时mpv.net使用注释定义上下文菜
|
||||
|
||||
从剪贴板打开文件和URL。如何从YouTube等网站的浏览器中直接打开url在[外部工具](#外部工具)部分进行了描述。
|
||||
|
||||
对于网络流媒体,必须手动下载并安装youtube-dl,这意味着它必须位于环境变量PATH或启动目录中。
|
||||
|
||||
|
||||
### Open > Open DVD/Blu-ray Drive/Folder
|
||||
|
||||
|
||||
@@ -13,22 +13,22 @@
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace mpvnet
|
||||
public static bool Queue { get; set; }
|
||||
public static bool RememberVolume { get; set; } = true;
|
||||
public static bool RememberWindowPosition { get; set; }
|
||||
public static bool ShowLogo { get; set; } = true;
|
||||
|
||||
public static int StartThreshold { get; set; } = 1500;
|
||||
public static int RecentCount { get; set; } = 15;
|
||||
@@ -130,8 +131,21 @@ namespace mpvnet
|
||||
}
|
||||
|
||||
public static string Version => "Copyright (C) 2000-2022 mpv.net/mpv/mplayer\n" +
|
||||
$"mpv.net {Application.ProductVersion} ({File.GetLastWriteTime(Application.ExecutablePath).ToShortDateString()})\n" +
|
||||
$"{Core.GetPropertyString("mpv-version")} ({File.GetLastWriteTime(Folder.Startup + "mpv-2.dll").ToShortDateString()})\nffmpeg {Core.GetPropertyString("ffmpeg-version")}\nMediaInfo {FileVersionInfo.GetVersionInfo(Path.Combine(Application.StartupPath, "MediaInfo.dll")).FileVersion} ({File.GetLastWriteTime(Path.Combine(Application.StartupPath , "MediaInfo.dll")).ToShortDateString()})\nGPL v2 License";
|
||||
$"mpv.net {Application.ProductVersion}" + GetLastWriteTime(Application.ExecutablePath) + "\n" +
|
||||
$"{Core.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "mpv-2.dll") + "\n" +
|
||||
$"ffmpeg {Core.GetPropertyString("ffmpeg-version")}\n" +
|
||||
$"MediaInfo {FileVersionInfo.GetVersionInfo(Path.Combine(Application.StartupPath, "MediaInfo.dll")).FileVersion}" +
|
||||
GetLastWriteTime(Path.Combine(Application.StartupPath , "MediaInfo.dll")) + "\nGPL v2 License";
|
||||
|
||||
static string GetLastWriteTime(string path)
|
||||
{
|
||||
if (IsStoreVrsion)
|
||||
return "";
|
||||
|
||||
return $" ({File.GetLastWriteTime(path).ToShortDateString()})";
|
||||
}
|
||||
|
||||
static bool IsStoreVrsion => Application.StartupPath.Contains("FrankSkare.mpv.net");
|
||||
|
||||
public static void ShowException(object obj)
|
||||
{
|
||||
@@ -233,6 +247,7 @@ namespace mpvnet
|
||||
case "queue": Queue = value == "yes"; return true;
|
||||
case "recent-count": RecentCount = value.ToInt(); return true;
|
||||
case "remember-volume": RememberVolume = value == "yes"; return true;
|
||||
case "show-logo": ShowLogo = value == "yes"; return true;
|
||||
case "remember-window-position": RememberWindowPosition = value == "yes"; return true;
|
||||
case "start-size": StartSize = value; return true;
|
||||
case "start-threshold": StartThreshold = value.ToInt(); return true;
|
||||
|
||||
@@ -29,10 +29,11 @@ namespace mpvnet
|
||||
case "execute-mpv-command": Msg.ShowError("The command was removed, reset input.conf by deleting it, in the new menu use the on screen console."); break; // deprecated 2020
|
||||
case "load-audio": LoadAudio(); break;
|
||||
case "load-sub": LoadSubtitle(); break;
|
||||
case "open-clipboard": OpenFromClipboard(); break;
|
||||
case "open-conf-folder": ProcessHelp.ShellExecute(Core.ConfigFolder); break;
|
||||
case "open-files": OpenFiles(args); break;
|
||||
case "open-optical-media": Open_DVD_Or_BD_Folder(); break;
|
||||
case "open-url": OpenURL(); break;
|
||||
case "open-url": OpenFromClipboard(); break; // deprecated 2022
|
||||
case "play-pause": PlayPause(); break;
|
||||
case "playlist-first": PlaylistFirst(); break;
|
||||
case "playlist-last": PlaylistLast(); break;
|
||||
@@ -52,6 +53,7 @@ namespace mpvnet
|
||||
case "show-input-editor": ShowDialog(typeof(InputWindow)); break;
|
||||
case "show-keys": ShowStrings(Core.GetPropertyString("input-key-list").Split(',')); break;
|
||||
case "show-media-info": ShowMediaInfo(args); break;
|
||||
case "show-menu": ShowMenu(); break;
|
||||
case "show-playlist": ShowPlaylist(); break;
|
||||
case "show-profiles": Msg.ShowInfo(mpvHelp.GetProfiles()); break;
|
||||
case "show-progress": ShowProgress(); break;
|
||||
@@ -67,14 +69,20 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowDialog(Type winType)
|
||||
public static void ShowTextWithEditor(string name, string text)
|
||||
{
|
||||
string file = Path.Combine(Path.GetTempPath(), name + ".txt");
|
||||
App.TempFiles.Add(file);
|
||||
File.WriteAllText(file, BR + text.Trim() + BR);
|
||||
ProcessHelp.ShellExecute(file);
|
||||
}
|
||||
|
||||
public static void ShowDialog(Type winType) => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
App.InvokeOnMainThread(new Action(() => {
|
||||
Window win = Activator.CreateInstance(winType) as Window;
|
||||
new WindowInteropHelper(win).Owner = MainForm.Instance.Handle;
|
||||
win.ShowDialog();
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
public static void OpenFiles(params string[] args)
|
||||
{
|
||||
@@ -97,15 +105,13 @@ namespace mpvnet
|
||||
}));
|
||||
}
|
||||
|
||||
public static void Open_DVD_Or_BD_Folder()
|
||||
public static void Open_DVD_Or_BD_Folder() => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
App.InvokeOnMainThread(new Action(() => {
|
||||
var dialog = new FolderBrowser();
|
||||
|
||||
if (dialog.Show())
|
||||
Core.LoadDiskFolder(dialog.SelectedPath);
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
public static void PlaylistFirst()
|
||||
{
|
||||
@@ -167,9 +173,6 @@ namespace mpvnet
|
||||
if (path.Contains("://"))
|
||||
path = Core.GetPropertyString("media-title");
|
||||
|
||||
int width = Core.GetPropertyInt("video-params/w");
|
||||
int height = Core.GetPropertyInt("video-params/h");
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
fileSize = new FileInfo(path).Length;
|
||||
@@ -217,12 +220,13 @@ namespace mpvnet
|
||||
|
||||
string videoFormat = Core.GetPropertyString("video-format").ToUpper();
|
||||
string audioCodec = Core.GetPropertyString("audio-codec-name").ToUpper();
|
||||
|
||||
text = path.FileName() + $"\n{width} x {height}\n";
|
||||
|
||||
if (fileSize > 0)
|
||||
text += Convert.ToInt32(fileSize / 1024.0 / 1024.0) + " MB\n";
|
||||
|
||||
int width = Core.GetPropertyInt("video-params/w");
|
||||
int height = Core.GetPropertyInt("video-params/h");
|
||||
TimeSpan len = TimeSpan.FromSeconds(Core.GetPropertyDouble("duration"));
|
||||
text = path.FileName() + "\n";
|
||||
text += FormatTime(len.TotalMinutes) + ":" + FormatTime(len.Seconds) + "\n";
|
||||
if (fileSize > 0) text += Convert.ToInt32(fileSize / 1024.0 / 1024.0) + " MB\n";
|
||||
text += $"{width} x {height}\n";
|
||||
text += $"{videoFormat}\n{audioCodec}";
|
||||
|
||||
Core.CommandV("show-text", text, "5000");
|
||||
@@ -233,6 +237,8 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
static string FormatTime(double value) => ((int)value).ToString("00");
|
||||
|
||||
public static void ShowProgress()
|
||||
{
|
||||
TimeSpan position = TimeSpan.FromSeconds(Core.GetPropertyDouble("time-pos"));
|
||||
@@ -244,13 +250,10 @@ namespace mpvnet
|
||||
FormatTime(duration.Seconds);
|
||||
|
||||
Core.CommandV("show-text", text, "5000");
|
||||
|
||||
string FormatTime(double value) => ((int)value).ToString("00");
|
||||
}
|
||||
|
||||
public static void OpenURL()
|
||||
public static void OpenFromClipboard() => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
App.InvokeOnMainThread(new Action(() => {
|
||||
if (WinForms.Clipboard.ContainsFileDropList())
|
||||
{
|
||||
string[] files = WinForms.Clipboard.GetFileDropList().Cast<string>().ToArray();
|
||||
@@ -263,18 +266,16 @@ namespace mpvnet
|
||||
if (string.IsNullOrEmpty(clipboard) || (!clipboard.Contains("://") && !File.Exists(clipboard)) ||
|
||||
clipboard.Contains("\n"))
|
||||
{
|
||||
App.ShowError("No URL found, the clipboard does not contain a valid URL or file.");
|
||||
App.ShowError("The clipboard does not contain a valid URL or file.");
|
||||
return;
|
||||
}
|
||||
|
||||
Core.LoadFiles(new [] { clipboard }, false, Control.ModifierKeys.HasFlag(Keys.Control));
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
public static void LoadSubtitle()
|
||||
public static void LoadSubtitle() => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
App.InvokeOnMainThread(new Action(() => {
|
||||
using (var d = new OpenFileDialog())
|
||||
{
|
||||
string path = Core.GetPropertyString("path");
|
||||
@@ -288,12 +289,10 @@ namespace mpvnet
|
||||
foreach (string filename in d.FileNames)
|
||||
Core.CommandV("sub-add", filename);
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
public static void LoadAudio()
|
||||
public static void LoadAudio() => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
App.InvokeOnMainThread(new Action(() => {
|
||||
using (var d = new OpenFileDialog())
|
||||
{
|
||||
string path = Core.GetPropertyString("path");
|
||||
@@ -307,8 +306,7 @@ namespace mpvnet
|
||||
foreach (string i in d.FileNames)
|
||||
Core.CommandV("audio-add", i);
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
public static void CycleAudio()
|
||||
{
|
||||
@@ -336,16 +334,16 @@ namespace mpvnet
|
||||
|
||||
public static void ShowCommands()
|
||||
{
|
||||
string json = Core.GetPropertyString("command-list");
|
||||
var o = json.FromJson<List<Dictionary<string, object>>>().OrderBy(i => i["name"]);
|
||||
string jsonString = Core.GetPropertyString("command-list");
|
||||
var jsonObject = jsonString.FromJson<List<Dictionary<string, object>>>().OrderBy(i => i["name"]);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (Dictionary<string, object> i in o)
|
||||
foreach (Dictionary<string, object> dic in jsonObject)
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.AppendLine(i["name"].ToString());
|
||||
sb.AppendLine(dic["name"].ToString());
|
||||
|
||||
foreach (Dictionary<string, object> i2 in i["args"] as List<object>)
|
||||
foreach (Dictionary<string, object> i2 in dic["args"] as List<object>)
|
||||
{
|
||||
string value = i2["name"].ToString() + " <" + i2["type"].ToString().ToLower() + ">";
|
||||
|
||||
@@ -356,7 +354,7 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
Msg.ShowInfo(sb.ToString());
|
||||
ShowTextWithEditor("command-list", sb.ToString());
|
||||
}
|
||||
|
||||
public static void ScaleWindow(float factor) => Core.RaiseScaleWindow(factor);
|
||||
@@ -378,8 +376,23 @@ namespace mpvnet
|
||||
"}${osd-ass-cc/1}" + text + "\" " + duration);
|
||||
}
|
||||
|
||||
public static void ShowMediaInfo(string[] args)
|
||||
public static void ShowMediaInfo(string[] args) => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
if (args == null || args.Length == 0)
|
||||
{
|
||||
(string Name, string Value)[] pairs = {
|
||||
("Show text box", "script-message mpv.net show-media-info default"),
|
||||
("Show text editor", "script-message mpv.net show-media-info editor"),
|
||||
("Show full", "script-message mpv.net show-media-info editor full"),
|
||||
("Show raw", "script-message mpv.net show-media-info editor full raw") };
|
||||
|
||||
var list = pairs.Select(i => new CommandPaletteItem(i.Name, () => Core.Command(i.Value)));
|
||||
CommandPalette.Instance.SetItems(list);
|
||||
MainForm.Instance.ShowCommandPalette();
|
||||
CommandPalette.Instance.SelectFirst();
|
||||
return;
|
||||
}
|
||||
|
||||
string path = Core.GetPropertyString("path");
|
||||
|
||||
if (File.Exists(path) && !path.Contains(@"\\.\pipe\"))
|
||||
@@ -388,14 +401,22 @@ namespace mpvnet
|
||||
{
|
||||
bool full = args.Contains("full");
|
||||
bool raw = args.Contains("raw");
|
||||
bool editor = args.Contains("editor");
|
||||
|
||||
string text = mediaInfo.GetSummary(full, raw);
|
||||
text = Regex.Replace(text, "Unique ID.+", "");
|
||||
|
||||
if (editor)
|
||||
ShowTextWithEditor("media-info", text);
|
||||
else
|
||||
{
|
||||
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Consolas");
|
||||
Msg.ShowInfo(text);
|
||||
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Segoe UI");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
public static void ShowCommandPalette() => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
@@ -538,7 +559,7 @@ namespace mpvnet
|
||||
if (propValue.ContainsEx("${"))
|
||||
propValue += BR2 + Core.Expand(propValue);
|
||||
|
||||
App.ShowInfo(prop + ": " + propValue);
|
||||
App.ShowInfo(prop + "\n\n" + propValue);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -628,16 +649,18 @@ namespace mpvnet
|
||||
|
||||
public static void ShowSetupDialog() => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
(string, string)[] pairs = {
|
||||
(string Name, string Value)[] pairs = {
|
||||
("Register video file associations", "script-message mpv.net reg-file-assoc video"),
|
||||
("Register audio file associations", "script-message mpv.net reg-file-assoc audio"),
|
||||
("Register image file associations", "script-message mpv.net reg-file-assoc image"),
|
||||
("Unregister file associations", "script-message mpv.net reg-file-assoc unreg") };
|
||||
|
||||
var list = pairs.Select(i => new CommandPaletteItem(i.Item1, () => Core.Command(i.Item2)));
|
||||
var list = pairs.Select(i => new CommandPaletteItem(i.Name, () => Core.Command(i.Value)));
|
||||
CommandPalette.Instance.SetItems(list);
|
||||
MainForm.Instance.ShowCommandPalette();
|
||||
CommandPalette.Instance.SelectFirst();
|
||||
});
|
||||
|
||||
public static void ShowMenu() => Core.RaiseShowMenu();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace mpvnet
|
||||
|
||||
public event Action Initialized;
|
||||
public event Action InitializedAsync;
|
||||
public event Action ShowMenu;
|
||||
public event Action<float> ScaleWindow;
|
||||
public event Action<float> WindowScale;
|
||||
public event Action<int> PlaylistPosChanged;
|
||||
@@ -81,7 +82,7 @@ namespace mpvnet
|
||||
public string ConfPath { get => ConfigFolder + "mpv.conf"; }
|
||||
public string GPUAPI { get; set; } = "auto";
|
||||
public string VO { get; set; } = "gpu";
|
||||
public string InputConfPath { get => ConfigFolder + "input.conf"; }
|
||||
public string InputConfPath => ConfigFolder + "input.conf";
|
||||
|
||||
public string VID { get; set; } = "";
|
||||
public string AID { get; set; } = "";
|
||||
@@ -109,6 +110,8 @@ namespace mpvnet
|
||||
|
||||
public void Init()
|
||||
{
|
||||
ApplyShowMenuFix();
|
||||
|
||||
Handle = mpv_create();
|
||||
|
||||
if (Handle == IntPtr.Zero)
|
||||
@@ -168,10 +171,28 @@ namespace mpvnet
|
||||
InvokeAsync(InitializedAsync);
|
||||
}
|
||||
|
||||
void ApplyCompatibilityFixes()
|
||||
void ApplyShowMenuFix()
|
||||
{
|
||||
if (!App.Settings.InputDefaultBindingsFixApplied)
|
||||
if (App.Settings.ShowMenuFixApplied)
|
||||
return;
|
||||
|
||||
if (File.Exists(InputConfPath))
|
||||
{
|
||||
string content = File.ReadAllText(InputConfPath);
|
||||
|
||||
if (!content.Contains("script-message mpv.net show-menu"))
|
||||
File.WriteAllText(InputConfPath, BR + content.Trim() + BR +
|
||||
"MBTN_Right script-message mpv.net show-menu" + BR);
|
||||
}
|
||||
|
||||
App.Settings.ShowMenuFixApplied = true;
|
||||
}
|
||||
|
||||
void ApplyInputDefaultBindingsFix()
|
||||
{
|
||||
if (App.Settings.InputDefaultBindingsFixApplied)
|
||||
return;
|
||||
|
||||
if (File.Exists(ConfPath))
|
||||
{
|
||||
string content = File.ReadAllText(ConfPath);
|
||||
@@ -185,7 +206,6 @@ namespace mpvnet
|
||||
|
||||
App.Settings.InputDefaultBindingsFixApplied = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void ProcessProperty(string name, string value)
|
||||
{
|
||||
@@ -232,6 +252,7 @@ namespace mpvnet
|
||||
|
||||
if (!Directory.Exists(_ConfigFolder))
|
||||
{
|
||||
try {
|
||||
using (Process proc = new Process())
|
||||
{
|
||||
proc.StartInfo.UseShellExecute = false;
|
||||
@@ -241,6 +262,7 @@ namespace mpvnet
|
||||
proc.Start();
|
||||
proc.WaitForExit();
|
||||
}
|
||||
} catch (Exception) {}
|
||||
|
||||
if (!Directory.Exists(_ConfigFolder))
|
||||
Directory.CreateDirectory(_ConfigFolder);
|
||||
@@ -262,7 +284,7 @@ namespace mpvnet
|
||||
get {
|
||||
if (_Conf == null)
|
||||
{
|
||||
ApplyCompatibilityFixes();
|
||||
ApplyInputDefaultBindingsFix();
|
||||
|
||||
_Conf = new Dictionary<string, string>();
|
||||
|
||||
@@ -1308,9 +1330,11 @@ KP1 script-binding delete_current_file/confirm
|
||||
|
||||
public void ShowLogo()
|
||||
{
|
||||
if (MainForm.Instance is null)
|
||||
if (!App.ShowLogo || (MainForm.Instance == null || App.Settings.LogoCrash))
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
bool december = DateTime.Now.Month == 12;
|
||||
|
||||
Rectangle cr = MainForm.Instance.ClientRectangle;
|
||||
@@ -1337,6 +1361,11 @@ KP1 script-binding delete_current_file/confirm
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
App.Settings.LogoCrash = true;
|
||||
}
|
||||
}
|
||||
|
||||
string GetLanguage(string id)
|
||||
{
|
||||
@@ -1351,6 +1380,8 @@ KP1 script-binding delete_current_file/confirm
|
||||
|
||||
public void RaiseWindowScale(float value) => WindowScale(value);
|
||||
|
||||
public void RaiseShowMenu() => ShowMenu();
|
||||
|
||||
void ReadMetaData()
|
||||
{
|
||||
string path = GetPropertyString("path");
|
||||
|
||||
@@ -68,13 +68,25 @@ public static class ConvertStringExtension
|
||||
|
||||
public static class PathStringExtension
|
||||
{
|
||||
// returns the extension with lower case and without preceding dot.
|
||||
public static string Ext(this string instance)
|
||||
public static string Ext(this string filepath) => Ext(filepath, false);
|
||||
|
||||
public static string Ext(this string filepath, bool includeDot)
|
||||
{
|
||||
if (instance == null)
|
||||
if (string.IsNullOrEmpty(filepath))
|
||||
return "";
|
||||
|
||||
return Path.GetExtension(instance).TrimStart('.').ToLower();
|
||||
char[] chars = filepath.ToCharArray();
|
||||
|
||||
for (int x = filepath.Length - 1; x >= 0; x--)
|
||||
{
|
||||
if (chars[x] == Path.DirectorySeparatorChar)
|
||||
return "";
|
||||
|
||||
if (chars[x] == '.')
|
||||
return filepath.Substring(x + (includeDot ? 0 : 1)).ToLowerInvariant();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string FileName(this string instance)
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace mpvnet
|
||||
Core.Init();
|
||||
|
||||
Core.Shutdown += Core_Shutdown;
|
||||
Core.ShowMenu += Core_ShowMenu;
|
||||
Core.VideoSizeChanged += Core_VideoSizeChanged;
|
||||
Core.ScaleWindow += Core_ScaleWindow;
|
||||
Core.WindowScale += Core_WindowScale;
|
||||
@@ -135,6 +136,18 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
private void Core_ShowMenu()
|
||||
{
|
||||
BeginInvoke(new Action(() => {
|
||||
if (IsMouseInOSC())
|
||||
return;
|
||||
|
||||
CursorHelp.Show();
|
||||
UpdateMenu();
|
||||
ContextMenu.IsOpen = true;
|
||||
}));
|
||||
}
|
||||
|
||||
void Core_ScaleWindow(float scale) {
|
||||
BeginInvoke(new Action(() => {
|
||||
int w, h;
|
||||
@@ -791,27 +804,14 @@ namespace mpvnet
|
||||
case 0x105: // WM_SYSKEYUP
|
||||
case 0x201: // WM_LBUTTONDOWN
|
||||
case 0x202: // WM_LBUTTONUP
|
||||
case 0x204: // WM_RBUTTONDOWN
|
||||
case 0x205: // WM_RBUTTONUP
|
||||
case 0x207: // WM_MBUTTONDOWN
|
||||
case 0x208: // WM_MBUTTONUP
|
||||
case 0x20a: // WM_MOUSEWHEEL
|
||||
case 0x20e: // WM_MOUSEHWHEEL
|
||||
case 0x20b: // WM_XBUTTONDOWN
|
||||
case 0x20c: // WM_XBUTTONUP
|
||||
if (Core.WindowHandle != IntPtr.Zero)
|
||||
m.Result = SendMessage(Core.WindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
break;
|
||||
case 0x0204: // WM_RBUTTONDOWN
|
||||
if (IsMouseInOSC() && Core.WindowHandle != IntPtr.Zero)
|
||||
m.Result = SendMessage(Core.WindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
break;
|
||||
case 0x0205: // WM_RBUTTONUP
|
||||
if (!IsMouseInOSC())
|
||||
{
|
||||
CursorHelp.Show();
|
||||
UpdateMenu();
|
||||
ContextMenu.IsOpen = true;
|
||||
}
|
||||
else
|
||||
case 0x20e: // WM_MOUSEHWHEEL
|
||||
if (Core.WindowHandle != IntPtr.Zero)
|
||||
m.Result = SendMessage(Core.WindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
break;
|
||||
|
||||
@@ -166,6 +166,14 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
public string Alias {
|
||||
get {
|
||||
if (Input.Contains("SHARP") || Input.Contains("sharp") || Input.Contains("Sharp"))
|
||||
return "#";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static ObservableCollection<CommandItem> GetItems(string content)
|
||||
{
|
||||
var items = new ObservableCollection<CommandItem>();
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace mpvnet
|
||||
public class AppSettings
|
||||
{
|
||||
public bool InputDefaultBindingsFixApplied;
|
||||
public int LastUpdateCheck;
|
||||
public bool LogoCrash;
|
||||
public bool ShowMenuFixApplied;
|
||||
public int Volume = 70;
|
||||
public List<string> RecentFiles = new List<string>();
|
||||
public Point WindowLocation;
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<VisualStudioVersion>15.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|AnyCPU">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|AnyCPU">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
@@ -31,36 +31,12 @@
|
||||
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
||||
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("5.7.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.7.0.0")]
|
||||
[assembly: AssemblyVersion("5.8.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.8.0.0")]
|
||||
|
||||
@@ -681,3 +681,13 @@ file = mpvnet
|
||||
filter = UI
|
||||
url = https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#color-theme
|
||||
help = Color theme used in light mode.\nmpv.net must be restarted after a change.\nmpv.net specific option. Default: light
|
||||
|
||||
[setting]
|
||||
name = show-logo
|
||||
file = mpvnet
|
||||
default = yes
|
||||
filter = UI
|
||||
help = Draws the blue mpv.net logo ontop of the native OSC logo.
|
||||
|
||||
option = yes
|
||||
option = no
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#input-and-context-menu
|
||||
|
||||
o script-message mpv.net open-files #menu: Open > Open Files...
|
||||
Ctrl+v script-message mpv.net open-url #menu: Open > Open URL or file from clipboard
|
||||
Ctrl+v script-message mpv.net open-clipboard #menu: Open > Open URL or file from clipboard
|
||||
_ script-message mpv.net open-optical-media #menu: Open > Open DVD/Blu-ray Drive/Folder...
|
||||
_ ignore #menu: Open > -
|
||||
Alt+a script-message mpv.net load-audio #menu: Open > Load external audio files...
|
||||
@@ -166,10 +166,11 @@ F1 script-message mpv.net show-command-palette #menu: Command Palette
|
||||
_ ignore #menu: -
|
||||
Esc quit #menu: Exit
|
||||
|
||||
MBTN_Right script-message mpv.net show-menu
|
||||
6 script-message mpv.net show-progress
|
||||
KP6 script-message mpv.net show-progress
|
||||
7 script-message mpv.net cycle-audio
|
||||
SHARP script-message mpv.net cycle-audio
|
||||
Sharp script-message mpv.net cycle-audio
|
||||
8 cycle sub
|
||||
j cycle sub
|
||||
q quit
|
||||
@@ -195,15 +196,15 @@ MBTN_Left ignore
|
||||
f cycle fullscreen
|
||||
MBTN_Left_DBL cycle fullscreen
|
||||
KP_Enter cycle fullscreen
|
||||
Shift+RIGHT no-osd seek 1 exact
|
||||
Shift+LEFT no-osd seek -1 exact
|
||||
Shift+UP no-osd seek 5 exact
|
||||
Shift+DOWN no-osd seek -5 exact
|
||||
Shift+Right no-osd seek 1 exact
|
||||
Shift+Left no-osd seek -1 exact
|
||||
Shift+Up no-osd seek 5 exact
|
||||
Shift+Down no-osd seek -5 exact
|
||||
Shift+BS revert-seek # undo the previous (or marked) seek
|
||||
Shift+Ctrl+BS revert-seek mark # mark the position for revert-seek
|
||||
Shift+g add sub-scale +0.1 # increase the subtitle font size
|
||||
Shift+f add sub-scale -0.1 # decrease the subtitle font size
|
||||
Ctrl+Shift+LEFT no-osd sub-seek -1 # seek to the previous subtitle
|
||||
Ctrl+Shift+RIGHT no-osd sub-seek 1 # seek to the next subtitle
|
||||
Ctrl+Shift+Left no-osd sub-seek -1 # seek to the previous subtitle
|
||||
Ctrl+Shift+Right no-osd sub-seek 1 # seek to the next subtitle
|
||||
Ctrl+Wheel_Up no-osd seek 7
|
||||
Ctrl+Wheel_Down no-osd seek -7
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
// When seeking displays position and duration like so: 70:00 / 80:00
|
||||
// Which is different from most players which use: 01:10:00 / 01:20:00
|
||||
// In input.conf set the input command prefix no-osd infront of the seek command.
|
||||
|
||||
function add_zero(val)
|
||||
{
|
||||
val = Math.round(val);
|
||||
return val > 9 ? "" + val : "0" + val;
|
||||
}
|
||||
|
||||
function format(val)
|
||||
{
|
||||
var sec = Math.round(val);
|
||||
|
||||
if (sec < 0)
|
||||
sec = 0;
|
||||
|
||||
pos_min_floor = Math.floor(sec / 60);
|
||||
sec_rest = sec - pos_min_floor * 60;
|
||||
return add_zero(pos_min_floor) + ":" + add_zero(sec_rest);
|
||||
}
|
||||
|
||||
function on_seek(_)
|
||||
{
|
||||
pos = mp.get_property_number("time-pos");
|
||||
dur = mp.get_property_number("duration");
|
||||
|
||||
if (pos > dur)
|
||||
pos = dur;
|
||||
|
||||
mp.commandv("show-text", format(pos) + " / " + format(dur));
|
||||
}
|
||||
|
||||
mp.register_event("seek", on_seek);
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
// This script shows the playlist.
|
||||
|
||||
function showPlaylist()
|
||||
{
|
||||
// set font size
|
||||
mp.set_property_number("osd-font-size", 40);
|
||||
|
||||
// show playlist for 5 seconds
|
||||
mp.command("show-text ${playlist} 5000");
|
||||
|
||||
// restore original font size in 6 seconds
|
||||
setTimeout(resetFontSize, 6000);
|
||||
}
|
||||
|
||||
// restore original font size
|
||||
function resetFontSize()
|
||||
{
|
||||
mp.set_property_number("osd-font-size", size);
|
||||
}
|
||||
|
||||
// save original font size
|
||||
var size = mp.get_property_number("osd-font-size");
|
||||
|
||||
// input.conf: key script-binding show-playlist
|
||||
mp.add_key_binding(null, "show-playlist", showPlaylist);
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
-- This script deletes the file that is currently playing.
|
||||
|
||||
-- input.conf:
|
||||
|
||||
-- KP0 script-binding delete_current_file/delete
|
||||
-- 0 script-binding delete_current_file/delete
|
||||
|
||||
-- KP1 script-binding delete_current_file/confirm
|
||||
-- 1 script-binding delete_current_file/confirm
|
||||
|
||||
function delete()
|
||||
FileToDelete = mp.get_property("path")
|
||||
DeleteTime = os.time()
|
||||
mp.commandv("show-text", "Press 1 to delete file", "10000")
|
||||
end
|
||||
|
||||
function confirm()
|
||||
local path = mp.get_property("path")
|
||||
|
||||
if FileToDelete == path and (os.time() - DeleteTime) < 10 then
|
||||
mp.commandv("show-text", "")
|
||||
|
||||
local count = mp.get_property_number("playlist-count")
|
||||
local pos = mp.get_property_number("playlist-pos")
|
||||
local newPos = 0
|
||||
|
||||
if pos == count - 1 then
|
||||
newPos = pos - 1
|
||||
else
|
||||
newPos = pos + 1
|
||||
end
|
||||
|
||||
if newPos > -1 then
|
||||
mp.command("set pause no")
|
||||
mp.set_property_number("playlist-pos", newPos)
|
||||
end
|
||||
|
||||
mp.command("playlist-remove " .. pos)
|
||||
|
||||
local ps_code = [[& {
|
||||
Start-Sleep -Seconds 2
|
||||
Add-Type -AssemblyName Microsoft.VisualBasic
|
||||
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile('FileToDelete', 'OnlyErrorDialogs', 'SendToRecycleBin')
|
||||
}]]
|
||||
|
||||
local escapedFileToDelete = string.gsub(FileToDelete, "'", "''")
|
||||
escapedFileToDelete = string.gsub(escapedFileToDelete, "’", "’’")
|
||||
escapedFileToDelete = string.gsub(escapedFileToDelete, "%%", "%%%%")
|
||||
ps_code = string.gsub(ps_code, "FileToDelete", escapedFileToDelete)
|
||||
|
||||
mp.command_native({
|
||||
name = "subprocess",
|
||||
playback_only = false,
|
||||
detach = true,
|
||||
args = { 'powershell', '-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', ps_code },
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
mp.add_key_binding(nil, "delete", delete)
|
||||
mp.add_key_binding(nil, "confirm", confirm)
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
-- https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/pause-when-minimize.lua
|
||||
|
||||
-- This script pauses playback when minimizing the window, and resumes playback
|
||||
-- if it's brought back again. If the player was already paused when minimizing,
|
||||
-- then try not to mess with the pause state.
|
||||
|
||||
local did_minimize = false
|
||||
|
||||
mp.observe_property("window-minimized", "bool", function(name, value)
|
||||
local pause = mp.get_property_native("pause")
|
||||
if value == true then
|
||||
if pause == false then
|
||||
mp.set_property_native("pause", true)
|
||||
did_minimize = true
|
||||
end
|
||||
elseif value == false then
|
||||
if did_minimize and (pause == true) then
|
||||
mp.set_property_native("pause", false)
|
||||
end
|
||||
did_minimize = false
|
||||
end
|
||||
end)
|
||||
@@ -90,11 +90,20 @@ namespace mpvnet
|
||||
{
|
||||
string filter = SearchControl.SearchTextBox.Text.ToLower();
|
||||
|
||||
if (filter.Length == 1 && item.CommandItem != null)
|
||||
if (item.CommandItem != null)
|
||||
{
|
||||
if (item.CommandItem.Alias.ContainsEx(filter))
|
||||
return true;
|
||||
|
||||
if (filter.Length == 1)
|
||||
return item.CommandItem.Input.ToLower().Replace("ctrl+", "")
|
||||
.Replace("shift+", "")
|
||||
.Replace("alt+", "") == filter.ToLower();
|
||||
|
||||
if (item.CommandItem.Command.ToLower().Contains(filter))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (filter == "" || item.Text.ToLower().Contains(filter) ||
|
||||
item.SecondaryText.ToLower().Contains(filter))
|
||||
|
||||
|
||||
@@ -48,28 +48,25 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
|
||||
@@ -16,24 +16,24 @@ Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "mpv.net.package", "Package\
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.Build.0 = Debug|x64
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.ActiveCfg = Release|x64
|
||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.Build.0 = Release|x64
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|x64.Build.0 = Debug|x64
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Release|x64.ActiveCfg = Release|x64
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Release|x64.Build.0 = Release|x64
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.Build.0 = Debug|x64
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.ActiveCfg = Release|x64
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.Build.0 = Release|x64
|
||||
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.Deploy.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user