Compare commits

...

151 Commits

Author SHA1 Message Date
stax76
80c827974a v6.0.4.0 Stable 2023-08-17 02:50:45 +02:00
stax76
d2e7d4551f v6.0.4.0 Stable 2023-08-17 02:38:41 +02:00
stax76
308e3ed044 Merge pull request #541 from soredake/sub-override-keybind
input.conf.txt: add binding for overriding sub styles
2023-08-17 02:31:42 +02:00
soredake
f563342eb5 input.conf.txt: add binding for overriding sub styles 2023-05-07 19:56:30 +03:00
stax76
16d6e4d471 Merge pull request #517 from Torben2000/feature/playlist-titles
Use item title in playlist command palette if set
2023-01-21 08:12:56 +01:00
stax76
030aa930a1 Merge pull request #529 from hooke007/dll
relink to libmpv-2
2023-01-21 08:12:01 +01:00
hooke007
3a6df857da relink to libmpv-2 2023-01-20 15:35:59 +00:00
Torben2000
7d9340d9d5 Use item title in playlist command palette if set
Fixes https://github.com/mpvnet-player/mpv.net/issues/509
2022-12-03 19:30:37 +01:00
stax76
9dca27c941 Merge pull request #510 from soredake/screenshot-without-subtitles
input.conf.txt: add binding for screenshot without subtitles
2022-11-27 07:41:31 +01:00
soredake
6f2b30f762 input.conf.txt: add binding for screenshot without subtitles 2022-11-15 11:57:49 +02:00
stax76
89be723132 Merge pull request #505 from nkh0472/patch-2
fix typo
2022-10-20 17:29:37 +02:00
nkh0472
ec1dde650f fix typo 2022-10-20 23:12:35 +08:00
stax76
dbf1a32580 v6.0.3.2 2022-10-14 12:18:12 +02:00
stax76
a81ed58983 finish repo transfer 2022-10-12 12:40:40 +02:00
stax76
33df960d04 Merge branch 'master' of https://github.com/stax76/mpv.net 2022-10-02 15:40:55 +02:00
stax76
337bee9f28 fix severe termination bug 2022-10-02 15:40:53 +02:00
stax76
e57c41a254 Merge pull request #495 from nkh0472/patch-1
Update Manual_chs.md
2022-10-01 10:19:41 +02:00
nkh0472
62d06c65ab Update Manual_chs.md
Co-authored-by: hooke007 <hooke007@qq.com>
2022-09-25 19:21:22 +08:00
nkh0472
e70a935d7a Update Manual_chs.md
Add more info about translations update this time
2022-09-19 21:14:48 +08:00
nkh0472
c8e6ce678a Update Manual_chs.md
Translations for b73d2e7107 and 1f6025a10f
2022-09-18 23:03:37 +08:00
stax76
22960af78b mouse cursor auto-hide behavior 2022-08-19 07:13:07 +02:00
stax76
95e31a1d3f Improved mouse cursor hide behavior 2022-08-19 06:53:49 +02:00
stax76
06ff83b75c shorter OSD media info 2022-08-18 09:44:52 +02:00
stax76
1f6025a10f New command to move the Window to the screen edge 2022-08-18 09:31:23 +02:00
stax76
00bfa20fac improved OSD media info 2022-08-08 03:19:11 +02:00
stax76
1475d5ee66 conf editor option definition simplyfication 2022-08-07 14:21:11 +02:00
stax76
b73d2e7107 new history-filter option added 2022-08-07 13:50:29 +02:00
stax76
a7fa76d63a relative path fix 2022-08-05 07:11:50 +02:00
stax76
e2c720346a fix #480 2022-08-05 06:29:49 +02:00
stax76
01a853e865 Merge pull request #475 from hooke007/doc
bump Manual_chs v6.0.3.1
2022-07-31 06:47:19 +02:00
hooke007
6510de2bd8 bump Manual_chs v6.0.3.1 2022-07-31 01:01:58 +01:00
stax76
7fc1de2ce3 update process-instance description 2022-07-30 13:35:17 +02:00
stax76
b0d399e9ee update changelog 2022-07-30 13:20:39 +02:00
stax76
7f680829ef update changelog 2022-07-30 13:05:30 +02:00
stax76
603f956261 update changelog 2022-07-30 12:55:32 +02:00
stax76
6d06df9004 6.0.3.1 2022-07-30 12:52:19 +02:00
stax76
5ea086d05b Support --audio-file and --sub-file aliases 2022-07-30 11:45:07 +02:00
stax76
1ad819fa9d Fix external audio tracks not shown correctly in tracks context menu 2022-07-30 11:26:45 +02:00
stax76
f2dd6205b5 Merge branch 'master' of https://github.com/stax76/mpv.net 2022-07-27 09:42:02 +02:00
stax76
b2a3c231ff command line syntax is supported in mpv.conf 2022-07-27 09:42:00 +02:00
stax76
f6c223a411 Update issue templates 2022-07-25 09:51:28 +02:00
stax76
e7a2ba6805 Update issue templates 2022-07-25 09:43:58 +02:00
stax76
5a08d9ccd6 Shift key enables process-instance=multi 2022-07-23 08:50:07 +02:00
stax76
5714a5e62a Merge branch 'master' of https://github.com/stax76/mpv.net 2022-07-17 08:04:43 +02:00
stax76
def7e5ac5a misc 2022-07-17 08:04:32 +02:00
stax76
601bb20492 Update FUNDING.yml 2022-07-14 04:31:20 +02:00
stax76
59600df977 update manual 2022-07-13 09:02:51 +02:00
stax76
e1b9730e9b use mpv.net to cycle subtitles 2022-07-12 05:49:05 +02:00
stax76
e378551938 misc 2022-07-11 13:14:26 +02:00
stax76
a82b2ef571 disable unused mpv events 2022-07-11 07:05:50 +02:00
stax76
6157a01701 disable unused mpv events 2022-07-11 06:57:10 +02:00
stax76
ec17ae8ce9 support shortcuts with media file target 2022-07-11 06:14:01 +02:00
stax76
f719528017 fix #293 2022-07-10 10:30:01 +02:00
stax76
966b45eb65 shorten annoying media info titles 2022-07-10 00:49:56 +02:00
stax76
eeae6994a2 remove basic view and enhance advanced view of show-info command 2022-07-09 17:26:49 +02:00
stax76
07809d882f use mpvnet instead of mpv to create playlist from folder 2022-07-08 12:20:36 +02:00
stax76
e970f0b4e4 libmpv shinchiro 2022-07-02 2022-07-08 05:51:06 +02:00
stax76
a36b6a3fdf misc 2022-07-04 08:45:37 +02:00
stax76
4febca257f properly fix OSC hide behavior 2022-07-04 08:32:53 +02:00
stax76
9d493b4d08 store package update 2022-07-03 10:49:13 +02:00
stax76
9a6bf5a481 v6.0.3.0 update changelog 2022-07-03 10:35:39 +02:00
stax76
40565e8b3d fix possible race condition 2022-07-02 15:10:22 +02:00
stax76
fb294c441d 6.0.2.0 2022-07-02 10:19:19 +02:00
stax76
03b775370b window title fix 2022-07-02 09:35:15 +02:00
stax76
1015f87533 changelog fix 2022-06-30 15:19:42 +02:00
stax76
cadc5d65cf 6.0.1.0 2022-06-30 15:00:07 +02:00
stax76
3e2f104aa7 fix #449 2022-06-28 15:17:35 +02:00
stax76
c87ce3b66f fix #449 2022-06-28 07:53:48 +02:00
stax76
3093dd43a4 add smart-volume script to changelog 2022-06-27 15:03:26 +02:00
stax76
061bb39b60 improve changlog 2022-06-25 16:22:05 +02:00
stax76
d994c79d5d fix #372 2022-06-25 16:18:16 +02:00
stax76
9ca66db07b Merge pull request #448 from soredake/patch-1
Add two new keybinds for controlling volume
2022-06-25 16:02:22 +02:00
stax76
4a382d4e29 border issue 2022-06-25 13:56:45 +02:00
stax76
69a5ba4470 Fix #445 chapters that are script created after the media file is loaded 2022-06-25 13:07:17 +02:00
soredake
4a890a4da7 Add two new keybinds for controlling volume
This keybinds is used in mpv, - + are intuitive for controlling volume, but i have compact keyboard without numpad, and pressing + in number row requires me to press it with shift, which i want to avoid.
2022-06-23 21:23:29 +03:00
stax76
023c1db417 recent list path normalization 2022-06-20 19:29:39 +02:00
stax76
7ef1f9315e Width of command palette slightly increased 2022-06-20 19:24:24 +02:00
stax76
a148c88435 new option minimum-aspect-ratio-audio 2022-06-19 18:06:08 +02:00
stax76
f6ad169f9d show Default only when track count is > 1 2022-06-19 08:21:31 +02:00
stax76
e69a5559e8 Fix start-size=session not working 2022-06-19 07:51:30 +02:00
stax76
500fe9abc4 #442 show chapters in the command palette 2022-06-19 05:23:10 +02:00
stax76
55f4a340af setting env var MPVNET_VERSION 2022-06-14 15:09:56 +02:00
stax76
b17ed3675e #334 New support of the mpv option snap-window 2022-06-11 09:32:02 +02:00
stax76
34031fa15d Fix borderless window not resizable with mouse 2022-06-09 21:48:35 +02:00
stax76
d6d31d8ae9 Fix compatibility with mpv-osc-tethys 2022-06-09 19:37:42 +02:00
stax76
0bfee26418 logo change 2022-06-09 10:25:06 +02:00
stax76
71d6b96c10 Fix logo overlap using mordenx.lua 2022-06-09 08:27:45 +02:00
stax76
d1b7250a7a changelog update 2022-06-08 21:39:36 +02:00
stax76
39b81d0664 manual update 2022-06-08 21:05:42 +02:00
stax76
6337818dbc New options autofit-image and autofit-audio 2022-06-08 10:16:40 +02:00
stax76
2257af6294 change minimum-aspect-ratio default value to 0 2022-06-07 23:00:10 +02:00
stax76
572257b645 change minimum-aspect-ratio default value to 1 2022-06-07 22:51:52 +02:00
stax76
6eb82b6b7e Merge pull request #437 from hooke007/doc
bump Manual_chs v6.0.0.0
2022-06-06 19:30:56 +02:00
hooke007
7ef703da42 bump Manual_chs v6.0.0.0 2022-06-06 17:12:09 +01:00
stax76
f7f8aa550a use filtered-metadata option for music osd 2022-06-05 18:55:08 +02:00
stax76
8d693b5e01 fix minor conf editor issue 2022-06-05 17:26:44 +02:00
stax76
e8bc8311e6 add header format to changelog 2022-06-05 16:45:11 +02:00
stax76
19c4a1d6c1 6.0.0.0 Beta 2022-06-05 16:42:47 +02:00
stax76
a53fa7178f libmpv update changelog 2022-06-05 13:09:43 +02:00
stax76
09aee26cd4 Fix logo not hiding sometimes using gpu-api=vulkan 2022-06-05 12:55:53 +02:00
stax76
0c6e486eb0 #435 Fix mpv options not working in case of existing same line comments 2022-06-05 06:40:42 +02:00
stax76
1561ed90f6 remove 'mpv.net' from conf editor definitions that are not specific to mpv.net 2022-06-04 10:31:52 +02:00
stax76
c2f965ced9 improved changelog 2022-06-04 10:06:48 +02:00
stax76
aed524bbc5 Merge pull request #434 from dyphire/track_menu
optimize subtitle format information
2022-06-04 08:42:53 +02:00
dyphire
8cf7e4fd71 optimize subtitle format information 2022-06-04 11:21:06 +08:00
stax76
0ebcf12502 update changelog 2022-06-04 00:32:45 +02:00
stax76
2af13e995f using media info by default 2022-06-04 00:27:17 +02:00
stax76
2e2562fefc shorter media info to better fit on screen 2022-06-04 00:17:56 +02:00
stax76
1860c42114 Merge pull request #433 from dyphire/track_menu
Minor changes to track menu
2022-06-03 23:10:22 +02:00
dyphire
8782ae8ad2 Minor changes 2022-06-04 04:21:07 +08:00
stax76
5d9cde10ce fix issue using external tracks 2022-06-03 21:08:30 +02:00
stax76
2ee2b31bc0 menu fix 2022-06-03 21:02:29 +02:00
stax76
4cd92db141 use new msg model everywhere 2022-06-03 20:23:05 +02:00
stax76
8ee389e8cb misc 2022-06-03 18:38:53 +02:00
stax76
971fe1fe7c - 2022-06-03 15:47:21 +02:00
stax76
e9df0f9f99 - 2022-06-02 20:16:13 +02:00
stax76
d465b13a03 Merge branch 'master' into no-mediainfo 2022-06-02 14:18:07 +02:00
stax76
412d4d7238 Merge pull request #432 from dyphire/track_menu
Optimize track menu.
2022-06-02 14:17:04 +02:00
stax76
1dd93bfcff - 2022-06-02 14:15:02 +02:00
stax76
4ebf241306 shorten mpv.conf preview 2022-06-02 12:37:56 +02:00
dyphire
1a714a39df Optimize track menu
Add encoding information to subtitles

Add title for external tracks, match and replace the filename to avoid too long characters
2022-06-02 11:33:18 +08:00
stax76
b2b387c017 #344 cache and demuxer-max-bytes option added to conf editor 2022-06-01 14:55:04 +02:00
stax76
bf43328e7a require at least 2 characters in conf editor search 2022-06-01 10:16:36 +02:00
stax76
4cba6bb03c fix changelog 2022-05-28 00:54:33 +02:00
stax76
72f9f156b8 fix external tracks 2022-05-27 16:21:42 +02:00
stax76
c78719c3bf Fix #426 external audio and subtitle tracks 2022-05-27 14:07:04 +02:00
stax76
7e4ea640cf Command messages are dispatched with script-message-to mpvnet 2022-05-27 12:20:37 +02:00
stax76
6ddca6d608 minor rewrite 2022-05-26 19:06:32 +02:00
stax76
0fae17b42a support idlelogo 2022-05-26 18:39:44 +02:00
stax76
7e834cea6d Fix #424 media title issues 2022-05-26 11:36:24 +02:00
stax76
6fc546c69c auto-load-folder threading stability 2022-05-22 15:49:25 +02:00
stax76
e8baa21d42 Fix auto-load-folder not working with user scripts 2022-05-22 14:35:43 +02:00
stax76
4c3c65dded #423 Fix chapter time display in menu 2022-05-22 11:48:35 +02:00
stax76
843f7d1a41 manual fix 2022-05-22 09:10:10 +02:00
stax76
673d5a8c0e manual improvement 2022-05-22 09:07:36 +02:00
stax76
6bd4540106 Fix #422 slow startup using osd-scale-by-window=no 2022-05-22 08:22:49 +02:00
stax76
5b57e6214e change profile using command palette 2022-05-22 08:07:48 +02:00
stax76
27f7935127 misc 2022-05-21 10:58:39 +02:00
stax76
cd84819a03 New show-santa-logo (green and grumpy) option 2022-05-21 08:52:44 +02:00
stax76
0efc335232 new quick bookmark feature 2022-05-21 08:31:06 +02:00
stax76
b04fb9b789 input conf use 'V' for 'Open URL or file from clipboard' 2022-05-20 18:18:56 +02:00
stax76
354d5493c4 improved error handling 2022-05-20 14:50:56 +02:00
stax76
3e499befbc Fix #421 crash choosing Matroska edition in the menu. 2022-05-20 14:29:21 +02:00
stax76
bc0fc2a29d Fix auto-play not working with user scripts 2022-05-19 23:17:23 +02:00
stax76
229ace708d minor input.conf change 2022-05-18 11:54:34 +02:00
stax76
2708937554 input.conf duplicate fix 2022-05-17 18:37:31 +02:00
stax76
66654537fe idle fix 2022-05-17 17:10:45 +02:00
stax76
5d16d7b2d1 support mpv idle property partly 2022-05-17 15:05:00 +02:00
stax76
b3ebf85772 Merge pull request #419 from hooke007/doc
bump Manual_chs v5.9.0.0
2022-05-14 14:24:11 +02:00
hooke007
733f0999e1 bump Manual_chs v5.9.0.0 2022-05-13 21:28:25 +01:00
stax76
2aec8856c7 script-opts defaults 2022-05-13 13:39:40 +02:00
36 changed files with 2329 additions and 1608 deletions

1
.github/FUNDING.yml vendored
View File

@@ -1,3 +1,2 @@
github: stax76
patreon: stax76
ko_fi: stax76

View File

@@ -8,3 +8,33 @@ assignees: stax76
---
This template is meant for usage questions of mpv.net.
Some type of questions like questions about a problem require filling out an issue template:
**Describe the problem**
A clear and concise description of what the problem is.
**To Reproduce**
To reproduce, try the last beta version using the CLI option `--config=no`.
In case of an audio or video problem, try to reproduce the problem using mpv instead of mpv.net.
If it can be reproduced with mpv, use the [mpv issue tracker](https://github.com/mpv-player/mpv/issues).
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
1. mpv.net version
2. Windows version
3. GPU name
4. Media info

View File

@@ -11,6 +11,11 @@ assignees: stax76
A clear and concise description of what the bug is.
**To Reproduce**
To reproduce, try the last beta version using the CLI option `--config=no`.
In case of an audio or video issue, try to reproduce the issue using mpv instead of mpv.net.
If it can be reproduced with mpv, use the [mpv issue tracker](https://github.com/mpv-player/mpv/issues).
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
@@ -25,3 +30,7 @@ If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
1. mpv.net version
2. Windows version
3. GPU name
4. Media info

View File

@@ -16,10 +16,6 @@ mpv focuses on the usage of the command line and the terminal,
mpv.net retains the ability to be used from the command line and
the terminal and adds a modern Windows GUI on top of it.
Like mpv, mpv.net is designed for power users, for regular users there is a
[mpv.net-next](https://github.com/mpv-net-player/mpv.net-next)
project under construction.
#### Graphical User Interface
Modern GUI with customizable color themes.
@@ -74,6 +70,7 @@ Features that mpv and mpv.net have in common
--------------------------------------------
- Lua and JavaScript Scripting
- Hundreds available user scripts make mpv the most feature rich desktop video player
- Simple config files that are easy to read and edit
- JSON IPC to control the player with a external programs
- On Screen Controler (OSC, play control buttons) with modern flat design

View File

@@ -1,5 +1,154 @@
5.9.0.0 Beta (2022-05-08)
# v6.0.4.0 Stable (2023-08-17)
- libmpv-2.dll support
- MediaInfo v23.07
- libmpv shinchiro 2023-08-16
# v6.0.3.2 Beta (2022-10-14)
- Support multiple folders input (regression fix).
- Relative file input paths are converted to absolute paths.
- New history-filter option added to define paths to be excluded from the history log feature.
- New command to move the Window to the screen edge (Alt+Arrow) or center (Alt+BS).
- Smaller OSD media info font size and more duplicated and obvious info removed from titles.
- Improved mouse cursor auto hide behavior.
- Fix severe bug causing termination before scripts having a chance reacting to shutdown event.
- mediainfo v22.09.
- libmpv shinchiro 2022-10-14, fixes a severe bug causing hangs:
https://github.com/mpv-player/mpv/pull/10569
input.conf changes:
New:
```
Alt+Left script-message-to mpvnet move-window left #menu: View > Move > Left
Alt+Right script-message-to mpvnet move-window right #menu: View > Move > Right
Alt+Up script-message-to mpvnet move-window top #menu: View > Move > Top
Alt+Down script-message-to mpvnet move-window bottom #menu: View > Move > Bottom
Alt+BS script-message-to mpvnet move-window center #menu: View > Move > Center
```
# 6.0.3.1 (2022-07-30)
- Creating a playlist from a folder uses absolute normalized paths, non-media files are ignored.
- The show-info command shows directly an advanced view, which was enhanced with a General section and the filename.
- Media info titles are shortened if they contain duplicated or obvious information.
- Support of shortcuts (.lnk files) with media file target.
- Support --audio-file and --sub-file aliases.
- playlist-random (F9 key) command jumps to a random playlist entry.
- Fix OSC hide behavior on mouse move.
- New binding (e key) to show the current file in File Explorer.
- Shift key enables process-instance=multi.
- Command line syntax (preceding double hyphen) is supported in mpv.conf for options implemented by mpv.net.
- MediaInfo v22.06
- libmpv shinchiro 2022-07-30
input.conf changes:
New:
```
e run powershell -command "explorer.exe '/select,' ( \"${path}\" -replace '/', '\\' )" #menu: Tools > Show current file in File Explorer
F9 script-message-to mpvnet playlist-random #menu: Navigate > Random File
```
# 6.0.3.0 (2022-07-03)
- Fix the rare occasion of duplicated playlist entries produced by the auto-load-folder feature.
# 6.0.2.0 (2022-07-02)
- Fix main window shown collapsed when the player was started with full screen.
# 6.0.1.0 (2022-06-30)
- New tutorial: [Extending mpv and mpv.net via Lua scripting](https://github.com/mpvnet-player/mpv.net/wiki/Extending-mpv-and-mpv.net-via-Lua-scripting)
- New options `autofit-image` and `autofit-audio`, like autofit, but used for image and audio files.
- New [auto-mode](https://github.com/stax76/mpv-scripts) script to use mpv and mpv.net as image viewer and audio player.
- New [smart-volume](https://github.com/stax76/mpv-scripts) script. Records the volume per file in order to restore it
in future sessions. What is recorded and restored is the volume offset relative to the session average volume.
- New support of the mpv option `snap-window`.
- New feature to show chapters in the command palette, see binding and menu definition below.
- New option minimum-aspect-ratio-audio, same as minimum-aspect-ratio but used for audio files.
- Fix long commands causing key bindings not visible in the command palette.
- Fix script compatibility with mordenx and mpv-osc-tethys.
- Fix borderless window not resizable with mouse.
- Fix start-size=session not working.
- Fix chapters that are script created after the media file is loaded.
- Width of command palette slightly increased.
- The default key bindings for 0 and 9 change the volume, like mpv.
- When a menu item is defined multiple times with different key bindings,
only one menu item is created, it shows all bindings.
- libmpv zhongfly 2022-06-19
input.conf changes:
New:
```
Ctrl+c script-message-to mpvnet show-chapters #menu: View > Show Chapters
```
# 6.0.0.0 Beta (2022-06-05)
- The options `cache` and `demuxer-max-bytes`have been added
to the conf editor.
- Command messages are dispatched with `script-message-to mpvnet`.
- New feature to change profile using the command palette.
- New feature to show media info on screen, the command palette shows
an osd option and the show-info command shows more detailed info
after a second key press. Media info display in the track menu
was also improved. Thanks to dyphire helping with code.
- New `media-info` option allowing to use mpv `track-list`
instead of the media info library.
- New show-santa-logo (green and grumpy) option.
- New quick bookmark feature, see manual.
- Progress command shows time and date.
- When input.conf is created on the very first start and a
script-opts folder does not exist, a script-opts folder
is created with osc and console defaults:
`console-scale=1.5`
`osc-idlescreen=no` (hides the original mpv logo)
`osc-hidetimeout=2000`
`osc-scalewindowed=1.5`
- Support mpv idle property, see manual for remarks.
- Fix external audio and subtitle files not shown in all use cases.
- Fix various mpv options not working in case of existing same line comments.
- Fix crash choosing Matroska edition in the menu.
- Fix auto-play and auto-load-folder not working with user scripts.
- Fix slow startup using `osd-scale-by-window=no`.
- Fix URL shown instead of media title on file change OSD,
in recent menu and in recent command palette.
- Fix chapter time display in menu.
- Fix incorrect startup window size using gpu-api=vulkan.
- Fix logo not hiding sometimes using gpu-api=vulkan.
- libmpv shinchiro 2022-06-05
input.conf changes:
Old:
```
F9 show-text ${track-list} 5000 #menu: View > Show Tracks
```
New:
```
F9 script-message-to mpvnet show-media-info osd #menu: View > Show Tracks
Ctrl+p script-message-to mpvnet select-profile #menu: View > Show Profile Selection
Alt+q script-message-to mpvnet quick-bookmark
```
All occurrences of `script-message mpv.net` were changed to `script-message-to mpvnet`.
# 5.9.0.0 Beta (2022-05-08)
- Fix startup without media file not working with gpu-api=vulkan.
- Fix keyboard layout change not working.
@@ -25,11 +174,11 @@
- 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
https://github.com/mpvnet-player/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
https://github.com/mpvnet-player/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
@@ -59,10 +208,10 @@
- Fix script-opts files being ignored.
- Showing the recent list in the command palette,
the top item gets auto selected.
https://github.com/stax76/mpv.net/issues/328#issuecomment-1057296054
https://github.com/mpvnet-player/mpv.net/issues/328#issuecomment-1057296054
- If the play list is empty, the most recent file
gets loaded when pressing space.
https://github.com/stax76/mpv.net/issues/328#issuecomment-1057296054
https://github.com/mpvnet-player/mpv.net/issues/328#issuecomment-1057296054
- Ctrl+v (previously u) opens files (or URLs) from the clipboard,
previously it had to be a file path (format string) and now
it can also be the clipboard format of type file.
@@ -431,27 +580,27 @@ stable release, no changes since the last beta
https://mpv.io/manual/master/#legacy-option-syntax
- new: PowerShell script host was completely rewritten, events can be assigned
by using `Register-ObjectEvent`, the scripting wiki page was updated
https://github.com/stax76/mpv.net/wiki/Scripting#powershell
https://github.com/mpvnet-player/mpv.net/wiki/Scripting#powershell
- new: Context Menu > View > Show Profiles
https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L147
https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L147
- new: Context Menu > View > Show Properties
https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L148
https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L148
- new: Context Menu > View > Show Commands
https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L149
https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L149
- new: config editor tab is now remembered
- new: osd-duration setting added to config editor and default mpv.conf
- new: external console replaced with internal console, in case mpv.conf is missing it's
generated with correct Hight DPI font size scale settings.
`script-opts=console-scale=<dpiscale>`
https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L150
https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L150
https://mpv.io/manual/master/#console
- new: blue color in dark theme is now less intense
https://github.com/stax76/mpv.net/blob/master/Manual.md#color-theme
https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md#color-theme
- new: menu item 'View > Show Progress' (p key) to show progress bar
https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L146
https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L146
- new: `script-message mpv.net playlist-first`, unlike mpv does not
restart if the first file is already active
https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L44
https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L44
- new: if mpv.net is started from the terminal and an error happens then the error
is printed to the terminal instead of shown with a message box
- fix: update routine did only work when mpv.net was located in 'Program Files'
@@ -468,7 +617,7 @@ stable release, no changes since the last beta
- new: update check, it must be enabled first in the conf editor under General
- new: update feature, requires PowerShell 5 and curl,
an up to date Windows 10 system has both included.
Main menu (input.conf) must be reset or updated manually ([defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt))
Main menu (input.conf) must be reset or updated manually ([defaults](https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt))
- update: libmpv shinchiro 2019-11-10
@@ -477,17 +626,17 @@ stable release, no changes since the last beta
- fix: the file association routine uses no longer 'Play with mpv.net' for the
default open verb caption because it doesn't support multi selection,
it shows now only Open, the manual explains how to get multi selection
in File Explorer, read about it [here](https://github.com/stax76/mpv.net/blob/master/Manual.md#open-with)
in File Explorer, read about it [here](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md#open-with)
- fix: x86 builds had an older version included because
of a misconfiguration in the solution file
### 5.4.3.0
- new: the color themes can now be customized ([manual](https://github.com/stax76/mpv.net/blob/master/Manual.md#color-theme))
- new: three new sections were added to the [manual](https://github.com/stax76/mpv.net/blob/master/Manual.md):
1. [Color Theme](https://github.com/stax76/mpv.net/blob/master/Manual.md#color-theme)
2. [Hidden and secret features](https://github.com/stax76/mpv.net/blob/master/Manual.md#hidden-and-secret-features)
3. [External Tools](https://github.com/stax76/mpv.net/blob/master/Manual.md#external-tools)
- new: the color themes can now be customized ([manual](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md#color-theme))
- new: three new sections were added to the [manual](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md):
1. [Color Theme](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md#color-theme)
2. [Hidden and secret features](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md#hidden-and-secret-features)
3. [External Tools](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md#external-tools)
- fix: window restore from maximized and from minimized was broken
- fix: it's possible to multi select files in File Explorer and press
@@ -507,13 +656,13 @@ stable release, no changes since the last beta
context menu item in explorer with multi selection support use my
[Open with++](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist) shell extension, as far as I know multi selection
can not be done using the Registry but only via shell extension
- window-size mpv property support added ([default bindings](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L137))
- window-size mpv property support added ([default bindings](https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L137))
- the config editor keeps profiles and comments in mpv.conf intact!
- the options in the config editor are better organized
### 5.4.2
- new: the [scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting#powershell) was improved
- new: the [scripting wiki page](https://github.com/mpvnet-player/mpv.net/wiki/Scripting#powershell) was improved
- new: Toggle Shuffle has been added to the menu defaults
- new: for URLs the media title is shown in the title bar and in the info command
instead of displaying the URL, mpv.conf defaults were changed to use
@@ -581,7 +730,7 @@ stable release, no changes since the last beta
### 5.1
- many [wiki pages](https://github.com/stax76/mpv.net/wiki) were improved
- many [wiki pages](https://github.com/mpvnet-player/mpv.net/wiki) were improved
- the logo/icon had a very small cosmetic change
- the help in the context menu was improved,
for quick access consider the command palette (F1 key)
@@ -615,7 +764,7 @@ stable release, no changes since the last beta
### 5.0
- [changed icon design](https://github.com/stax76/mpv.net/blob/master/img/mpvnet.png)
- [changed icon design](https://github.com/mpvnet-player/mpv.net/blob/master/img/mpvnet.png)
- libmpv was updated to shinchiro 2019-07-14
- new or improved config editor settings: screenshot-directory,
screenshot-format, screenshot-tag-colorspace, screenshot-high-bit-depth,
@@ -634,7 +783,7 @@ stable release, no changes since the last beta
the script is located at startup/scripts
- terminal support added using mpvnet.com !
- script engine performance and error handling was improved
- the [scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting) was improved
- the [scripting wiki page](https://github.com/mpvnet-player/mpv.net/wiki/Scripting) was improved
- the C# scripting host extension was converted from VB to C# because it's not
only used for hosting but I also use it now to code and debug script code
- there was a copy paste bug in the file association feature resulting in keys
@@ -704,7 +853,7 @@ stable release, no changes since the last beta
pressed, the files are opened as selected, the order is random though
because Explorer starts multiple mpv.net processes concurrently
- libmpv was updated to shinchiro 2019-06-30
- the [mpv.conf defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpv.conf.txt) were changed to show a larger OSC
- the [mpv.conf defaults](https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/mpv.conf.txt) were changed to show a larger OSC
- in case a file is opened that has a aspect ratio smaller then 1.2 then
the window size will use a aspect ratio of 1.8
- new JavaScript script osc-visibility.js included in the distribution
@@ -722,7 +871,7 @@ stable release, no changes since the last beta
- invalid command-line arguments were ignored, now an error message is shown
- a description on how to start mpv.net from Google Chrome was added to the
manual, it's useful to play videos from sites like YouTube, find the
description [here](https://github.com/stax76/mpv.net/blob/master/Manual.md#chrome-extension)
description [here](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md#chrome-extension)
- new config setting remember-height added to remember the window height,
otherwise the video's native resolution is used
- support for protocols other then http added
@@ -737,13 +886,13 @@ stable release, no changes since the last beta
- the playlist is never cleared whenever the control key is down but
files and URLs are appended instead
- powershell script hosting bugs were fixed and a new powershell example script
was added to the [scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting#powershell)
was added to the [scripting wiki page](https://github.com/mpvnet-player/mpv.net/wiki/Scripting#powershell)
- the menu entry for the command palette was renamed to 'Show All Commands' and
the default key binding was changed to F1 which is also the default in VS Code
- the default key binding of the Everything media search was changed to F3
- support for the mpv property 'border' was added to the config editor
to show/hide the window decoration (titlebar, border). A toggle menu item and
key binding (b) was added as well ([Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L135))
key binding (b) was added as well ([Default Binding](https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L135))
### 4.3.1
@@ -758,7 +907,7 @@ stable release, no changes since the last beta
- the help and layout in the config editor was improved
- clipboard monitoring for URLs can be disabled in the settings
- the context menu has a new feature: Open > Add files to playlist,
it appends files to the playlist [(Default binding)](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L33)
it appends files to the playlist [(Default binding)](https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L33)
- a setting was added to force using a single mpv.net process instance
### 4.1
@@ -773,7 +922,7 @@ stable release, no changes since the last beta
- on the start screen the mpv.NET icon is shown instead of the mpv icon,
feedback and contributions regarding the icon are welcome! The paint.net
pdn and png source is located [here](https://github.com/stax76/mpv.net/tree/master/img)
pdn and png source is located [here](https://github.com/mpvnet-player/mpv.net/tree/master/img)
- everytime only one file is opened the complete folder is loaded in the playlist
- the info command (i key) shows the audio format
- new options osd-font-size, sub-font, sub-font-size
@@ -800,7 +949,7 @@ stable release, no changes since the last beta
- there was a bug that caused underscores beeing removed from input like MBTN_LEFT_DBL
- the search clear button in the input editor had a render issue in dark mode
- new search feature added to search and play media files, requires
[Everything](https://www.voidtools.com) to be installed. [Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L29)
[Everything](https://www.voidtools.com) to be installed. [Default Binding](https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L29)
### 3.5
@@ -813,6 +962,6 @@ stable release, no changes since the last beta
### 3.4
- new feature added to manage file associations from within the app. It can be found in the menu at: Tools > Manage... [Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L149)
- new feature added to manage file associations from within the app. It can be found in the menu at: Tools > Manage... [Default Binding](https://github.com/mpvnet-player/mpv.net/blob/master/mpv.net/Resources/input.conf.txt#L149)
- new zip download option added
- new x86 download option added

View File

@@ -42,9 +42,7 @@ mpv focuses on the usage of the command line and the terminal,
mpv.net retains the ability to be used from the command line and
the terminal and adds a modern Windows GUI on top of it.
Like mpv, mpv.net is designed for power users, for regular users there is a
[mpv.net-next](https://github.com/mpv-net-player/mpv.net-next)
project under construction.
Like mpv, mpv.net is designed for power users.
Download
@@ -63,9 +61,11 @@ Installation
mpv.net requires the .NET Framework 4.8 and Windows 7 or higher and a modern graphics card.
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.
Internet streaming requires:
- Downloading [yt-dlp](https://github.com/yt-dlp/yt-dlp) and adding its folder
to the [user environment variable PATH](https://www.google.com/search?q=user+environment+variable+PATH).
- In case of proxy server usage, [manual configuration](https://github.com/mpvnet-player/mpv.net/issues/401).
#### File Associations
@@ -88,12 +88,21 @@ the files are opened in mpv.net in random order, this works with maximum 15 file
Support
-------
Before making a support request, please try the newest version first.
Before making a support request, please try the newest [beta version](../../../releases) 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.
Support can be requested here:
Or use the [support thread](https://forum.videohelp.com/threads/392514-mpv-net-a-extendable-media-player-for-windows) in the VideoHelp forum.
Beginner questions:
https://www.reddit.com/r/mpv
mpv.net bug reports, feature requests and advanced questions:
https://github.com/mpvnet-player/mpv.net/issues
Advanced mpv questions:
https://github.com/mpv-player/mpv/issues
Settings
@@ -132,7 +141,7 @@ The input key list can be printed with --input-keylist or
shown from the context menu under: View > Advanced > Show Keys
mpv.net input.conf defaults:
https://github.com/stax76/mpv.net/blob/master/src/Resources/input.conf.txt
https://github.com/mpvnet-player/mpv.net/blob/master/src/Resources/input.conf.txt
mpv input.conf defaults:
https://github.com/mpv-player/mpv/blob/master/etc/input.conf
@@ -219,7 +228,7 @@ A common task for the terminal is debugging scripts.
mpv.net specific commands
-------------------------
`script-message mpv.net <command> <arguments>`
`script-message-to mpvnet <command> <arguments>`
mpv.net commands are used when mpv commands don't exist or lack a feature.
@@ -232,13 +241,13 @@ Shows a file browser dialog to open external audio files.
### load-sub
Shows a file browser dialog to open external subtitle files.
### move-window [left|top|right|bottom|center]
Moves the Window to the screen edge (Alt+Arrow) or center (Alt+BS).
### 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.
@@ -271,12 +280,24 @@ already the first entry, nothing happens.
Jumps to the last playlist entry, if the loaded file is
already the last entry, nothing happens.
### playlist-random
Jumps to a random playlist entry.
### quick-bookmark
On the first press a bookmark is saved, on the second
press it is restored and removed. When a new file is
loaded the bookmark is removed.
### reg-file-assoc \<audio|video|image\>
Registers the file associations.
### scale-window \<factor\>
Decreases or increases the Window size.
### select-profile
Shows the command palette to select a profile.
### shell-execute \<file|URL\>
Shell executes a single file or URL.
@@ -290,11 +311,14 @@ Shows available audio devices in a message box.
Shows available audio tracks in the command palette
and allows to load the selected audio track.
### show-chapters
Shows chapters in the command palette.
### show-command-palette
Shows the command palette.
### show-commands
Shows available mpv imput commands.
Shows available mpv input commands.
### show-conf-editor
Shows the conf editor.
@@ -309,9 +333,6 @@ Shows available demuxers.
Shows the history file when existing.
### show-info
Shows a simple file info.
### show-input-editor
Shows the input editor.
@@ -320,11 +341,14 @@ Shows available keys (as shown with `--input-keylist`) in the command palette.
### show-media-info [\<flags\>]
**msgbox**
Shows media info in a messsge box.
Shows media info in a messsage box.
**editor**
Shows media info in the text editor.
**osd**
Displays media info on screen.
**full**
Shows fully detailed media info.
@@ -342,7 +366,7 @@ and allows to play the selected entry.
Shows available profiles with a message box.
### show-progress
Shows a simple OSD progress message.
Shows a simple OSD progress message with time and date.
### show-properties
Shows available properties in the command palette and
@@ -373,6 +397,12 @@ mpv.net specific options can be found in the conf editor searching for 'mpv.net'
The options are saved in the mpvnet.conf file.
#### --autofit-audio \<integer\>
Initial window height in percent for audio files. Default: 70
#### --autofit-image \<integer\>
Initial window height in percent for image files. Default: 80
#### --queue \<files\>
Adds files to the playlist, requires [--process-instance=single](#--process-instancevalue).
@@ -417,22 +447,24 @@ 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
Minimum aspect ratio of the window. Useful to force
a wider window and therefore a larger OSC.
#### --minimum-aspect-ratio-audio=\<float\>
Same as minimum-aspect-ratio but used for audio files.
#### --remember-window-position=\<yes|no\>
Save the window position on exit. Default: no
#### --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
### Playback
@@ -446,10 +478,6 @@ Can be suppressed via shift key. Default: yes
If the player is paused and another file is loaded,
playback automatically resumes.
#### --keep-open-exit
If set to yes and keep-open is set to no, mpv.net exits after the last file ends.
In mpv the idle property would be used, it's not possible for mpv.net to use the idle property.
### General
@@ -457,10 +485,12 @@ In mpv the idle property would be used, it's not possible for mpv.net to use the
Defines if more then one mpv.net process is allowed.
Tip: Whenever the CTRL key is pressed when files or URLs are opened,
Whenever the CTRL key is pressed when files or URLs are opened,
the playlist is not cleared but the files or URLs are appended to the playlist.
This not only works on process startup but in all mpv.net features that open files and URLs.
Multi can alternatively be enabled by pressing the SHIFT key.
**multi**
Create a new process everytime the shell starts mpv.net.
@@ -474,6 +504,14 @@ Force a single process and add files to playlist.
Amount of recent files to be remembered. Default: 15
#### --media-info=\<yes|no\>
Usage of the media info library instead of mpv to access media information. Default: yes (mpv.net specific option)
#### --history-filter
Semicolon separated list of paths to be excluded from the history log feature.
#### --video-file-extensions=\<string\>
Video file extensions used to create file associations and used by the auto-load-folder feature.
@@ -519,9 +557,12 @@ Color theme used in light mode. Default: light
#### --show-logo=\<yes|no\>
Draws the blue mpv.net logo ontop of the native OSC logo.
Changes take effect after application restart. Default: yes
Draws the blue mpv.net logo ontop of the native OSC logo. Default: yes
#### --show-santa-logo=\<yes|no\>
Draws the blue mpv.net logo with a santa hat in december,
the option is called greenandgrumpy in mpv. Default: yes
External Tools
--------------
@@ -547,31 +588,6 @@ Alternatively the Chrome/Firefox extension [Open With](../../../issues/119) can
[Open with++](https://github.com/stax76/OpenWithPlusPlus) can be used to extend the File Explorer context menu to get menu items for [Play with mpv.net](https://github.com/stax76/OpenWithPlusPlus#play-with-mpvnet) and [Add to mpv.net playlist](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist).
### Universal Remote Android app
Universal Remote is Android remote control app which costs 5 €.
https://www.unifiedremote.com
https://play.google.com/store/apps/details?id=com.Relmtech.Remote
https://play.google.com/store/apps/details?id=com.Relmtech.RemotePaid
https://www.unifiedremote.com/tutorials/how-to-create-a-custom-keyboard-shortcuts-remote
https://www.unifiedremote.com/tutorials/how-to-install-a-custom-remote
[My config](./Universal%20Remote)
Very useful is the Universal Remote File Browser feature.
### One For All Contour URC1210 and FLIRC USB
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
@@ -587,64 +603,28 @@ Scripting
#### Lua
File Type: `lua`
A very large collection of Lua user scripts can be found in the mpv wiki [here](https://github.com/mpv-player/mpv/wiki/User-Scripts).
Location: `<config folder>\scripts`
The Lua script host is built into libmpv.
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 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)
Lua scripting is documented in the mpv.net wiki [here](https://github.com/mpvnet-player/mpv.net/wiki/Extending-mpv-and-mpv.net-via-Lua-scripting).
#### JavaScript
File Type: `js`
Location: `<config folder>\scripts`
The JavaScript script host is built into libmpv.
Error and debug messages are printed on the terminal.
JavaScript scripts are loaded before the first media file loads.
[mpv JavaScript documentation](https://mpv.io/manual/master/#javascript)
[mpv user scripts](https://github.com/mpv-player/mpv/wiki/User-Scripts)
#### PowerShell
File Type: `ps1`
Location: `<config folder>\scripts-ps`
The PowerShell scripting host is like extensions not
initialized before media files are loaded.
mpv.net does not define scripting interfaces but instead exposed
its complete internals, there are no compatibility guaranties.
The PowerShell scripting host is not initialized before media files are loaded.
[Example Scripts](../../../tree/master/src/Scripts)
#### C#
File Type: `cs`
Location: `<config folder>\scripts-cs`
mpv.net does not define scripting interfaces but instead exposed
its complete internals, there are no compatibility guaranties.
There are no compatibility guaranties.
Script code can be written within a C# [extension](../../../tree/master/src/Extensions),
that way full code completion and debugger support is available.
@@ -653,6 +633,10 @@ from the extension to a lightweight standalone script.
The script host uses an old C# version, modern features
like string interpolation are not available.
There are synchronous and asynchronous events, prefer asynchronous events
and don't block synchronous events and observed properties, as it would
block the main event loop.
The C# scripting host is like [extensions](../../../tree/master/src/Extensions)
not initialized before media files are loaded.
@@ -669,9 +653,9 @@ and the filename must have the same name as the directory:
<config folder>\extensions\ExampleExtension\ExampleExtension.dll
```
mpv.net does not define extension interfaces but instead exposed
its complete internals, there are no compatibility guaranties.
There are synchronous and asynchronous events, prefer asynchronous events
and don't block synchronous events and observed properties, as it would
block the main event loop.
### Walkthrough creating an extension
@@ -778,6 +762,7 @@ https://mpv.io/manual/master/#window
- [keepaspect-window](https://mpv.io/manual/master/#options-keepaspect-window)
- [ontop](https://mpv.io/manual/master/#options-ontop)
- [screen](https://mpv.io/manual/master/#options-screen)
- [snap-window](https://mpv.io/manual/master/#options-snap-window)
- [title](https://mpv.io/manual/master/#options-title)
- [window-maximized](https://mpv.io/manual/master/#options-window-maximized)
- [window-minimized](https://mpv.io/manual/master/#options-window-minimized)
@@ -786,10 +771,12 @@ https://mpv.io/manual/master/#window
**Partly implemented are:**
- [autofit-larger](https://mpv.io/manual/master/#options-autofit-larger)
- [autofit-smaller](https://mpv.io/manual/master/#options-autofit-smaller)
- [autofit](https://mpv.io/manual/master/#options-autofit)
- [autofit-larger](https://mpv.io/manual/master/#options-autofit-larger)
Supported is a single integer value in the range 0-100.
- [autofit-smaller](https://mpv.io/manual/master/#options-autofit-smaller)
Supported is a single integer value in the range 0-100.
- [autofit](https://mpv.io/manual/master/#options-autofit)
Supported is a single integer value in the range 0-100.
mpv.net specific window features are documented in the [screen section](#screen).
@@ -809,6 +796,13 @@ need an own implementation in mpv.net, so far implemented are:
--vd=help
--version
### Other Limitations
The mpv property [idle](https://mpv.io/manual/master/#options-idle) can be
used and mpv.net functions accordingly, but Lua scripts always see `idle=yes`
because mpv.net has to set it to function correctly, this is a difficult
to overcome libmpv limitation.
### mpv.net specific options
@@ -845,7 +839,7 @@ located in the config directory.
If the input.conf file does not exists mpv.net generates it with the following defaults:
<https://github.com/stax76/mpv.net/tree/master/src/Resources/input.conf.txt>
<https://github.com/mpvnet-player/mpv.net/tree/master/src/Resources/input.conf.txt>
input.conf defines mpv's key and mouse bindings and mpv.net uses
comments to define the context menu.
@@ -1238,7 +1232,7 @@ Adds a negative audio delay using the following command:
Shows the next subtitle track using the following command:
`cycle sub`
`script-message-to mpvnet cycle-subtitles`
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cname%3E-[%3Cvalue%3E])
@@ -1574,7 +1568,7 @@ Shows the [mpv.net web site](https://mpv-net.github.io/mpv.net-web-site/).
### Help > Show mpv.net manual
Shows the [mpv.net manual](https://github.com/stax76/mpv.net/blob/master/Manual.md).
Shows the [mpv.net manual](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md).
### Help > About mpv.net

View File

@@ -2,7 +2,7 @@
mpv.net手册
==============
同步源提交_[20220402](https://github.com/stax76/mpv.net/commit/27dc98af2195622d3443cc048b3c856c5238b9f5)
适配版本 [Master_commit_220819](https://github.com/mpvnet-player/mpv.net/commit/22960af78b7e1b7255954d845b3d378330aa449b)
**[ENGLISH](Manual.md)** | **简体中文**
@@ -36,11 +36,12 @@ mpv.net手册
mpv.net是基于受欢迎的mpv的Windows现代媒体播放器。
mpv.net出于兼容mpv而设计几乎所有mpv的功能都可用因为它们都包含在libmpv中
这意味着[mpv官方手册](https://mpv.io/manual/master/) 也适用于mpv.net。
mpv.net出于兼容mpv而设计几乎所有mpv的功能都可用因为它们都包含在libmpv中这意味着[mpv官方手册](https://mpv.io/manual/master/) 也适用于mpv.net。
mpv专注命令行与终端的使用而mpv.net保留了这些并加入了现代化的图形界面。
与mpv一样mpv.net也是为高级用户设计的。
下载
--------
@@ -59,37 +60,42 @@ mpv专注命令行与终端的使用而mpv.net保留了这些并加入了现
mpv.net需要.NET Framework 4.8运行库和高于win7版本的系统以及一张不太旧的显卡。
对于来自YouTube和类似网站的网络流必须将yt-dlp复制到mpv.net的文件夹中
或编辑用户环境变量PATH使其包括yt-dlp的文件夹。
互联网流媒体需要:
- 下载[yt-dlp](https://github.com/yt-dlp/yt-dlp)并将其添加到[用户环境变量PATH](https://www.google.com/search?q=user+environment+variable+PATH)
- 在使用代理服务器的情况下,需要[手动配置](https://github.com/mpvnet-player/mpv.net/issues/401)。
#### 文件关联
可以使用上下文菜单注册文件关联。 'Settings > Setup'
注册完文件关联后,进入 "Windows设置 > 应用 > 默认应用" (Win+I, ms-settings:defaultapps)
然后选择mpv. net作为视频/音频/图像的默认程序。
注册完文件关联后,进入 "Windows设置 > 应用 > 默认应用" (Win+I, ms-settings:defaultapps) 然后选择mpv. net作为视频/音频/图像的默认程序。
另一种注册文件关联的方式是使用文件资源管理器,选中媒体文件后,
选择上下文菜单的 '打开方式 > 选择其它应用' 。
另一种注册文件关联的方式是使用文件资源管理器,选中媒体文件后,选择上下文菜单的 '打开方式 > 选择其它应用' 。
[Open with++](#open-with) 可用来扩展资源管理器的上下文菜单
[Play with mpv.net](https://github.com/stax76/OpenWithPlusPlus#play-with-mpvnet) 和
[Add to mpv.net playlist](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist).
可用来获取 'Play with mpv.net' 和 'Add to mpv.net playlist' 的菜单子项
[Open with++](#open-with) 可用来扩展资源管理器的上下文菜单。[Play with mpv.net](https://github.com/stax76/OpenWithPlusPlus#play-with-mpvnet) 和 [Add to mpv.net playlist](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist) 可用来获取 'Play with mpv.net' 和 'Add to mpv.net playlist' 的菜单子项
当在资源管理器中选择多个文件并按 enter 键时文件会在mpv.net随机排序打开
最多限制15个文件。
当在资源管理器中选择多个文件并按 enter 键时文件会在mpv.net随机排序打开最多限制15个文件。
支持
-------
在提出支持请求之前,先尝试最新的测试版
在提出支持请求之前,先尝试最新的 [测试版](../../../releases)
程序错误和功能请求可以在github的 [问题追踪](../../../issues) 上提出,
任何与mpv. net相关的东西都可以使用欢迎提交使用上出现的问题。
可以在这些地方请求支持:
或者浏览VideoHelp论坛的 [讨论帖](https://forum.videohelp.com/threads/392514-mpv-net-a-extendable-media-player-for-windows)
初学者提问:
https://www.reddit.com/r/mpv
mpv.net的错误报告、功能请求和高级问题
https://github.com/mpvnet-player/mpv.net/issues
高级的mpv问题
https://github.com/mpv-player/mpv/issues
设置
@@ -100,20 +106,15 @@ mpv.net在以下路径寻找设置文件夹
1. <程序启动目录>\portable_config
2. %APPDATA%\mpv.net (`C:\Users\%USERNAME%\AppData\Roaming\mpv.net`)
mpv的选项保存在mpv.conf文件中
mpv.net的专属选项保存在 mpvnet.conf 文件中,
参数解释请参阅 [此处](#mpvnet的专属选项)
mpv的选项保存在mpv.conf文件中mpv.net的专属选项保存在 mpvnet.conf 文件中,参数解释请参阅 [此处](#mpvnet的专属选项)
快捷键和上下文菜单
----------------------
键鼠的快捷键和上下文菜单的操作保存在 input.conf 文件中,
如果设置目录中不存在mpv.net会用默认值生成它。
键鼠的快捷键和上下文菜单的操作保存在 input.conf 文件中,如果设置目录中不存在mpv.net会用默认值生成它。
请注意,一旦 input.conf 存在, mpv.net 就不能更新它,这意味着当 mpv.net 升级了
新的版本或改变了的默认菜单项时,菜单条目就会过时。获得最新菜单的唯一方法是
通过删除 input.conf 来重置菜单,或者通过手动编辑 input.conf 来更新它。
请注意,一旦 input.conf 存在, mpv.net 就不能更新它,这意味着当 mpv.net 升级了新的版本或改变了的默认菜单项时,菜单条目就会过时。获得最新菜单的唯一方法是通过删除 input.conf 来重置菜单,或者通过手动编辑 input.conf 来更新它。
通过 global-input.conf 文件支持全局热键。
@@ -123,11 +124,10 @@ input 和 config editor 可以在上下文菜单的该条目中找到 'Settings'
输入测试模式可以通过命令行启动: --input-test
输入的键位列表可由该参数输出 --input-keylist
或从上下文菜单的该条目获取 `View > Advanced > Show Keys`
输入的键位列表可由该参数输出 --input-keylist 或从上下文菜单的该条目获取 `View > Advanced > Show Keys`
mpv.net的默认input.conf文件
https://github.com/stax76/mpv.net/blob/master/src/Resources/input.conf.txt
https://github.com/mpvnet-player/mpv.net/blob/master/src/Resources/input.conf.txt
mpv的默认input.conf文件
https://github.com/mpv-player/mpv/blob/master/etc/input.conf
@@ -212,7 +212,7 @@ mpv有一些基于非属性的开关在mpv.net中一般不受支持。
mpv.net的专属命令
-------------------------
`script-message mpv.net <command> <arguments>`
`script-message-to mpvnet <command> <arguments>`
mpv.net命令可在mpv命令不存在或缺乏某种功能时使用。
@@ -225,22 +225,20 @@ mpv.net命令可在mpv命令不存在或缺乏某种功能时使用。
### load-sub
显示一个资源管理器的对话框来加载外部字幕文件。
### move-window [left|top|right|bottom|center]
将窗口移动到屏幕边缘 (Alt+方向键) 或中心 (Alt+Backspace)。
### open-conf-folder
用Windows资源管理器打开配置文件夹。
### open-files [\<flags\>]
**no-folder**
对于单个文件,防止将文件夹内的全部文件加载到播放列表中。
**append**
追加文件到播放列表中。
打开一个资源管理器的对话框,以便选择要打开的文件。资源管理器的对话框支持多选以
一次性加载多个文件。按住CTRL键可以将这些文件追加到播放列表中。
打开一个资源管理器的对话框,以便选择要打开的文件。资源管理器的对话框支持多选以一次性加载多个文件。按住CTRL键可以将这些文件追加到播放列表中。
### open-optical-media
显示一个资源管理器的对话框来打开一个DVD或BD文件夹。ISO镜像不需要被挂载
但可以直接用 open-files 命令打开。
显示一个资源管理器的对话框来打开一个DVD或BD文件夹。ISO镜像不需要被挂载但可以直接用 open-files 命令打开。
### open-clipboard
从剪贴板打开单个的URL或文件路径或以文件剪贴板中的格式打开多个文件。
@@ -248,18 +246,30 @@ mpv.net命令可在mpv命令不存在或缺乏某种功能时使用。
### play-pause
循环切换 pause 的属性。如果播放列表为空,将加载最近文件列表中的最新文件。
### playlist-add \<integer\>
通过指定的整数值来跳转播放的条目。如果已到达末尾则它会跳到开头,反之亦然。
### playlist-first
跳转到播放列表的第一个条目,如果加载的文件已经是第一个条目,则无动作。
### playlist-last
跳转到播放列表的最后一个条目,如果加载的文件已经是最后一个条目,则无动作。
### playlist-random
跳转到播放列表的任一条目。
### quick-bookmark
第一次触发时,书签被保存,第二次触发时,它被恢复并移除。当加载新文件时,书签也会被移除。
### reg-file-assoc \<audio|video|image\>
注册文件关联。
### scale-window \<factor\>
减小或增大窗口的尺寸。
### select-profile
显示命令面板以选择一个profile。
### shell-execute \<file|URL\>
Shell执行单个文件或URL。
@@ -272,6 +282,9 @@ Shell执行单个文件或URL。
### show-audio-tracks
在命令面板中显示可用的音轨,并允许加载选中的音轨。
### show-chapters
在命令面板中显示章节。
### show-command-palette
显示命令面板。
@@ -290,9 +303,6 @@ Shell执行单个文件或URL。
### show-history
显示已有的历史文件。
### show-info
显示一个简易的文件信息。
### show-input-editor
显示器快捷键编辑器。
@@ -306,6 +316,9 @@ Shell执行单个文件或URL。
**editor**
在一个文本编辑器中显示mediainfo
**osd**
OSD上显示mediainfo
**full**
显示mediainfo的完整细节
@@ -322,7 +335,7 @@ Shell执行单个文件或URL。
用一个信息框显示可用的profile
### show-progress
显示一个简易的OSD进度条信息。
显示一个简易的OSD进度条信息,附带时间和日期
### show-properties
在命令面板中显示可用的属性,并允许显示所选属性的值。
@@ -350,15 +363,19 @@ mpv.net的专属选项
这些专属选项被修改后被保存在 mpvnet.conf 文件中。
#### --autofit-audio \<integer\>
音频文件的初始窗口高度以百分比为单位。默认70
#### --autofit-image \<integer\>
图片文件的初始窗口高度以百分比为单位。默认80
#### --queue \<files\>
添加文件到播放列表,需要设置 [--process-instance=single](#--process-instancevalue) 。
也可以在资源管理器中使用 [Open with++](#open-with) 添加文件。
添加文件到播放列表,需要设置 [--process-instance=single](#--process-instancevalue) 。也可以在资源管理器中使用 [Open with++](#open-with) 添加文件。
#### --command=\<input command\>
通过命令行向正在运行的mpv.net实例发送输入命令例如使用 AutoHotkey 创建全局热键,
必须设置 [process-instance=single](#--process-instancevalue) 。
通过命令行向正在运行的mpv.net实例发送输入命令例如使用 AutoHotkey 创建全局热键,必须设置 [process-instance=single](#--process-instancevalue) 。
### Audio
@@ -395,16 +412,14 @@ mpv.net的专属选项
始终记住大小。
#### --start-threshold=\<milliseconds\>
在显示窗口之前等待libmpv返回视频分辨率的阈值毫秒
否则将使用由 --autofit 和 --start-size 定义的初始大小。默认1500
#### --minimum-aspect-ratio=\<float\>
最小宽高比,如果窗口宽高比小于定义的值,那么将窗口宽高比设置为16/9
这避免了音乐封面的方形窗口。默认1.2
最小宽高比,如果窗口宽高比小于定义的值,那么将窗口宽高比将被强制设为该值
#### --minimum-aspect-ratio-audio=\<float\>
同上但仅用于音频文件。
#### --remember-window-position=\<yes|no\>
@@ -412,6 +427,11 @@ mpv.net的专属选项
在退出时保存窗口的位置。默认no
#### --start-threshold=\<milliseconds\>
在显示窗口之前等待libmpv返回视频分辨率的阈值毫秒否则将使用由 --autofit 和 --start-size 定义的初始大小。默认1500
### Playback
#### --auto-load-folder=\<yes|no\>
@@ -430,8 +450,9 @@ mpv.net的专属选项
定义是否允许多个 mpv.net 进程。
提示:当打开文件或 url 时只要按下CTRL键就不会清除当前的播放列表
而只将文件或 url 追加到列表中。这不仅适用于进程启动,也适用于所有打开文件和 url 的功能。
当打开文件或 url 时只要按下CTRL键就不会清除当前的播放列表而只将文件或 url 追加到列表中。这不仅适用于进程启动,也适用于所有打开文件和 url 的功能。
也可以通过按住SHIFT键来启动多个进程。
**multi**
每次从 shell 启动 mpv.net 时创建一个新进程。
@@ -448,6 +469,14 @@ mpv.net的专属选项
最近文件的记录数量。默认15
#### --media-info=\<yes|no\>
使用MediaInfo而不是mpv来访问媒体信息。默认yes
#### --history-filter
要从历史日志功能中排除的路径的分号分隔列表。
#### --video-file-extensions=\<string\>
用于创建文件关联的视频文件扩展名,由自动加载文件夹的功能使用。
@@ -500,7 +529,12 @@ mpv.net的专属选项
#### --show-logo=\<yes|no\>
在原始OSC标志的基础上绘制蓝色的mpvnet图标。更改将在应用程序重新启动后生效。默认yes
在原始OSC标志的基础上绘制蓝色的mpvnet图标。默认yes
#### --show-santa-logo=\<yes|no\>
在12月绘制蓝色的mpvnet图标时使用圣诞彩蛋。默认yes
外部工具
@@ -508,17 +542,13 @@ mpv.net的专属选项
### Play with mpv
[Play with mpv](https://chrome.google.com/webstore/detail/play-with-mpv/hahklcmnfgffdlchjigehabfbiigleji)
是一个支持调用mpv播放YouTube等网站视频的谷歌浏览器的扩展。
[Play with mpv](https://chrome.google.com/webstore/detail/play-with-mpv/hahklcmnfgffdlchjigehabfbiigleji) 是一个支持调用mpv播放YouTube等网站视频的谷歌浏览器的扩展。
由于Chrome扩展无法启动一个应用程序需要另一个与扩展程序通信的应用程序该程序可以从
[此处](http://www.mediafire.com/file/lezj8lwqt5zf75v/play-with-mpvnet-server.7z/file)下载。
只有当该程序运行时扩展才能正常工作,为了让应用程序始终运行,应将其放在系统自启动目录中:
由于Chrome扩展无法启动一个应用程序需要另一个与扩展程序通信的应用程序该程序可以从[此处](http://www.mediafire.com/file/lezj8lwqt5zf75v/play-with-mpvnet-server.7z/file)下载。只有当该程序运行时扩展才能正常工作,为了让应用程序始终运行,应将其放在系统自启动目录中:
`C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`
这将使该程序随系统共同启动并在后台运行。当mpv.net的文件关联注册被执行后
该程序应该会找到mpv.net的位置或者将mpv.net文件夹添加到环境变量PATH。
这将使该程序随系统共同启动并在后台运行。当mpv.net的文件关联注册被执行后该程序应该会找到mpv.net的位置或者将mpv.net文件夹添加到环境变量PATH。
### Open With
@@ -528,35 +558,7 @@ mpv.net的专属选项
### Open with++
[Open with++](#open-with) 可用来扩展资源管理器的上下文菜单
[Play with mpv.net](https://github.com/stax76/OpenWithPlusPlus#play-with-mpvnet) 和
[Add to mpv.net playlist](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist).
可用来获取 'Play with mpv.net' 和 'Add to mpv.net playlist' 的菜单子项
### Universal Remote 安卓应用
Universal Remote 是一个收费的安卓远程控制APP。
https://www.unifiedremote.com
https://play.google.com/store/apps/details?id=com.Relmtech.Remote
https://play.google.com/store/apps/details?id=com.Relmtech.RemotePaid
https://www.unifiedremote.com/tutorials/how-to-create-a-custom-keyboard-shortcuts-remote
https://www.unifiedremote.com/tutorials/how-to-install-a-custom-remote
[我的配置](./Universal%20Remote)
Universal Remote 的 File Browser 功能十分有用。
### One For All Contour URC1210 and FLIRC USB
然而我的主要远程控制解决方案适用于所有人,
Philips code 0556 和 FLIRC USB (gen2) 一同被使用。
[Open with++](#open-with) 可用来扩展资源管理器的上下文菜单。[Play with mpv.net](https://github.com/stax76/OpenWithPlusPlus#play-with-mpvnet) 和 [Add to mpv.net playlist](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist) 可用来获取 'Play with mpv.net' 和 'Add to mpv.net playlist' 的菜单子项
### External Application Button
@@ -573,66 +575,34 @@ args: `-- pwsh -NoLogo -Command "yt-dlp --ignore-errors --download-archive 'C:\E
#### Lua
文件类型: `lua`
可以在 [mpv wiki](https://github.com/mpv-player/mpv/wiki/User-Scripts) 中找到一个庞大的用户Lua脚本的集合。
文件位置: `<config folder>\scripts`
Lua脚本的host由libmpv内建。
错误和调试消息输出在终端上。
Lua脚本在第一个媒体文件打开之前加载。
[mpv Lua 文档](https://mpv.io/manual/master/#lua-scripting)
[mpv 用户脚本 wiki](https://github.com/mpv-player/mpv/wiki/User-Scripts)
[mpv 用户脚本 GitHub](https://github.com/topics/mpv-script)
[mpv 用户脚本 Google](https://www.google.com/search?q=mpv+script)
Lua脚本在 [mpv.net wiki](https://github.com/mpvnet-player/mpv.net/wiki/Extending-mpv-and-mpv.net-via-Lua-scripting) 上有进一步记录。
#### JavaScript
文件类型: `js`
文件位置: `<config folder>\scripts`
JavaScriptLua脚本的host由libmpv内建。
错误和调试消息输出在终端上。
JavaScript脚本在第一个媒体文件打开之前加载。
[mpv JavaScript 文档](https://mpv.io/manual/master/#javascript)
[mpv用户脚本](https://github.com/mpv-player/mpv/wiki/User-Scripts)
#### PowerShell
文件类型: `ps1`
文件位置: `<config folder>\scripts-ps`
PS脚本的host类似于扩展在打开媒体文件前尚未初始化。
mpv.net没有定义脚本接口而是公开了它的完整内部没有兼容性保证。
PS脚本在打开媒体文件前尚未初始化。
[示例脚本](../../../tree/master/src/Scripts)
#### C#
文件类型: `cs`
文件位置: `<config folder>\scripts-cs`
mpv.net没有定义脚本接口而是公开了它的完整内部没有兼容性保证。
没有兼容性保证。
脚本代码可以在C#[扩展](../../../tree/master/src/Extensions)中编写,这样就可以获得
完整的代码和调试器支持。一旦代码被调试和开发完成,就可以将其从扩展转移到轻量级的独立脚本。
脚本host使用的是旧的C#版本,像字符串插值这样的现代功能是不存在的
脚本代码可以在C#[扩展](../../../tree/master/src/Extensions)中编写,这样就可以获得完整的代码和调试器支持。一旦代码被调试和开发完成就可以将其从扩展转移到轻量级的独立脚本。脚本host使用的是旧的C#版本,像字符串插值这样的现代功能是不存在的。
有同步事件和异步事件,更偏好异步事件,不要阻断同步事件和观察到的属性,因为这样会阻断主事件循环
C#脚本的host类似于[扩展](../../../tree/master/src/Extensions),在打开媒体文件前尚未初始化。
@@ -648,7 +618,7 @@ C#脚本的host类似于[扩展](../../../tree/master/src/Extensions),在打
<config folder>\extensions\ExampleExtension\ExampleExtension.dll
```
mpv.net没有定义脚本接口而是公开了它的完整内部没有兼容性保证
有同步事件和异步事件,更偏好异步事件,不要阻断同步事件和观察到的属性,因为这样会阻断主事件循环
### 创建扩展演示
@@ -656,14 +626,9 @@ mpv.net没有定义脚本接口而是公开了它的完整内部没有兼
- 下载安装 [Visual Studio Community](https://visualstudio.microsoft.com) 。
- 创建新的项目类型 **Class Library .NET Framework** 并确保项目名称以 **Extension** 作结尾。
- 增加一个 reference 到 **System.ComponentModel.Composition**.
- 增加一个 reference 到 mpvnet.exe ,在 Solution Explorer 中选择 mpvnet 的 reference
打开 Properties 窗口并设置 **Copy Local** 为 false 来阻止在项目编译时 mpvnet.exe 被复制到输出目录。
- 现在打开 project properties 并在 Build 标签页设置 output path
扩展类似于位于配置文件夹中的脚本,例如:
`<config folder>\extensions\ExampleExtension\ExampleExtension.dll`
- 同样在 project properties 的 Debug 标签页中选择选项 **Start external program**
并且定义到 mpvnet.exe 的路径。
在 Debug 标签页中你还可以定义 command line arguments ,例如开始调试时要播放的视频文件。
- 增加一个 reference 到 mpvnet.exe ,在 Solution Explorer 中选择 mpvnet 的 reference 打开 Properties 窗口并设置 **Copy Local** 为 false 来阻止在项目编译时 mpvnet.exe 被复制到输出目录。
- 现在打开 project properties 并在 Build 标签页设置 output path ,扩展类似于位于配置文件夹中的脚本,例如: `<config folder>\extensions\ExampleExtension\ExampleExtension.dll`
- 同样在 project properties 的 Debug 标签页中选择选项 **Start external program** 并且定义到 mpvnet.exe 的路径。在 Debug 标签页中你还可以定义 command line arguments ,例如开始调试时要播放的视频文件。
### 代码样本
@@ -712,11 +677,9 @@ Python和VapourSynth必须在环境变量PATH中。
隐藏功能
---------------
使用mpv.net在资源管理器中选择多个文件并按下回车键打开。
资源管理器将此限制为最多15个并且顺序将是随机的。
使用mpv.net在资源管理器中选择多个文件并按下回车键打开。资源管理器将此限制为最多15个并且顺序将是随机的。
当打开文件或url时只要按下CTRL键就不会清除播放列表而是将文件或url附加到播放列表中。
这适用于mpv.net的所有打开文件或url的功能。
当打开文件或url时只要按下CTRL键就不会清除播放列表而是将文件或url附加到播放列表中。这适用于mpv.net的所有打开文件或url的功能。
在打开单个文件时按下SHIFT键将禁止该文件夹的其它文件添加到播放列表中。
@@ -747,6 +710,7 @@ https://mpv.io/manual/master/#window
- [keepaspect-window](https://mpv.io/manual/master/#options-keepaspect-window)
- [ontop](https://mpv.io/manual/master/#options-ontop)
- [screen](https://mpv.io/manual/master/#options-screen)
- [snap-window](https://mpv.io/manual/master/#options-snap-window)
- [title](https://mpv.io/manual/master/#options-title)
- [window-maximized](https://mpv.io/manual/master/#options-window-maximized)
- [window-minimized](https://mpv.io/manual/master/#options-window-minimized)
@@ -756,8 +720,11 @@ https://mpv.io/manual/master/#window
**部分支持的属性:**
- [autofit](https://mpv.io/manual/master/#options-autofit)
仅支持0-100范围内的整数
- [autofit-smaller](https://mpv.io/manual/master/#options-autofit-smaller)
同上
- [autofit-larger](https://mpv.io/manual/master/#options-autofit-larger)
同上
mpv.net的专属窗口功能在 [屏幕设置](#screen) 部分。
@@ -777,6 +744,11 @@ mpv.net支持基于属性的mpv命令行选项这意味着它支持mpv几乎
--version
### 其它限制
mpv的属性 [idle](https://mpv.io/manual/master/#options-idle) 在mpv.net中也会相应的发挥作用但是LUA脚本获取到的值始终是 `yes` 因为mpv.net必须设置它才能正常工作这是一个难以攻克的来自libmpv的限制。
### mpv.net的专属选项
在config editor中输入 `mpv.net` 检索这些选项,在[此处](#mpvnet的专属选项)的手册中有对应说明。
@@ -789,8 +761,7 @@ mpv.net的专属选项保存在 mpvnet.conf 文件中与mpv一样可由命令
mpv.net使用 C#7 编写并且需要 .NET Framework 4.8 来运行。
扩展的实现基于
[Managed Extensibility Framework](https://docs.microsoft.com/en-us/dotnet/framework/mef/).
扩展的实现基于 [Managed Extensibility Framework](https://docs.microsoft.com/en-us/dotnet/framework/mef/)
主窗口基于WinForms与WPF相比对libmpv集成的更友好所有其他窗口都是基于WPF的。
@@ -807,7 +778,7 @@ mpv.net的上下文菜单由设置目录中的文件 input.conf 定义。
如果 input.conf 文件不存在mpv.net由以下文件生成默认
<https://github.com/stax76/mpv.net/tree/master/src/Resources/input.conf.txt>
<https://github.com/mpvnet-player/mpv.net/tree/master/src/Resources/input.conf.txt>
input.conf 定义mpv的快捷键同时mpv.net使用注释定义上下文菜单。
@@ -820,8 +791,7 @@ input.conf 定义mpv的快捷键同时mpv.net使用注释定义上下文菜
第三种方法是拖放文件到主窗口上。
每当打开文件或URL时按下控制键时播放列表不会被清除但文件或URL会追加到播放列表中。
这适用于所有打开文件或URL的mpv.net的功能。
每当打开文件或URL时按下控制键时播放列表不会被清除但文件或URL会追加到播放列表中。这适用于所有打开文件或URL的mpv.net的功能。
在打开单个文件时按shift键将临时禁止加载文件夹中的其它文件。
@@ -840,14 +810,12 @@ input.conf 定义mpv的快捷键同时mpv.net使用注释定义上下文菜
### Open > Load external audio files
允许加载外部音轨文件。也可以根据文件名自动检测,该选项可在下面的设置中找到
'Settings > Show Config Editor > Audio > audio-file-auto' 。
允许加载外部音轨文件。也可以根据文件名自动检测,该选项可在下面的设置中找到 'Settings > Show Config Editor > Audio > audio-file-auto'
### Open > Load external subtitle files
允许加载外部字幕文件。也可以根据文件名自动检测,该选项可在下面的设置中找到
'Settings > Show Config Editor > Subtitles > sub-auto' 。
允许加载外部字幕文件。也可以根据文件名自动检测,该选项可在下面的设置中找到 'Settings > Show Config Editor > Subtitles > sub-auto'
### Play/Pause
@@ -945,8 +913,7 @@ input.conf 定义mpv的快捷键同时mpv.net使用注释定义上下文菜
`no-osd seek sec`
sec是跳转的相对秒数使用no osd前缀是因为mpv.net包含一个脚本
该脚本显示执行寻道操作时的位置,该脚本使用更简单的时间格式。
sec是跳转的相对秒数使用no osd前缀是因为mpv.net包含一个脚本该脚本显示执行寻道操作时的位置,该脚本使用更简单的时间格式。
[no-osd command prefix](https://mpv.io/manual/master/#command-interface-no-osd)
@@ -1190,7 +1157,7 @@ sec是跳转的相对秒数使用no osd前缀是因为mpv.net包含一个脚
使用以下命令改变到下一个可用的字幕轨:
`cycle sub`
`script-message-to mpvnet cycle-subtitles`
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cname%3E-[%3Cvalue%3E])
@@ -1469,8 +1436,7 @@ input.conf 文件内涵mpv的键鼠绑定
### Tools > Show History
显示包含历史记录的文本文件。如果文件不存在,则会询问是否在设置文件夹中创建该文件。
一旦文件存在,则写入历史记录(包括时间和文件名)
显示包含历史记录的文本文件。如果文件不存在,则会询问是否在设置文件夹中创建该文件。一旦文件存在,则写入历史记录(包括时间和文件名)
屏蔽部分路径的参数:
@@ -1524,7 +1490,7 @@ script-opt = history-discard=path1;path2
### Help > Show mpv.net manual
显示 [mpv.net手册](https://github.com/stax76/mpv.net/blob/master/Manual.md).
显示 [mpv.net手册](https://github.com/mpvnet-player/mpv.net/blob/master/Manual.md).
### Help > About mpv.net

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<row>
<button text="PLAY" ontap="play" />
<button text="PREV" ontap="prev" />
<button text="NEXT" ontap="next" />
<button text="Enter" ontap="enter" />
</row>
<row>
<button text="LEFT" ontap="left" />
<button text="RIGHT" ontap="right" />
<button text="UP" ontap="up" />
<button text="DOWN" ontap="down" />
</row>
<row>
<button text="VOL-" ontap="vol_minus" />
<button text="VOL+" ontap="vol_plus" />
<button text="MUTE" ontap="mute" />
<button text="INFO" ontap="info" />
</row>
<row>
<button text="KP0" ontap="KP0" />
<button text="KP1" ontap="KP1" />
<button text="KP2" ontap="KP2" />
<button text="KP3" ontap="KP3" />
<button text="KP4" ontap="KP4" />
</row>
<row>
<button text="KP5" ontap="KP5" />
<button text="KP6" ontap="KP6" />
<button text="KP7" ontap="KP7" />
<button text="KP8" ontap="KP8" />
<button text="KP9" ontap="KP9" />
</row>
<row>
<button text="Cycle Audio" ontap="KP7" />
<button text="Cycle Subtitle" ontap="KP8" />
<button text="AB LOOP" ontap="ab_loop" />
</row>
<row>
<button text="ZOOM IN" ontap="zoom_in" />
<button text="ZOOM OUT" ontap="zoom_out" />
</row>
</layout>

View File

@@ -1,5 +0,0 @@
meta.name: custom keys
meta.author: stax76
meta.description: custom keys
meta.tags: mpv

View File

@@ -1,106 +0,0 @@
-- https://github.com/unifiedremote/Docs/blob/master/libs/keyboard.md
-- https://github.com/unifiedremote/Docs/blob/master/res/keys.md
local kb = libs.keyboard;
actions.play = function ()
kb.stroke("space");
end
actions.next = function ()
kb.stroke("F12");
end
actions.prev = function ()
kb.stroke("F11");
end
actions.enter = function ()
kb.stroke("enter");
end
actions.left = function ()
kb.stroke("left");
end
actions.right = function ()
kb.stroke("right");
end
actions.up = function ()
kb.stroke("up");
end
actions.down = function ()
kb.stroke("down");
end
actions.vol_minus = function ()
kb.text("-");
end
actions.vol_plus = function ()
kb.text("+");
end
actions.mute = function ()
kb.stroke("m");
end
actions.info = function ()
kb.stroke("i");
end
actions.KP0 = function ()
kb.stroke("num0");
end
actions.KP1 = function ()
kb.stroke("num1");
end
actions.KP2 = function ()
kb.stroke("num2");
end
actions.KP3 = function ()
kb.stroke("num3");
end
actions.KP4 = function ()
kb.stroke("num4");
end
actions.KP5 = function ()
kb.stroke("num5");
end
actions.KP6 = function ()
kb.stroke("num6");
end
actions.KP7 = function ()
kb.stroke("num7");
end
actions.KP8 = function ()
kb.stroke("num8");
end
actions.KP9 = function ()
kb.stroke("num9");
end
actions.ab_loop = function ()
kb.stroke("l");
end
actions.zoom_in = function ()
kb.stroke("ctrl", "oem_plus");
end
actions.zoom_out = function ()
kb.stroke("ctrl", "oem_minus");
end

View File

@@ -14,6 +14,8 @@ namespace mpvnet
{
public static List<string> TempFiles { get; } = new List<string>();
public static string[] HistoryFilter { get; set; }
public static string ConfPath { get => Core.ConfigFolder + "mpvnet.conf"; }
public static string ProcessInstance { get; set; } = "single";
public static string DarkMode { get; set; } = "always";
@@ -24,17 +26,23 @@ namespace mpvnet
public static bool AutoLoadFolder { get; set; } = true;
public static bool AutoPlay { get; set; }
public static bool DebugMode { get; set; }
public static bool Exit { get; set; }
public static bool IsTerminalAttached { get; } = Environment.GetEnvironmentVariable("_started_from_console") == "yes";
public static bool KeepOpenExit { get; set; }
public static bool MediaInfo { get; set; } = true;
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 bool ShowSantaLogo { get; set; } = true;
public static int StartThreshold { get; set; } = 1500;
public static int RecentCount { get; set; } = 15;
public static float MinimumAspectRatio { get; set; } = 1.2f;
public static float AutofitAudio { get; set; } = 0.7f;
public static float AutofitImage { get; set; } = 0.8f;
public static float MinimumAspectRatio { get; set; }
public static float MinimumAspectRatioAudio { get; set; }
public static float QuickBookmark { get; set; }
public static Extension Extension { get; set; }
@@ -133,7 +141,7 @@ namespace mpvnet
public static string Version => "Copyright (C) 2000-2022 mpv.net/mpv/mplayer\n" +
$"mpv.net {Application.ProductVersion}" + GetLastWriteTime(Application.ExecutablePath) + "\n" +
$"{Core.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "mpv-2.dll") + "\n" +
$"{Core.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "libmpv-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";
@@ -238,12 +246,16 @@ namespace mpvnet
case "audio-file-extensions": CorePlayer.AudioTypes = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;
case "auto-load-folder": AutoLoadFolder = value == "yes"; return true;
case "auto-play": AutoPlay = value == "yes"; return true;
case "autofit-audio": AutofitAudio = value.Trim('%').ToInt() / 100f; return true;
case "autofit-image": AutofitImage = value.Trim('%').ToInt() / 100f; return true;
case "dark-mode": DarkMode = value; return true;
case "dark-theme": DarkTheme = value.Trim('\'', '"'); return true;
case "debug-mode": DebugMode = value == "yes"; return true;
case "history-filter": HistoryFilter = value.Split(';'); return true;
case "image-file-extensions": CorePlayer.ImageTypes = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;
case "keep-open-exit": KeepOpenExit = value == "yes"; return true;
case "light-theme": LightTheme = value.Trim('\'', '"'); return true;
case "media-info": MediaInfo = value == "yes"; return true;
case "minimum-aspect-ratio-audio": MinimumAspectRatioAudio = value.ToFloat(); return true;
case "minimum-aspect-ratio": MinimumAspectRatio = value.ToFloat(); return true;
case "process-instance": ProcessInstance = value; return true;
case "queue": Queue = value == "yes"; return true;
@@ -251,9 +263,11 @@ namespace mpvnet
case "remember-volume": RememberVolume = value == "yes"; return true;
case "remember-window-position": RememberWindowPosition = value == "yes"; return true;
case "show-logo": ShowLogo = value == "yes"; return true;
case "show-santa-logo": ShowSantaLogo = value == "yes"; return true;
case "start-size": StartSize = value; return true;
case "start-threshold": StartThreshold = value.ToInt(); return true;
case "video-file-extensions": CorePlayer.VideoTypes = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;
default:
if (writeError)
Terminal.WriteError($"unknown mpvnet.conf property: {name}");
@@ -269,5 +283,16 @@ namespace mpvnet
if (File.Exists(dir + "mpvnet.exe") && !File.Exists(dir + "mpvnet.com"))
File.Copy(Folder.Startup + "mpvnet.com", dir + "mpvnet.com");
}
public static (string Title, string Path) GetTitleAndPath(string input)
{
if (input.Contains("|"))
{
var a = input.Split('|');
return (a[1], a[0]);
}
return (input, input);
}
}
}

View File

@@ -25,7 +25,7 @@ namespace mpvnet
static void Execute(string file)
{
string code = File.ReadAllText(file);
string filename = Path.GetFileNameWithoutExtension(file) + " " + StringHelp.GetMD5Hash(code) + ".dll";
string filename = Path.GetFileNameWithoutExtension(file) + " " + StringHelp.GetMD5Hash(code) + "-v6.dll";
string outputFile = Path.Combine(Path.GetTempPath(), filename);
if (!File.Exists(outputFile))

View File

@@ -6,15 +6,15 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;
using System.Windows.Media;
using WinForms = System.Windows.Forms;
using static mpvnet.Global;
using System.Windows.Media;
using System.Text.RegularExpressions;
namespace mpvnet
{
@@ -24,26 +24,29 @@ namespace mpvnet
{
switch (id)
{
case "add-files-to-playlist": OpenFiles("append"); break; // deprecated 2019
case "cycle-audio": CycleAudio(); break;
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 "cycle-subtitles": CycleSubtitles(); break;
case "load-audio": LoadAudio(); break;
case "load-sub": LoadSubtitle(); break;
case "move-window": MoveWindow(args[0]); 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": OpenFromClipboard(); break; // deprecated 2022
case "play-pause": PlayPause(); break;
case "playlist-add": PlaylistAdd(Convert.ToInt32(args[0])); break;
case "playlist-first": PlaylistFirst(); break;
case "playlist-last": PlaylistLast(); break;
case "playlist-random": PlaylistRandom(); break;
case "quick-bookmark": QuickBookmark(); break;
case "reg-file-assoc": RegisterFileAssociations(args[0]); break;
case "scale-window": ScaleWindow(float.Parse(args[0], CultureInfo.InvariantCulture)); break;
case "select-profile": SelectProfile(); break;
case "shell-execute": ProcessHelp.ShellExecute(args[0]); break;
case "show-about": ShowDialog(typeof(AboutWindow)); break;
case "show-audio-devices": Msg.ShowInfo(Core.GetPropertyOsdString("audio-device-list")); break;
case "show-audio-tracks": ShowAudioTracks(); break;
case "show-chapters": ShowChapters(); break;
case "show-command-palette": ShowCommandPalette(); break;
case "show-commands": ShowCommands(); break;
case "show-conf-editor": ShowDialog(typeof(ConfWindow)); break;
@@ -61,12 +64,20 @@ namespace mpvnet
case "show-properties": ShowProperties(); break;
case "show-protocols": ShowStrings(mpvHelp.GetProtocols().Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)); break;
case "show-recent": ShowRecent(); break;
case "show-setup-dialog": ShowSetupDialog(); break; // deprecated 2022
case "show-subtitle-tracks": ShowSubtitleTracks(); break;
case "show-text": ShowText(args[0], Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); break;
case "window-scale": WindowScale(float.Parse(args[0], CultureInfo.InvariantCulture)); break;
default: Terminal.WriteError($"No command '{id}' found, reset input.conf by deleting it."); break;
// deprecated 2019
case "add-files-to-playlist": OpenFiles("append"); break;
// deprecated 2020
case "execute-mpv-command": Msg.ShowError("command was removed, reset input.conf by deleting it, in the new menu use the on screen console."); break;
case "key-binding": if (args[0] == "show-playlist") ShowPlaylist(); break;
// deprecated 2022
case "show-setup-dialog": ShowSetupDialog(); break;
case "open-url": OpenFromClipboard(); break;
}
}
@@ -88,21 +99,15 @@ namespace mpvnet
public static void OpenFiles(params string[] args)
{
bool append = Control.ModifierKeys.HasFlag(Keys.Control);
bool loadFolder = true;
foreach (string arg in args)
{
if (arg == "append")
append = true;
if (arg == "no-folder")
loadFolder = false;
}
App.InvokeOnMainThread(new Action(() => {
using (var d = new OpenFileDialog() { Multiselect = true })
if (d.ShowDialog() == DialogResult.OK)
Core.LoadFiles(d.FileNames, loadFolder, append);
Core.LoadFiles(d.FileNames, true, append);
}));
}
@@ -116,18 +121,15 @@ namespace mpvnet
public static void PlaylistFirst()
{
int pos = Core.GetPropertyInt("playlist-pos");
if (pos != 0)
if (Core.PlaylistPos != 0)
Core.SetPropertyInt("playlist-pos", 0);
}
public static void PlaylistLast()
{
int pos = Core.GetPropertyInt("playlist-pos");
int count = Core.GetPropertyInt("playlist-count");
if (pos < count - 1)
if (Core.PlaylistPos < count - 1)
Core.SetPropertyInt("playlist-pos", count - 1);
}
@@ -156,8 +158,8 @@ namespace mpvnet
ProcessHelp.ShellExecute(Core.ConfigFolder + "history.txt");
else
{
if (Msg.ShowQuestion("Create history.txt file in config folder?" + BR2 +
"mpv.net will write the date, time and filename of opened files to it.") == MessageBoxResult.OK)
if (Msg.ShowQuestion("Create a 'history.txt' file in the config folder?" + BR2 +
"mpv.net will write the date, time, play length and path of watched files to it.") == MessageBoxResult.OK)
File.WriteAllText(Core.ConfigFolder + "history.txt", "");
}
@@ -165,77 +167,51 @@ namespace mpvnet
public static void ShowInfo()
{
try
if (Core.PlaylistPos == -1)
return;
string text;
long fileSize = 0;
string path = Core.GetPropertyString("path");
if (File.Exists(path))
{
string performer, title, album, genre, date, duration, text = "";
long fileSize = 0;
string path = Core.GetPropertyString("path");
if (path.Contains("://"))
path = Core.GetPropertyString("media-title");
if (File.Exists(path))
if (CorePlayer.AudioTypes.Contains(path.Ext()))
{
text = Core.GetPropertyOsdString("filtered-metadata");
Core.CommandV("show-text", text, "5000");
return;
}
else if (CorePlayer.ImageTypes.Contains(path.Ext()))
{
fileSize = new FileInfo(path).Length;
text = "Width: " + Core.GetPropertyInt("width") + "\n" +
"Height: " + Core.GetPropertyInt("height") + "\n" +
"Size: " + Convert.ToInt32(fileSize / 1024.0) + " KB\n" +
"Type: " + path.Ext().ToUpper();
if (CorePlayer.AudioTypes.Contains(path.Ext()))
{
using (MediaInfo mediaInfo = new MediaInfo(path))
{
performer = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Performer");
title = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Title");
album = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Album");
genre = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Genre");
date = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Recorded_Date");
duration = mediaInfo.GetInfo(MediaInfoStreamKind.Audio, "Duration/String");
if (performer != "") text += "Artist: " + performer + "\n";
if (title != "") text += "Title: " + title + "\n";
if (album != "") text += "Album: " + album + "\n";
if (genre != "") text += "Genre: " + genre + "\n";
if (date != "") text += "Year: " + date + "\n";
if (duration != "") text += "Length: " + duration + "\n";
text += "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n";
text += "Type: " + path.Ext().ToUpper();
Core.CommandV("show-text", text, "5000");
return;
}
}
else if (CorePlayer.ImageTypes.Contains(path.Ext()))
{
using (MediaInfo mediaInfo = new MediaInfo(path))
{
text =
"Width: " + mediaInfo.GetInfo(MediaInfoStreamKind.Image, "Width") + "\n" +
"Height: " + mediaInfo.GetInfo(MediaInfoStreamKind.Image, "Height") + "\n" +
"Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n" +
"Type: " + path.Ext().ToUpper();
Core.CommandV("show-text", text, "5000");
return;
}
}
Core.CommandV("show-text", text, "5000");
return;
}
else
{
Core.Command("script-message-to mpvnet show-media-info osd");
return;
}
string videoFormat = Core.GetPropertyString("video-format").ToUpper();
string audioCodec = Core.GetPropertyString("audio-codec-name").ToUpper();
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");
}
catch (Exception e)
{
App.ShowException(e);
}
if (path.Contains("://")) path = Core.GetPropertyString("media-title");
string videoFormat = Core.GetPropertyString("video-format").ToUpper();
string audioCodec = Core.GetPropertyString("audio-codec-name").ToUpper();
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");
}
static string FormatTime(double value) => ((int)value).ToString("00");
@@ -248,7 +224,8 @@ namespace mpvnet
string text = FormatTime(position.TotalMinutes) + ":" +
FormatTime(position.Seconds) + " / " +
FormatTime(duration.TotalMinutes) + ":" +
FormatTime(duration.Seconds);
FormatTime(duration.Seconds) + " " +
DateTime.Now.ToString("H:mm dddd d MMMM", CultureInfo.InvariantCulture);
Core.CommandV("show-text", text, "5000");
}
@@ -263,15 +240,19 @@ namespace mpvnet
else
{
string clipboard = WinForms.Clipboard.GetText();
List<string> files = new List<string>();
if (string.IsNullOrEmpty(clipboard) || (!clipboard.Contains("://") && !File.Exists(clipboard)) ||
clipboard.Contains("\n"))
foreach (string i in clipboard.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
if (i.Contains("://") || File.Exists(i))
files.Add(i);
if (files.Count == 0)
{
App.ShowError("The clipboard does not contain a valid URL or file.");
return;
}
Core.LoadFiles(new [] { clipboard }, false, Control.ModifierKeys.HasFlag(Keys.Control));
Core.LoadFiles(files.ToArray(), false, Control.ModifierKeys.HasFlag(Keys.Control));
}
});
@@ -311,26 +292,61 @@ namespace mpvnet
public static void CycleAudio()
{
MediaTrack[] audioTracks = Core.MediaTracks.Where(track => track.Type == "a").ToArray();
int len = audioTracks.Length;
Core.UpdateExternalTracks();
if (len < 1)
lock (Core.MediaTracksLock)
{
Core.CommandV("show-text", "No audio tracks");
return;
MediaTrack[] tracks = Core.MediaTracks.Where(track => track.Type == "a").ToArray();
if (tracks.Length < 1)
{
Core.CommandV("show-text", "No audio tracks");
return;
}
int aid = Core.GetPropertyInt("aid");
if (tracks.Length > 1)
{
if (++aid > tracks.Length)
aid = 1;
Core.SetPropertyInt("aid", aid);
}
Core.CommandV("show-text", aid + "/" + tracks.Length + ": " + tracks[aid - 1].Text.Substring(3), "5000");
}
}
int aid = Core.GetPropertyInt("aid");
public static void CycleSubtitles()
{
Core.UpdateExternalTracks();
if (len > 1)
lock (Core.MediaTracksLock)
{
if (++aid > len)
aid = 1;
MediaTrack[] tracks = Core.MediaTracks.Where(track => track.Type == "s").ToArray();
Core.CommandV("set", "aid", aid.ToString());
if (tracks.Length < 1)
{
Core.CommandV("show-text", "No subtitles");
return;
}
int sid = Core.GetPropertyInt("sid");
if (tracks.Length > 1)
{
if (++sid > tracks.Length)
sid = 0;
Core.SetPropertyInt("sid", sid);
}
if (sid == 0)
Core.CommandV("show-text", "No subtitle");
else
Core.CommandV("show-text", sid + "/" + tracks.Length + ": " + tracks[sid - 1].Text.Substring(3), "5000");
}
Core.CommandV("show-text", aid + "/" + len + ": " + audioTracks[aid - 1].Text.Substring(3), "5000");
}
public static void ShowCommands()
@@ -360,7 +376,7 @@ namespace mpvnet
public static void ScaleWindow(float factor) => Core.RaiseScaleWindow(factor);
public static void WindowScale(float value) => Core.RaiseWindowScale(value);
public static void WindowScale(float value) => Core.RaiseWindowScaleNET(value);
public static void ShowText(string text, int duration = 0, int fontSize = 0)
{
@@ -382,10 +398,11 @@ namespace mpvnet
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") };
("Show text box", "script-message-to mpvnet show-media-info default"),
("Show text editor", "script-message-to mpvnet show-media-info editor"),
("Show on screen", "script-message-to mpvnet show-media-info osd"),
("Show full", "script-message-to mpvnet show-media-info editor full"),
("Show raw", "script-message-to mpvnet show-media-info editor full raw") };
var list = pairs.Select(i => new CommandPaletteItem(i.Name, () => Core.Command(i.Value)));
CommandPalette.Instance.SetItems(list);
@@ -395,27 +412,36 @@ namespace mpvnet
}
string path = Core.GetPropertyString("path");
string text = "";
if (File.Exists(path) && !path.Contains(@"\\.\pipe\"))
{
bool full = args.Contains("full");
bool raw = args.Contains("raw");
bool editor = args.Contains("editor");
bool osd = args.Contains("osd");
if (App.MediaInfo && !osd && File.Exists(path) && !path.Contains(@"\\.\pipe\"))
using (MediaInfo mediaInfo = new MediaInfo(path))
{
bool full = args.Contains("full");
bool raw = args.Contains("raw");
bool editor = args.Contains("editor");
text = Regex.Replace(mediaInfo.GetSummary(full, raw), "Unique ID.+", "");
else
{
Core.UpdateExternalTracks();
text = "N: " + Core.GetPropertyString("filename") + BR;
lock (Core.MediaTracksLock)
foreach (MediaTrack track in Core.MediaTracks)
text += track.Text + BR;
}
string text = mediaInfo.GetSummary(full, raw);
text = Regex.Replace(text, "Unique ID.+", "");
text = text.TrimEx();
if (editor)
ShowTextWithEditor("media-info", text);
else
{
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Consolas");
Msg.ShowInfo(text);
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Segoe UI");
}
}
if (editor)
ShowTextWithEditor("media-info", text);
else if (osd)
ShowText(text.Replace("\r", ""), 5000, 16);
else
{
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Consolas");
Msg.ShowInfo(text);
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Segoe UI");
}
});
@@ -428,72 +454,81 @@ namespace mpvnet
public static void ShowAudioTracks() => App.InvokeOnMainThread(() =>
{
MediaTrack[] tracks = Core.MediaTracks.Where(track => track.Type == "a").ToArray();
int len = tracks.Length;
Core.UpdateExternalTracks();
if (len < 1)
lock (Core.MediaTracksLock)
{
Core.CommandV("show-text", "No audio tracks");
return;
}
List<CommandPaletteItem> items = new List<CommandPaletteItem>();
foreach (MediaTrack i in tracks)
{
MediaTrack track = i;
CommandPaletteItem item = new CommandPaletteItem()
MediaTrack[] tracks = Core.MediaTracks.Where(track => track.Type == "a").ToArray();
if (tracks.Length < 1)
{
Text = track.Text,
Action = () => {
Core.CommandV("set", "aid", track.ID.ToString());
Core.CommandV("show-text", track.ID + "/" + len + ": " +
tracks[track.ID - 1].Text.Substring(3), "5000");
}
};
Core.CommandV("show-text", "No audio tracks");
return;
}
items.Add(item);
List<CommandPaletteItem> items = new List<CommandPaletteItem>();
foreach (MediaTrack i in tracks)
{
MediaTrack track = i;
CommandPaletteItem item = new CommandPaletteItem()
{
Text = track.Text,
Action = () => {
Core.CommandV("set", "aid", track.ID.ToString());
Core.CommandV("show-text", track.ID + "/" + tracks.Length + ": " +
tracks[track.ID - 1].Text.Substring(3), "5000");
}
};
items.Add(item);
}
CommandPalette.Instance.SetItems(items);
MainForm.Instance.ShowCommandPalette();
CommandPalette.Instance.SelectFirst();
}
CommandPalette.Instance.SetItems(items);
MainForm.Instance.ShowCommandPalette();
CommandPalette.Instance.SelectFirst();
});
public static void ShowSubtitleTracks() => App.InvokeOnMainThread(() =>
{
MediaTrack[] tracks = Core.MediaTracks.Where(track => track.Type == "s").ToArray();
int len = tracks.Length;
Core.UpdateExternalTracks();
if (len < 1)
lock (Core.MediaTracksLock)
{
Core.CommandV("show-text", "No subtitle tracks");
return;
}
List<CommandPaletteItem> items = new List<CommandPaletteItem>();
foreach (MediaTrack i in tracks)
{
MediaTrack track = i;
CommandPaletteItem item = new CommandPaletteItem()
MediaTrack[] tracks = Core.MediaTracks.Where(track => track.Type == "s").ToArray();
if (tracks.Length < 1)
{
Text = track.Text,
Action = () => {
Core.CommandV("set", "sid", track.ID.ToString());
Core.CommandV("show-text", track.ID + "/" + len + ": " +
tracks[track.ID - 1].Text.Substring(3), "5000");
}
};
Core.CommandV("show-text", "No subtitle tracks");
return;
}
items.Add(item);
List<CommandPaletteItem> items = new List<CommandPaletteItem>();
foreach (MediaTrack i in tracks)
{
MediaTrack track = i;
CommandPaletteItem item = new CommandPaletteItem()
{
Text = track.Text,
Action = () => {
Core.CommandV("set", "sid", track.ID.ToString());
Core.CommandV("show-text", track.ID + "/" + tracks.Length + ": " +
tracks[track.ID - 1].Text.Substring(3), "5000");
}
};
items.Add(item);
}
CommandPalette.Instance.SetItems(items);
MainForm.Instance.ShowCommandPalette();
CommandPalette.Instance.SelectFirst();
}
CommandPalette.Instance.SetItems(items);
MainForm.Instance.ShowCommandPalette();
CommandPalette.Instance.SelectFirst();
});
public static void ShowPlaylist() => App.InvokeOnMainThread(() =>
@@ -511,18 +546,19 @@ namespace mpvnet
{
int index = i;
string file = Core.GetPropertyString($"playlist/{i}/filename");
string title = Core.GetPropertyString($"playlist/{i}/title");
CommandPaletteItem item = new CommandPaletteItem()
{
Text = file.FileName(),
Action = () => {
Core.SetPropertyInt("playlist-pos", index);
if (App.AutoPlay && Core.Paused)
Core.SetPropertyBool("pause", false);
}
Text = title,
Action = () => Core.SetPropertyInt("playlist-pos", index)
};
if (string.IsNullOrEmpty(item.Text))
item.Text = file.FileName();
if (string.IsNullOrEmpty(item.Text))
item.Text = file;
items.Add(item);
if (currentPath.ToLowerEx() == file.ToLowerEx())
@@ -575,14 +611,14 @@ namespace mpvnet
{
List<CommandPaletteItem> items = new List<CommandPaletteItem>();
foreach (string i in App.Settings.RecentFiles)
foreach (string path in App.Settings.RecentFiles)
{
string file = i;
var file = App.GetTitleAndPath(path);
CommandPaletteItem item = new CommandPaletteItem()
{
Text = file.ShortPath(60),
Action = () => Core.LoadFiles(new[] { file }, true, Control.ModifierKeys.HasFlag(Keys.Control))
Text = file.Title.ShortPath(60),
Action = () => Core.LoadFiles(new[] { file.Path }, true, Control.ModifierKeys.HasFlag(Keys.Control))
};
items.Add(item);
@@ -651,10 +687,10 @@ namespace mpvnet
public static void ShowSetupDialog() => App.InvokeOnMainThread(() =>
{
(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") };
("Register video file associations", "script-message-to mpvnet reg-file-assoc video"),
("Register audio file associations", "script-message-to mpvnet reg-file-assoc audio"),
("Register image file associations", "script-message-to mpvnet reg-file-assoc image"),
("Unregister file associations", "script-message-to mpvnet reg-file-assoc unreg") };
var list = pairs.Select(i => new CommandPaletteItem(i.Name, () => Core.Command(i.Value)));
CommandPalette.Instance.SetItems(list);
@@ -662,11 +698,34 @@ namespace mpvnet
CommandPalette.Instance.SelectFirst();
});
public static void SelectProfile() => App.InvokeOnMainThread(() =>
{
var items = Core.ProfileNames.Where(i => !i.StartsWith("extension."))
.Select(i => new CommandPaletteItem(i, () => {
Core.CommandV("show-text", i);
Core.CommandV("apply-profile", i);
}));
CommandPalette.Instance.SetItems(items);
MainForm.Instance.ShowCommandPalette();
CommandPalette.Instance.SelectFirst();
});
public static void ShowChapters() => App.InvokeOnMainThread(() =>
{
var items = Core.GetChapters().Select(i => new CommandPaletteItem(i.Title, i.TimeDisplay, () =>
Core.CommandV("seek", i.Time.ToString(CultureInfo.InvariantCulture), "absolute")));
CommandPalette.Instance.SetItems(items);
MainForm.Instance.ShowCommandPalette();
CommandPalette.Instance.SelectFirst();
});
public static void ShowMenu() => Core.RaiseShowMenu();
public static void PlaylistAdd(int value)
{
int pos = Core.GetPropertyInt("playlist-pos");
int pos = Core.PlaylistPos;
int count = Core.GetPropertyInt("playlist-count");
if (count < 2)
@@ -682,5 +741,29 @@ namespace mpvnet
Core.SetPropertyInt("playlist-pos", pos);
}
public static void PlaylistRandom()
{
int count = Core.GetPropertyInt("playlist-count");
Core.SetPropertyInt("playlist-pos", new Random().Next(count));
}
public static void QuickBookmark()
{
if (App.QuickBookmark == 0)
{
App.QuickBookmark = (float)Core.GetPropertyDouble("time-pos");
if (App.QuickBookmark != 0)
Core.Command("show-text 'Bookmark Saved'");
}
else
{
Core.SetPropertyDouble("time-pos", App.QuickBookmark);
App.QuickBookmark = 0;
}
}
public static void MoveWindow(string direction) => Core.RaiseMoveWindow(direction);
}
}

View File

@@ -14,7 +14,7 @@ namespace mpvnet
{
public static List<ConfSection> Parse(string content)
{
string[] lines = content.Split("\r\n".ToCharArray());
string[] lines = content.Split(new[] { "\r\n" }, System.StringSplitOptions.None);
var sections = new List<ConfSection>();
ConfSection currentGroup = null;
@@ -22,12 +22,9 @@ namespace mpvnet
{
string line = i.Trim();
if (string.IsNullOrEmpty(line))
continue;
if (line.StartsWith("[") && line.EndsWith("]"))
if (line == "")
{
currentGroup = new ConfSection() { Name = line.TrimStart('[').TrimEnd(']') };
currentGroup = new ConfSection();
sections.Add(currentGroup);
}
else if (line.Contains("="))
@@ -45,7 +42,6 @@ namespace mpvnet
public class ConfSection
{
public string Name { get; set; }
public List<StringPair> Items { get; set; } = new List<StringPair>();
public bool HasName(string name)

View File

@@ -7,7 +7,7 @@ public static class TestStringExtension
{
public static bool ContainsEx(this string instance, string value)
{
if (instance != null && value != null)
if (!string.IsNullOrEmpty(instance) && !string.IsNullOrEmpty(value))
return instance.Contains(value);
return false;
@@ -47,6 +47,8 @@ public static class ConvertToStringExtension
return instance.Trim();
}
public static string ToStringEx(this object instance) => instance?.ToString() ?? "";
}
public static class ConvertStringExtension
@@ -118,14 +120,13 @@ public static class PathStringExtension
return instance;
}
// Ensure trailing directory separator char
public static string AddSep(this string instance)
{
if (string.IsNullOrEmpty(instance))
return "";
if (!instance.EndsWith(Path.DirectorySeparatorChar.ToString()))
instance = instance + Path.DirectorySeparatorChar;
instance += Path.DirectorySeparatorChar;
return instance;
}

View File

@@ -134,9 +134,10 @@ namespace mpvnet
public class MediaTrack
{
public string Text { get; set; }
public int ID { get; set; }
public bool External { get; set; }
public string Text { get; set; } = "";
public string Type { get; set; }
public int ID { get; set; }
}
public class CommandItem : INotifyPropertyChanged
@@ -145,7 +146,19 @@ namespace mpvnet
public string Path { get; set; } = "";
public string Command { get; set; } = "";
public string Display { get { return string.IsNullOrEmpty(Path) ? Command : Path; } }
public string Display {
get {
if (string.IsNullOrEmpty(Path))
{
if (Command.Length > 47)
return Command.Substring(0, 47) + "...";
return Command;
}
else
return Path;
}
}
public CommandItem() { }
@@ -227,7 +240,6 @@ namespace mpvnet
get {
if (_Items is null)
_Items = GetItems(File.ReadAllText(Core.InputConfPath));
return _Items;
}
}
@@ -249,6 +261,13 @@ namespace mpvnet
Action = action;
}
public CommandPaletteItem(string text, string secondaryText, Action action)
{
Text = text;
Action = action;
SecondaryText = secondaryText;
}
public string Text { get; set; } = "";
public string SecondaryText { get; set; } = "";
public Action Action { get; set; }
@@ -271,4 +290,26 @@ namespace mpvnet
});
}
}
public class Chapter
{
public string Title { get; set; }
public double Time { get; set; }
string _TimeDisplay;
public string TimeDisplay {
get {
if (_TimeDisplay == null)
{
_TimeDisplay = TimeSpan.FromSeconds(Time).ToString();
if (_TimeDisplay.ContainsEx("."))
_TimeDisplay = _TimeDisplay.Substring(0, _TimeDisplay.LastIndexOf("."));
}
return _TimeDisplay;
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -32,6 +32,9 @@ namespace mpvnet
App.Init();
Mutex mutex = new Mutex(true, StringHelp.GetMD5Hash(App.ConfPath), out bool isFirst);
if (Control.ModifierKeys.HasFlag(Keys.Shift))
App.ProcessInstance = "multi";
if ((App.ProcessInstance == "single" || App.ProcessInstance == "queue") && !isFirst)
{
List<string> args2 = new List<string>();

View File

@@ -21,9 +21,8 @@ namespace mpvnet
public Point WindowLocation;
public Point WindowPosition;
public Size WindowSize;
public string ConfigEditorSearch = "";
public string ConfigEditorSearch = "Video:";
public string Mute = "no";
public string UpdateCheckVersion = "";
}
class SettingsManager

View File

@@ -23,6 +23,12 @@ public class MediaInfo : IDisposable
public int GetCount(MediaInfoStreamKind kind) => MediaInfo_Count_Get(Handle, kind, -1);
public string GetGeneral(string parameter)
{
return Marshal.PtrToStringUni(MediaInfo_Get(Handle, MediaInfoStreamKind.General,
0, parameter, MediaInfoKind.Text, MediaInfoKind.Name));
}
public string GetVideo(int stream, string parameter)
{
return Marshal.PtrToStringUni(MediaInfo_Get(Handle, MediaInfoStreamKind.Video,

View File

@@ -21,6 +21,9 @@ namespace mpvnet
[DllImport("user32.dll")]
public static extern uint ActivateKeyboardLayout(IntPtr hkl, uint flags);
[DllImport("user32.dll")]
public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindowEx(
IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
@@ -88,6 +91,37 @@ namespace mpvnet
[DllImport("gdi32.dll")]
public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
[DllImport("dwmapi.dll")]
public static extern int DwmGetWindowAttribute(
IntPtr hwnd, uint dwAttribute, out RECT pvAttribute, uint cbAttribute);
public static bool GetDwmWindowRect(IntPtr handle, out RECT rect)
{
const uint DWMWA_EXTENDED_FRAME_BOUNDS = 9;
return 0 == DwmGetWindowAttribute(handle, DWMWA_EXTENDED_FRAME_BOUNDS, out rect, (uint)Marshal.SizeOf<RECT>());
}
public static Rectangle GetWorkingArea(IntPtr handle, Rectangle workingArea)
{
if (handle != IntPtr.Zero && GetDwmWindowRect(handle, out RECT dwmRect) &&
GetWindowRect(handle, out RECT rect))
{
int left = workingArea.Left;
int top = workingArea.Top;
int right = workingArea.Right;
int bottom = workingArea.Bottom;
left += rect.Left - dwmRect.Left;
top -= rect.Top - dwmRect.Top;
right -= dwmRect.Right - rect.Right;
bottom -= dwmRect.Bottom - rect.Bottom;
return new Rectangle(left, top, right - left, bottom - top);
}
return workingArea;
}
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
@@ -116,6 +150,16 @@ namespace mpvnet
public Size Size => new Size(Right - Left, Bottom - Top);
public int Width => Right - Left;
public int Height => Bottom - Top;
public static RECT FromRectangle(Rectangle rect)
{
return new RECT(rect.X, rect.Y, rect.X + rect.Width, rect.Y + rect.Height);
}
public override string ToString()
{
return "{Left=" + Left + ",Top=" + Top + ",Right=" + Right + ",Bottom=" + Bottom + "}";
}
}
[StructLayout(LayoutKind.Sequential)]

View File

@@ -5,66 +5,72 @@ using System.Text;
public class libmpv
{
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr mpv_create();
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr mpv_create_client(IntPtr mpvHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string command);
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_initialize(IntPtr mpvHandle);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void mpv_destroy(IntPtr mpvHandle);
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_command(IntPtr mpvHandle, IntPtr strings);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_command_string(IntPtr mpvHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string command);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_command_ret(IntPtr mpvHandle, IntPtr strings, IntPtr node);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void mpv_free_node_contents(IntPtr node);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr mpv_error_string(mpv_error error);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int mpv_terminate_destroy(IntPtr mpvHandle);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_request_log_messages(IntPtr mpvHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string min_level);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int mpv_set_option(IntPtr mpvHandle, byte[] name, mpv_format format, ref long data);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int mpv_set_option_string(IntPtr mpvHandle, byte[] name, byte[] value);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_get_property(IntPtr mpvHandle, byte[] name, mpv_format format, out IntPtr data);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_get_property(IntPtr mpvHandle, byte[] name, mpv_format format, out double data);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_set_property(IntPtr mpvHandle, byte[] name, mpv_format format, ref byte[] data);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_set_property(IntPtr mpvHandle, byte[] name, mpv_format format, ref long data);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_set_property(IntPtr mpvHandle, byte[] name, mpv_format format, ref double data);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_observe_property(IntPtr mpvHandle, ulong reply_userdata, [MarshalAs(UnmanagedType.LPUTF8Str)] string name, mpv_format format);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int mpv_unobserve_property(IntPtr mpvHandle, ulong registered_reply_userdata);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void mpv_free(IntPtr data);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr mpv_wait_event(IntPtr mpvHandle, double timeout);
[DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_request_event(IntPtr mpvHandle, mpv_event_id id, int enable);
public enum mpv_error
{
MPV_ERROR_SUCCESS = 0,

View File

@@ -11,7 +11,7 @@
<Identity
Name="5664FrankSkare.mpv.net"
Publisher="CN=6A1A1E69-736C-4C77-B310-7B6D38E32617"
Version="5.7.0.0" />
Version="6.0.4.0" />
<Properties>
<DisplayName>mpv.net</DisplayName>

View File

@@ -27,7 +27,7 @@
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
@@ -51,8 +51,8 @@
<Link>mpv.net\Microsoft.Management.Infrastructure.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\bin\mpv-2.dll">
<Link>mpv.net\mpv-2.dll</Link>
<Content Include="..\bin\libmpv-2.dll">
<Link>mpv.net\libmpv-2.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\bin\mpvnet.com">

View File

@@ -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.9.0.0")]
[assembly: AssemblyFileVersion("5.9.0.0")]
[assembly: AssemblyVersion("6.0.4.0")]
[assembly: AssemblyFileVersion("6.0.4.0")]

View File

@@ -1,24 +1,74 @@
[setting]
name = process-instance
file = mpvnet
default = single
filter = General
help = Defines if more then one mpv.net process is allowed. (mpv.net specific option)\n\nMulti can alternatively be enabled by pressing the SHIFT key.\n\nWhenever the control key is pressed when files or URLs are opened, the playlist is not cleared but the files or URLs are appended to the playlist. This not only works on process startup but in all mpv.net features that open files and URLs.
option = multi Create a new process everytime the shell starts mpv.net
option = single Force a single process everytime the shell starts mpv.net
option = queue Force a single process and add files to playlist
name = recent-count
file = mpvnet
filter = General
help = <int> Amount of recent files to be remembered. Default: 15 (mpv.net specific option)
name = media-info
file = mpvnet
default = yes
filter = General
help = Usage of the media info library instead of mpv to access media information. (mpv.net specific option)
option = yes
option = no
name = history-filter
file = mpvnet
filter = General
width = 500
help = Semicolon separated list of paths to be excluded from the history log feature.
name = video-file-extensions
file = mpvnet
filter = General
width = 500
help = Video file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net specific option)
name = audio-file-extensions
file = mpvnet
filter = General
width = 500
help = Audio file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net specific option)
name = image-file-extensions
file = mpvnet
filter = General
width = 500
help = Image file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net specific option)
name = debug-mode
file = mpvnet
default = no
filter = General
help = Enable this only when a developer asks for it. (mpv.net specific option)
option = yes
option = no
name = vo
file = mpv
default = gpu
filter = Video
help = Video output drivers to be used.\n\nFor more information visit:
url = https://mpv.io/manual/master/#video-output-drivers-vo
option = gpu General purpose, customizable, GPU-accelerated video output driver. It supports extended scaling methods, dithering, color management, custom shaders, HDR, and more.
option = gpu-next Experimental video renderer based on libplacebo. This supports almost the same set of features as --vo=gpu.
option = direct3d Video output driver that uses the Direct3D interface.
[setting]
name = hwdec
file = mpv
default = no
filter = Video
url = https://mpv.io/manual/master/#options-hwdec
help = Specify the hardware video decoding API that should be used if possible. Whether hardware decoding is actually done depends on the video codec. If hardware decoding is not possible, mpv will fall back on software decoding.\n\nFor more information visit:
option = no always use software decoding
option = auto enable best hw decoder
option = yes exactly the same as auto
@@ -33,24 +83,20 @@ option = cuda-copy copies video back to system RAM (Any platform CUDA is ava
option = nvdec requires vo=gpu (Any platform CUDA is available)
option = nvdec-copy copies video back to system RAM (Any platform CUDA is available)
[setting]
name = gpu-api
file = mpv
default = auto
filter = Video
help = Controls which type of graphics APIs will be accepted. Auto uses d3d11, it should only be changed in case of problems, Vulkan is not recommended.
option = auto Use any available API
option = d3d11 Allow only gpu-context=d3d11
option = opengl Allow only OpenGL (requires OpenGL 2.1+ or GLES 2.0+)
option = vulkan Allow only Vulkan
[setting]
name = gpu-context
file = mpv
default = auto
filter = Video
option = auto auto-select
option = d3d11 Win32, with native Direct3D 11 rendering.
option = angle Direct3D11 through the OpenGL ES translation layer ANGLE. This supports almost everything the win backend does (if the ANGLE build is new enough).
@@ -58,14 +104,12 @@ option = win Win32/WGL
option = dxinterop (experimental) Win32, using WGL for rendering and Direct3D 9Ex for presentation. Works on Nvidia and AMD. Newer Intel chips with the latest drivers may also work.
option = winvk VK_KHR_win32_surface
[setting]
name = video-sync
file = mpv
default = audio
filter = Video
help = How the player synchronizes audio and video.\n\nFor more information visit:
url = https://mpv.io/manual/master/#options-video-sync
option = audio
option = display-resample
option = display-resample-vdrop
@@ -75,13 +119,11 @@ option = display-adrop
option = display-desync
option = desync
[setting]
name = scale
file = mpv
default = bilinear
filter = Video
help = The GPU renderer filter function to use when upscaling video. There are some more filters, but most are not as useful. For a complete list, pass help as value, e.g.: mpv --scale=help
option = bilinear Bilinear hardware texture filtering (fastest, very low quality).
option = spline36 Mid quality and speed. This is the default when using gpu-hq.
option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc)
@@ -90,13 +132,11 @@ option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfi
option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale).
option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale).
[setting]
name = cscale
file = mpv
default = bilinear
filter = Video
help = As scale, but for interpolating chroma information. If the image is not subsampled, this option is ignored entirely.
option = bilinear Bilinear hardware texture filtering (fastest, very low quality).
option = spline36 Mid quality and speed. This is the default when using gpu-hq.
option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc)
@@ -105,13 +145,11 @@ option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfi
option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale).
option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale).
[setting]
name = dscale
file = mpv
default =
filter = Video
help = Like scale, but apply these filters on downscaling instead. \nIf no option is selected, it will keep the same with the upscaler.
option = bilinear Bilinear hardware texture filtering (fastest, very low quality).
option = spline36 Mid quality and speed. This is the default when using gpu-hq.
option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc)
@@ -120,202 +158,167 @@ option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfi
option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale).
option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale).
[setting]
name = dither-depth
file = mpv
default = no
filter = Video
help = Set dither target depth to N. Note that the depth of the connected video display device cannot be detected. Often, LCD panels will do dithering on their own, which conflicts with this option and leads to ugly output.
option = no Disable any dithering done by mpv.
option = auto Automatic selection. If output bit depth cannot be detected, 8 bits per component are assumed.
option = 8 Dither to 8 bit output.
option = 10 Dither to 10 bit output.
[setting]
name = correct-downscaling
file = mpv
default = no
filter = Video
help = When using convolution based filters, extend the filter size when downscaling. Increases quality, but reduces performance while downscaling.\n\nThis will perform slightly sub-optimally for anamorphic video (but still better than without it) since it will extend the size to match only the milder of the scale factors between the axes.
option = yes
option = no
[setting]
name = sigmoid-upscaling
file = mpv
default = no
filter = Video
help = When upscaling, use a sigmoidal color transform to avoid emphasizing ringing artifacts. This also implies linear-scaling.
option = yes
option = no
[setting]
name = deband
file = mpv
default = no
filter = Video
help = Enable the debanding algorithm. This greatly reduces the amount of visible banding, blocking and other quantization artifacts, at the expense of very slightly blurring some of the finest details. In practice, it's virtually always an improvement - the only reason to disable it would be for performance.
option = yes
option = no
[setting]
name = d3d11va-zero-copy
file = mpv
default = no
filter = Video
help = By default, when using hardware decoding with --gpu-api=d3d11, the video image will be copied (GPU-to-GPU) from the decoder surface to a shader resource. Set this option to avoid that copy by sampling directly from the decoder image. This may increase performance and reduce power usage, but can cause the image to be sampled incorrectly on the bottom and right edges due to padding, and may invoke driver bugs, since Direct3D 11 technically does not allow sampling from a decoder surface (though most drivers support it.)
option = yes
option = no
[setting]
name = hdr-compute-peak
file = mpv
default = auto
filter = Video
help = Compute the HDR peak and frame average brightness per-frame instead of relying on tagged metadata. These values are averaged over local regions as well as over several frames to prevent the value from jittering around too much. This option basically gives you dynamic, per-scene tone mapping. Requires compute shaders, which is a fairly recent OpenGL feature, and will probably also perform horribly on some drivers, so enable at your own risk. The special value auto (default) will enable HDR peak computation automatically if compute shaders and SSBOs are supported.
option = auto
option = yes
option = no
[setting]
name = allow-delayed-peak-detect
file = mpv
default = yes
filter = Video
help = When using --hdr-compute-peak, allow delaying the detected peak by a frame when beneficial for performance. In particular, this is required to avoid an unnecessary FBO indirection when no advanced rendering is required otherwise. Has no effect if there already is an indirect pass, such as when advanced scaling is enabled. (Only affects --vo=gpu-next, note that --vo=gpu always delays the peak.)
option = yes
option = no
[setting]
name = volume
file = mpv
filter = Audio
help = Set the startup volume. 0 means silence, 100 means no volume reduction or amplification. Negative values can be passed for compatibility, but are treated as 0. Since mpv 0.18.1, this always controls the internal mixer (aka "softvol"). Default: 100
[setting]
name = remember-volume
file = mpvnet
default = yes
filter = Audio
help = Save volume and mute on exit and restore it on start. (mpv.net specific option)
option = yes
option = no
[setting]
name = alang
file = mpv
filter = Audio
type = string
help = Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also aid.\n\nExamples\n\nmpv dvd://1 alang=hu,en chooses the Hungarian language track on a DVD and falls back on English if Hungarian is not available.\n\nmpv alang=jpn example.mkv plays a Matroska file with Japanese audio.
[setting]
name = audio-file-auto
file = mpv
default = no
filter = Audio
help = Load additional audio files matching the video filename. The parameter specifies how external audio files are matched.
option = no Don't automatically load external audio files.
option = exact Load the media filename with audio file extension.
option = fuzzy Load all audio files containing media filename.
option = all Load all audio files in the current and audio-file-paths directories.
[setting]
name = audio-device
file = mpv
filter = Audio
type = string
url = https://mpv.io/manual/master/#options-audio-device
help = <name> Use the given audio device. This consists of the audio output name, e.g. alsa, followed by /, followed by the audio output specific device name. The default value for this option is auto, which tries every audio output in preference order with the default device.\nAvailable devices can be found in the mpv.net context menu under:\nView > Show Audio Devices
help = <name> Use the given audio device. This consists of the audio output name, e.g. alsa, followed by /, followed by the audio output specific device name. The default value for this option is auto, which tries every audio output in preference order with the default device.\nAvailable devices can be found in the context menu under:\nView > Advanced > Show Audio Devices
[setting]
name = slang
file = mpv
filter = Subtitle
type = string
help = Specify a priority list of subtitle languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two letter language codes, Matroska uses ISO 639-2 three letter language codes while OGM uses a free-form identifier. See also sid.
[setting]
name = sub-auto
file = mpv
default = exact
filter = Subtitle
help = Load additional subtitle files matching the video filename. The parameter specifies how external subtitle files are matched. exact is enabled by default.
option = no Don't automatically load external subtitle files.
option = exact Load the media filename with subtitle file extension.
option = fuzzy Load all subs containing media filename.
option = all Load all subs in the current and sub-file-paths directories.
[setting]
name = sub-font
file = mpv
filter = Subtitle
type = string
help = Specify font to use for subtitles that do not themselves specify a particular font. The default is sans-serif.
[setting]
name = sub-font-size
file = mpv
filter = Subtitle
help = Specify the sub font size. The unit is the size in scaled pixels at a window height of 720. The actual pixel size is scaled with the window height: if the window height is larger or smaller than 720, the actual size of the text increases or decreases as well. Default: 55
[setting]
name = sub-color
file = mpv
type = color
filter = Subtitle
help = Specify the color used for unstyled text subtitles.\n\nThe color is specified in the form r/g/b, where each color component is specified as number in the range 0.0 to 1.0. It's also possible to specify the transparency by using r/g/b/a, where the alpha value 0 means fully transparent, and 1.0 means opaque. If the alpha component is not given, the color is 100% opaque.\n\nPassing a single number to the option sets the sub to gray, and the form gray/a lets you specify alpha additionally.\n\nExamples\n\n1.0/0.0/0.0 set sub to opaque red\n1.0/0.0/0.0/0.75 set sub to opaque red with 75% alpha\n0.5/0.75 set sub to 50% gray with 75% alpha\n\nAlternatively, the color can be specified as a RGB hex triplet in the form #RRGGBB, where each 2-digit group expresses a color value in the range 0 (00) to 255 (FF). For example, #FF0000 is red. This is similar to web colors. Alpha is given with #AARRGGBB.\n\nExamples\n\n#FF0000 set sub to opaque red\n#C0808080 set sub to 50% gray with 75% alpha
[setting]
name = sub-border-color
file = mpv
type = color
filter = Subtitle
help = See sub-color. Color used for the sub font border. Ignored when sub-back-color is specified (or more exactly: when that option is not set to completely transparent).
[setting]
name = sub-back-color
file = mpv
type = color
filter = Subtitle
help = See sub-color. Color used for sub text background. You can use sub-shadow-offset to change its size relative to the text.
[setting]
name = fullscreen
file = mpv
default = no
filter = Screen
help = Start the player in fullscreen mode.
option = yes
option = no
[setting]
name = border
file = mpv
default = yes
filter = Screen
help = Show window with decoration (titlebar, border).
option = yes
option = no
[setting]
name = screen
file = mpv
filter = Screen
help = <0-32> In multi-monitor configurations (i.e. a single desktop that spans across multiple displays), this option tells mpv which screen to display the video on.
[setting]
name = osd-playing-msg
file = mpv
width = 300
@@ -324,53 +327,54 @@ type = string
help = Show a message on OSD when playback starts. The string is expanded for properties, e.g. osd-playing-msg='file: ${filename}' will show the message file: followed by a space and the currently played filename. For more information visit:
url = https://mpv.io/manual/master/#property-expansion
[setting]
name = osd-font-size
file = mpv
filter = Screen
help = Specify the OSD font size. See sub-font-size for details. Default: 55
[setting]
name = osd-duration
file = mpv
filter = Screen
help = Set the duration of the OSD messages in ms. Default: 1000
[setting]
name = osd-scale-by-window
file = mpv
default = yes
filter = Screen
help = Whether to scale the OSD with the window size. If this is disabled, osd-font-size and other OSD options that use scaled pixels are always in actual pixels. The effect is that changing the window size won't change the OSD font size.
option = yes
option = no
[setting]
name = autofit
file = mpv
filter = Screen
help = <int> Initial window height in percent. Default: 60
[setting]
name = autofit-image
file = mpvnet
filter = Screen
help = <int> Initial window height in percent for image files. Default: 80
name = autofit-audio
file = mpvnet
filter = Screen
help = <int> Initial window height in percent for audio files. Default: 70
name = autofit-smaller
file = mpv
filter = Screen
help = <int> Minimum window height in percent. Default: 10
[setting]
name = autofit-larger
file = mpv
filter = Screen
help = <int> Maximum window height in percent. Default: 80
[setting]
name = start-size
file = mpvnet
default = height-session
filter = Screen
help = Setting to remember the window size. (mpv.net specific option)
option = width-session Window width is remembered in the current session
option = width-always Window width is always remembered
option = height-session Window height is remembered in the current session
@@ -379,325 +383,264 @@ option = video Window size is set to video resolution
option = session Window size is remembered in the current session
option = always Window size is always remembered
[setting]
name = keepaspect-window
file = mpv
default = yes
filter = Screen
help = keepaspect-window will lock the window size to the video aspect. Default: yes
option = yes
option = no
[setting]
name = start-threshold
file = mpvnet
filter = Screen
help = 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 (mpv.net specific option)
[setting]
name = minimum-aspect-ratio
file = mpvnet
filter = Screen
help = <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 (mpv.net specific option)
help = <float> Minimum aspect ratio of the window. Useful to force a wider window and therefore a larger OSC. (mpv.net specific option)
name = minimum-aspect-ratio-audio
file = mpvnet
filter = Screen
help = Same as minimum-aspect-ratio but used for audio files.
[setting]
name = remember-window-position
file = mpvnet
default = no
filter = Screen
help = Save the window position on exit. (mpv.net specific option)
option = yes
option = no
[setting]
name = snap-window
file = mpv
default = no
filter = Screen
help = Snap the player window to screen edges.
option = yes
option = no
name = window-maximized
file = mpv
default = no
filter = Screen
help = Start with a maximized window.
option = yes
option = no
[setting]
name = screenshot-directory
file = mpv
width = 500
type = folder
name = start-threshold
file = mpvnet
filter = Screen
help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot.
help = 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 (mpv.net specific option)
[setting]
name = screenshot-format
file = mpv
default = jpg
filter = Screen
help = Set the image file type used for saving screenshots.
option = jpg
option = png
[setting]
name = screenshot-tag-colorspace
file = mpv
default = no
filter = Screen
help = Tag screenshots with the appropriate colorspace. Note that not all formats are supported.
option = yes
option = no
[setting]
name = screenshot-high-bit-depth
file = mpv
default = yes
filter = Screen
help = If possible, write screenshots with a bit depth similar to the source video. This is interesting in particular for PNG, as this sometimes triggers writing 16 bit PNGs with huge file sizes. This will also include an unused alpha channel in the resulting files if 16 bit is used.
option = yes
option = no
[setting]
name = screenshot-jpeg-source-chroma
file = mpv
default = yes
filter = Screen
help = Write JPEG files with the same chroma subsampling as the video. If disabled, the libjpeg default is used.
option = yes
option = no
[setting]
name = screenshot-template
file = mpv
filter = Screen
type = string
help = Specify the filename template used to save screenshots. The template specifies the filename without file extension, and can contain format specifiers, which will be substituted when taking a screenshot. By default, the template is mpv-shot%n, which results in filenames like mpv-shot0012.png for example.\n\nFind the full documentation here:
url = https://mpv.io/manual/master/#options-screenshot-template
[setting]
name = screenshot-jpeg-quality
file = mpv
filter = Screen
help = <0-100> Set the JPEG quality level. Higher means better quality. The default is 90.
[setting]
name = screenshot-png-compression
file = mpv
filter = Screen
help = <0-9> Set the PNG compression level. Higher means better compression. This will affect the file size of the written screenshot file and the time it takes to write a screenshot. Too high compression might occupy enough CPU time to interrupt playback. The default is 7.
[setting]
name = screenshot-png-filter
file = mpv
filter = Screen
help = <0-5> Set the filter applied prior to PNG compression. 0 is none, 1 is 'sub', 2 is 'up', 3 is 'average', 4 is 'Paeth', and 5 is 'mixed'. This affects the level of compression that can be achieved. For most images, 'mixed' achieves the best compression ratio, hence it is the default.
[setting]
name = taskbar-progress
file = mpv
default = yes
filter = Playback
help = Show progress in taskbar.
option = yes
option = no
[setting]
name = keep-open
file = mpv
default = no
filter = Playback
help = Using no, mpv would terminate after the last file but mpv.net never terminates automatically.
option = yes If the current file ends, go to the next file, keep the last file open.
option = no If the current file ends, go to the next file. If keep-open-exit is set to yes, mpv.net exits after the last file.
option = no If the current file ends, go to the next file. If idle is set to no, the player exits after the last file.
option = always Playback will never automatically advance to the next file.
[setting]
name = keep-open-pause
file = mpv
default = yes
filter = Playback
help = If set to no, instead of pausing when keep-open is active, just stop at end of file and continue playing forward when you seek backwards until end where it stops again.
option = yes
option = no
[setting]
name = keep-open-exit
file = mpvnet
default = no
name = idle
file = mpv
default = yes
filter = Playback
help = If set to yes and keep-open is set to no, mpv.net exits after the last file ends. In mpv the idle property would be used, it's not possible for mpv.net to use the idle property.
help = If set to no and keep-open is also set to no, the player exits after the last file ends.
option = yes
option = no
option = once
[setting]
name = auto-play
file = mpvnet
default = no
filter = Playback
help = Sets pause=no on file load and selecting from the playlist. (mpv.net specific option)
help = Sets pause=no on file load. (mpv.net specific option)
option = yes
option = no
[setting]
name = loop-file
file = mpv
filter = Playback
help = <N|inf|no> Loop a single file N times. inf means forever, no means normal playback.\n\nThe difference to loop-playlist is that this doesn't loop the playlist, just the file itself. If the playlist contains only a single file, the difference between the two option is that this option performs a seek on loop, instead of reloading the file. loop is an alias for this option.
[setting]
name = save-position-on-quit
file = mpv
default = no
filter = Playback
help = Always save the current playback position on quit. When this file is played again later, the player will seek to the old playback position on start. This does not happen if playback of a file is stopped in any other way than quitting. For example, going to the next file in the playlist will not save the position, and start playback at beginning the next time the file is played.\n\nThis behavior is disabled by default, but is always available when quitting the player with Shift+Q.
option = yes
option = no
[setting]
name = watch-later-options
file = mpv
filter = Playback
help = The options that are saved in "watch later" files if they have been changed since when mpv started. These values will be restored the next time the files are played. This is a string list option. For more information visit:
url = https://mpv.io/manual/master/#options-watch-later-options
[setting]
name = hr-seek
file = mpv
default = absolute
filter = Playback
help = Select when to use precise seeks that are not limited to keyframes. Such seeks require decoding video from the previous keyframe up to the target position and so can take some time depending on decoding performance. For some video formats, precise seeks are disabled. This option selects the default choice to use for seeks; it is possible to explicitly override that default in the definition of key bindings and in input commands.
option = yes Use precise seeks whenever possible.
option = no Never use precise seeks.
option = absolute Use precise seeks if the seek is to an absolute position in the file, such as a chapter seek, but not for relative seeks like the default behavior of arrow keys.
option = always Same as yes (for compatibility).
[setting]
name = track-auto-selection
file = mpv
default = yes
filter = Playback
help = Enable the default track auto-selection. Enabling this will make the player select streams according to aid, alang, and others. If it is disabled, no tracks are selected. In addition, the player will not exit if no tracks are selected, and wait instead (this wait mode is similar to pausing, but the pause option is not set).\n\nThis is useful with lavfi-complex: you can start playback in this mode, and then set select tracks at runtime by setting the filter graph. Note that if lavfi-complex is set before playback is started, the referenced tracks are always selected.
option = yes
option = no
[setting]
name = loop-playlist
file = mpv
filter = Playback
help = <N|inf|force|no> Loops playback N times. A value of 1 plays it one time (default), 2 two times, etc. inf means forever. no is the same as 1 and disables looping. If several files are specified on command line, the entire playlist is looped. The force mode is like inf, but does not skip playlist entries which have been marked as failing. This means the player might waste CPU time trying to loop a file that doesn't exist. But it might be useful for playing webradios under very bad network conditions.
[setting]
name = auto-load-folder
file = mpvnet
default = yes
filter = Playback
help = For single files automatically load the entire directory into the playlist. Can be suppressed via shift key. (mpv.net specific option)
option = yes
option = no
[setting]
name = input-ar-delay
file = mpv
filter = Input
help = Delay in milliseconds before we start to autorepeat a key (0 to disable).
[setting]
name = input-ar-rate
file = mpv
filter = Input
help = Number of key presses to generate per second on autorepeat.
[setting]
name = process-instance
file = mpvnet
default = single
filter = General
help = Defines if more then one mpv.net process is allowed. (mpv.net specific option)\n\nTip: Whenever the control key is pressed when files or URLs are opened, the playlist is not cleared but the files or URLs are appended to the playlist. This not only works on process startup but in all mpv.net features that open files and URLs.
option = multi Create a new process everytime the shell starts mpv.net
option = single Force a single process everytime the shell starts mpv.net
option = queue Force a single process and add files to playlist
[setting]
name = recent-count
file = mpvnet
filter = General
help = <int> Amount of recent files to be remembered. Default: 15 (mpv.net specific option)
[setting]
name = video-file-extensions
file = mpvnet
filter = General
width = 500
help = Video file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net specific option)
[setting]
name = audio-file-extensions
file = mpvnet
filter = General
width = 500
help = Audio file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net specific option)
[setting]
name = image-file-extensions
file = mpvnet
filter = General
width = 500
help = Image file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net specific option)
[setting]
name = debug-mode
file = mpvnet
default = no
filter = General
help = Enable this only when a developer asks for it. (mpv.net specific option)
option = yes
option = no
[setting]
name = dark-mode
file = mpvnet
default = always
filter = UI
help = Changes between a light and dark theme.\nmpv.net must be restarted after a change.\nmpv.net specific option.
option = always
option = system Available on Windows 10 or higher
option = never
[setting]
name = dark-theme
file = mpvnet
filter = UI
url = https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#color-theme
url = https://github.com/mpvnet-player/mpv.net/blob/master/docs/Manual.md#color-theme
help = Color theme used in dark mode.\nmpv.net must be restarted after a change.\nmpv.net specific option. Default: dark
[setting]
name = light-theme
file = mpvnet
filter = UI
url = https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#color-theme
url = https://github.com/mpvnet-player/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
name = show-santa-logo
file = mpvnet
default = yes
filter = UI
help = Draws the blue mpv.net logo with a santa hat in december, the option is called greenandgrumpy in mpv.
option = yes
option = no
name = screenshot-directory
file = mpv
width = 500
type = folder
filter = Screenshot
help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot.
name = screenshot-format
file = mpv
default = jpg
filter = Screenshot
help = Set the image file type used for saving screenshots.
option = jpg
option = png
name = screenshot-tag-colorspace
file = mpv
default = no
filter = Screenshot
help = Tag screenshots with the appropriate colorspace. Note that not all formats are supported.
option = yes
option = no
name = screenshot-high-bit-depth
file = mpv
default = yes
filter = Screenshot
help = If possible, write screenshots with a bit depth similar to the source video. This is interesting in particular for PNG, as this sometimes triggers writing 16 bit PNGs with huge file sizes. This will also include an unused alpha channel in the resulting files if 16 bit is used.
option = yes
option = no
name = screenshot-jpeg-source-chroma
file = mpv
default = yes
filter = Screenshot
help = Write JPEG files with the same chroma subsampling as the video. If disabled, the libjpeg default is used.
option = yes
option = no
name = screenshot-template
file = mpv
filter = Screenshot
type = string
help = Specify the filename template used to save screenshots. The template specifies the filename without file extension, and can contain format specifiers, which will be substituted when taking a screenshot. By default, the template is mpv-shot%n, which results in filenames like mpv-shot0012.png for example.\n\nFind the full documentation here:
url = https://mpv.io/manual/master/#options-screenshot-template
name = screenshot-jpeg-quality
file = mpv
filter = Screenshot
help = <0-100> Set the JPEG quality level. Higher means better quality. The default is 90.
name = screenshot-png-compression
file = mpv
filter = Screenshot
help = <0-9> Set the PNG compression level. Higher means better compression. This will affect the file size of the written screenshot file and the time it takes to write a screenshot. Too high compression might occupy enough CPU time to interrupt playback. The default is 7.
name = screenshot-png-filter
file = mpv
filter = Screenshot
help = <0-5> Set the filter applied prior to PNG compression. 0 is none, 1 is 'sub', 2 is 'up', 3 is 'average', 4 is 'Paeth', and 5 is 'mixed'. This affects the level of compression that can be achieved. For most images, 'mixed' achieves the best compression ratio, hence it is the default.
name = cache
file = mpv
default = auto
filter = Cache
help = Decide whether to use network cache settings.
url = https://mpv.io/manual/master/#options-cache
option = yes
option = no
option = auto
name = demuxer-max-bytes
file = mpv
filter = Demuxer
help = <bytesize> Controls how much the demuxer is allowed to buffer ahead.\nSuffixes such as KiB and MiB are supported.
url = https://mpv.io/manual/master/#options-demuxer-max-bytes

View File

@@ -1,28 +1,30 @@
# https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#input-and-context-menu
# https://github.com/mpvnet-player/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-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...
Alt+s script-message mpv.net load-sub #menu: Open > Load external subtitle files...
_ ignore #menu: Open > -
_ script-message mpv.net open-files append #menu: Open > Add files to playlist...
_ ignore #menu: Open > -
_ ignore #menu: Open > Recent
o script-message-to mpvnet open-files #menu: Open > Open Files...
V script-message-to mpvnet open-clipboard #menu: Open > Open URL or file from clipboard
_ script-message-to mpvnet open-optical-media #menu: Open > Open DVD/Blu-ray Drive/Folder...
_ ignore #menu: Open > -
Alt+a script-message-to mpvnet load-audio #menu: Open > Load external audio files...
Alt+s script-message-to mpvnet load-sub #menu: Open > Load external subtitle files...
_ ignore #menu: Open > -
_ script-message-to mpvnet open-files append #menu: Open > Add files to playlist...
_ ignore #menu: Open > -
_ ignore #menu: Open > Recent
_ ignore #menu: -
Space script-message mpv.net play-pause #menu: Play/Pause
Ctrl+s stop #menu: Stop
_ ignore #menu: -
Enter cycle fullscreen #menu: Toggle Fullscreen
F11 script-message mpv.net playlist-add -1; set pause no #menu: Navigate > Previous File
F12 script-message mpv.net playlist-add 1; set pause no #menu: Navigate > Next File
_ ignore #menu: -
Space script-message-to mpvnet play-pause #menu: Play/Pause
Ctrl+s stop #menu: Stop
_ ignore #menu: -
Enter cycle fullscreen #menu: Toggle Fullscreen
F11 script-message-to mpvnet playlist-add -1 #menu: Navigate > Previous File
F12 script-message-to mpvnet playlist-add 1 #menu: Navigate > Next File
_ ignore #menu: Navigate > -
Home script-message mpv.net playlist-first #menu: Navigate > First File
End script-message mpv.net playlist-last #menu: Navigate > Last File
Home script-message-to mpvnet playlist-first #menu: Navigate > First File
End script-message-to mpvnet playlist-last #menu: Navigate > Last File
_ ignore #menu: Navigate > -
F9 script-message-to mpvnet playlist-random #menu: Navigate > Random File
_ ignore #menu: Navigate > -
PGUP add chapter 1 #menu: Navigate > Next Chapter
PGDWN add chapter -1 #menu: Navigate > Previous Chapter
@@ -69,16 +71,17 @@ Ctrl+7 add saturation -1 #menu: Video > Decrease Saturation
Ctrl+8 add saturation 1 #menu: Video > Increase Saturation
_ ignore #menu: Video > -
s async screenshot #menu: Video > Take Screenshot
S async screenshot video #menu: Video > Take Screenshot without subtitles
d cycle deinterlace #menu: Video > Toggle Deinterlace
a cycle-values video-aspect 16:9 4:3 2.35:1 -1 #menu: Video > Cycle Aspect Ratio
Ctrl+r cycle-values video-rotate 90 180 270 0 #menu: Video > Rotate Video
KP7 script-message mpv.net cycle-audio #menu: Audio > Cycle/Next
KP7 script-message-to mpvnet cycle-audio #menu: Audio > Cycle/Next
_ ignore #menu: Audio > -
Ctrl+d add audio-delay 0.1 #menu: Audio > Delay +0.1
Ctrl+D add audio-delay -0.1 #menu: Audio > Delay -0.1
KP8 cycle sub #menu: Subtitle > Cycle/Next
KP8 script-message-to mpvnet cycle-subtitles #menu: Subtitle > Cycle/Next
v cycle sub-visibility #menu: Subtitle > Toggle Visibility
_ ignore #menu: Subtitle > -
z add sub-delay -0.1 #menu: Subtitle > Delay -0.1
@@ -89,11 +92,15 @@ R add sub-pos +1 #menu: Subtitle > Move Down
_ ignore #menu: Subtitle > -
F add sub-scale -0.1 #menu: Subtitle > Decrease Subtitle Font Size
G add sub-scale 0.1 #menu: Subtitle > Increase Subtitle Font Size
_ ignore #menu: Subtitle > -
u cycle-values sub-ass-override force no #menu: Subtitle > Advanced > Toggle overriding SSA/ASS subtitle styles with the normal styles
_ ignore #menu: Track
+ add volume 2 #menu: Volume > Up
- add volume -2 #menu: Volume > Down
0 add volume 2 #menu: Volume > Up
9 add volume -2 #menu: Volume > Down
_ ignore #menu: Volume > -
m cycle mute #menu: Volume > Mute
@@ -105,76 +112,86 @@ _ ignore #menu: Speed > -
_ ignore #menu: Speed > -
BS set speed 1 #menu: Speed > Reset
Alt++ script-message mpv.net scale-window 1.2 #menu: View > Zoom > Enlarge
Alt+- script-message mpv.net scale-window 0.8 #menu: View > Zoom > Shrink
_ ignore #menu: View > Zoom > -
Alt+0 script-message mpv.net window-scale 0.5 #menu: View > Zoom > 50 %
Alt+1 script-message mpv.net window-scale 1.0 #menu: View > Zoom > 100 %
Alt+2 script-message mpv.net window-scale 2.0 #menu: View > Zoom > 200 %
Alt+3 script-message mpv.net window-scale 3.0 #menu: View > Zoom > 300 %
Alt++ script-message-to mpvnet scale-window 1.2 #menu: View > Zoom > Enlarge
Alt+- script-message-to mpvnet scale-window 0.8 #menu: View > Zoom > Shrink
_ ignore #menu: View > Zoom > -
Alt+0 script-message-to mpvnet window-scale 0.5 #menu: View > Zoom > 50 %
Alt+1 script-message-to mpvnet window-scale 1.0 #menu: View > Zoom > 100 %
Alt+2 script-message-to mpvnet window-scale 2.0 #menu: View > Zoom > 200 %
Alt+3 script-message-to mpvnet window-scale 3.0 #menu: View > Zoom > 300 %
F8 script-message mpv.net show-playlist #menu: View > Show Playlist
Ctrl+7 script-message mpv.net show-audio-tracks #menu: View > Show Audio Tracks
Ctrl+8 script-message mpv.net show-subtitle-tracks #menu: View > Show Subtitle Tracks
b cycle border #menu: View > Toggle Border
Ctrl+t cycle ontop #menu: View > Toggle On Top
t script-binding stats/display-stats-toggle #menu: View > Toggle Statistics
Del script-binding osc/visibility #menu: View > Toggle OSC Visibility
i script-message mpv.net show-info #menu: View > Show File/Stream Info
p show-progress #menu: View > Show Progress
Ctrl+p script-message mpv.net show-profiles #menu: View > Show Profiles
F9 show-text ${track-list} 5000 #menu: View > Show Tracks
Ctrl+m script-message mpv.net show-media-info #menu: View > Show Media Info
Alt+r script-message mpv.net show-recent #menu: View > Show Recent
Alt+Left script-message-to mpvnet move-window left #menu: View > Move > Left
Alt+Right script-message-to mpvnet move-window right #menu: View > Move > Right
Alt+Up script-message-to mpvnet move-window top #menu: View > Move > Top
Alt+Down script-message-to mpvnet move-window bottom #menu: View > Move > Bottom
Alt+BS script-message-to mpvnet move-window center #menu: View > Move > Center
` script-binding console/enable #menu: View > Advanced > Show Console
_ script-message mpv.net show-audio-devices #menu: View > Advanced > Show Audio Devices
P script-message mpv.net show-properties #menu: View > Advanced > Show Properties
C script-message mpv.net show-commands #menu: View > Advanced > Show Commands
_ script-message mpv.net show-demuxers #menu: View > Advanced > Show Demuxers
_ script-message mpv.net show-decoders #menu: View > Advanced > Show Decoders
_ script-message mpv.net show-protocols #menu: View > Advanced > Show Protocols
_ script-message mpv.net show-keys #menu: View > Advanced > Show Keys
F8 script-message-to mpvnet show-playlist #menu: View > Show Playlist
Ctrl+p script-message-to mpvnet select-profile #menu: View > Show Profile Selection
Ctrl+P script-message-to mpvnet show-profiles #menu: View > Show Profiles
Ctrl+7 script-message-to mpvnet show-audio-tracks #menu: View > Show Audio Tracks
Ctrl+8 script-message-to mpvnet show-subtitle-tracks #menu: View > Show Subtitle Tracks
Ctrl+c script-message-to mpvnet show-chapters #menu: View > Show Chapters
b cycle border #menu: View > Toggle Border
Ctrl+t cycle ontop #menu: View > Toggle On Top
t script-binding stats/display-stats-toggle #menu: View > Toggle Statistics
Del script-binding osc/visibility #menu: View > Toggle OSC Visibility
i script-message-to mpvnet show-info #menu: View > Show Media Info
Ctrl+m script-message-to mpvnet show-media-info #menu: View > Show Media Info Advanced
p show-progress #menu: View > Show Progress
Alt+r script-message-to mpvnet show-recent #menu: View > Show Recent
_ ignore #menu: Profile
` script-binding console/enable #menu: View > Advanced > Show Console
_ script-message-to mpvnet show-audio-devices #menu: View > Advanced > Show Audio Devices
P script-message-to mpvnet show-properties #menu: View > Advanced > Show Properties
C script-message-to mpvnet show-commands #menu: View > Advanced > Show Commands
_ script-message-to mpvnet show-demuxers #menu: View > Advanced > Show Demuxers
_ script-message-to mpvnet show-decoders #menu: View > Advanced > Show Decoders
_ script-message-to mpvnet show-protocols #menu: View > Advanced > Show Protocols
_ script-message-to mpvnet show-keys #menu: View > Advanced > Show Keys
c script-message mpv.net show-conf-editor #menu: Settings > Show Config Editor
Ctrl+i script-message mpv.net show-input-editor #menu: Settings > Show Input Editor
Ctrl+f script-message mpv.net open-conf-folder #menu: Settings > Open Config Folder
_ ignore #menu: Profile
_ script-message mpv.net reg-file-assoc video #menu: Settings > Setup > Register video file associations
_ script-message mpv.net reg-file-assoc audio #menu: Settings > Setup > Register audio file associations
_ script-message mpv.net reg-file-assoc image #menu: Settings > Setup > Register image file associations
_ script-message mpv.net reg-file-assoc unreg #menu: Settings > Setup > Unregister file associations
c script-message-to mpvnet show-conf-editor #menu: Settings > Show Config Editor
Ctrl+i script-message-to mpvnet show-input-editor #menu: Settings > Show Input Editor
Ctrl+f script-message-to mpvnet open-conf-folder #menu: Settings > Open Config Folder
h script-message mpv.net show-history #menu: Tools > Show History
l ab-loop #menu: Tools > Set/clear A-B loop points
L cycle-values loop-file inf no #menu: Tools > Toggle infinite file looping
_ playlist-shuffle #menu: Tools > Shuffle Playlist
Ctrl+h cycle-values hwdec auto no #menu: Tools > Toggle Hardware Decoding
Q quit-watch-later #menu: Tools > Exit Watch Later
_ script-message-to mpvnet reg-file-assoc video #menu: Settings > Setup > Register video file associations
_ script-message-to mpvnet reg-file-assoc audio #menu: Settings > Setup > Register audio file associations
_ script-message-to mpvnet reg-file-assoc image #menu: Settings > Setup > Register image file associations
_ script-message-to mpvnet reg-file-assoc unreg #menu: Settings > Setup > Unregister file associations
_ script-message mpv.net shell-execute https://mpv.io #menu: Help > Website mpv
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net #menu: Help > Website mpv.net
_ ignore #menu: Help > -
_ script-message mpv.net shell-execute https://mpv.io/manual/stable/ #menu: Help > Manual mpv
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/blob/master/docs/Manual.md #menu: Help > Manual mpv.net
_ ignore #menu: Help > -
_ script-message mpv.net show-about #menu: Help > About mpv.net
h script-message-to mpvnet show-history #menu: Tools > Show History
l ab-loop #menu: Tools > Set/clear A-B loop points
L cycle-values loop-file inf no #menu: Tools > Toggle infinite file looping
_ playlist-shuffle #menu: Tools > Shuffle Playlist
Ctrl+h cycle-values hwdec auto no #menu: Tools > Toggle Hardware Decoding
Q quit-watch-later #menu: Tools > Exit Watch Later
e run powershell -command "explorer.exe '/select,' ( \"${path}\" -replace '/', '\\' )" #menu: Tools > Show current file in File Explorer
F1 script-message mpv.net show-command-palette #menu: Command Palette
_ ignore #menu: -
Esc quit #menu: Exit
_ script-message-to mpvnet shell-execute https://mpv.io #menu: Help > Website mpv
_ script-message-to mpvnet shell-execute https://github.com/mpvnet-player/mpv.net #menu: Help > Website mpv.net
_ ignore #menu: Help > -
_ script-message-to mpvnet shell-execute https://mpv.io/manual/stable/ #menu: Help > Manual mpv
_ script-message-to mpvnet shell-execute https://github.com/mpvnet-player/mpv.net/blob/master/docs/Manual.md #menu: Help > Manual mpv.net
_ ignore #menu: Help > -
_ script-message-to mpvnet show-about #menu: Help > About mpv.net
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
Ctrl+F11 script-message mpv.net playlist-add -10
Ctrl+F12 script-message mpv.net playlist-add 10
8 cycle sub
j cycle sub
F1 script-message-to mpvnet show-command-palette #menu: Command Palette
_ ignore #menu: -
Esc quit #menu: Exit
MBTN_Right script-message-to mpvnet show-menu
6 script-message-to mpvnet show-progress
KP6 script-message-to mpvnet show-progress
KP9 ab-loop
7 script-message-to mpvnet cycle-audio
Sharp script-message-to mpvnet cycle-audio
Ctrl+F11 script-message-to mpvnet playlist-add -10
Ctrl+F12 script-message-to mpvnet playlist-add 10
Alt+q script-message-to mpvnet quick-bookmark
8 script-message-to mpvnet cycle-subtitles
j script-message-to mpvnet cycle-subtitles
q quit
Power quit
Play cycle pause
@@ -204,8 +221,6 @@ 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+Wheel_Up no-osd seek 7

View File

@@ -25,7 +25,7 @@
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="105" />
<ColumnDefinition Width="110" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -76,10 +76,8 @@
</ListBox>
<TextBlock Name="ShowMpvNetSpecific" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="ShowMpvNetSpecific_MouseUp">Show mpv.net specific options</TextBlock>
<TextBlock Name="OpenSettingsTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="OpenSettingsTextBlock_MouseUp">Open config folder</TextBlock>
<TextBlock Name="PreviewTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="PreviewTextBlock_MouseUp">Preview mpv.conf</TextBlock>
<TextBlock Name="ShowManualTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="ShowManualTextBlock_MouseUp">Show mpv manual</TextBlock>
<TextBlock Name="SupportTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="SupportTextBlock_MouseUp">Show support forum</TextBlock>
</StackPanel>
</Grid>
</Window>

View File

@@ -17,7 +17,7 @@ namespace mpvnet
{
public partial class ConfWindow : Window
{
List<SettingBase> SettingsDefinitions = Conf.LoadConf(Properties.Resources.editor_conf);
List<SettingBase> SettingsDefinitions = Conf.LoadConf(Properties.Resources.editor_conf.TrimEnd());
List<ConfItem> ConfItems = new List<ConfItem>();
public ObservableCollection<string> FilterStrings { get; } = new ObservableCollection<string>();
string InitialContent;
@@ -63,10 +63,10 @@ namespace mpvnet
switch (setting)
{
case StringSetting s:
MainStackPanel.Children.Add(new StringSettingControl(s));
MainStackPanel.Children.Add(new StringSettingControl(s) { Visibility = Visibility.Collapsed });
break;
case OptionSetting s:
MainStackPanel.Children.Add(new OptionSettingControl(s));
MainStackPanel.Children.Add(new OptionSettingControl(s) { Visibility = Visibility.Collapsed });
break;
}
}
@@ -90,15 +90,7 @@ namespace mpvnet
if (item.File == "mpv")
{
Core.ProcessProperty(item.Name, item.Value);
try
{
Core.SetPropertyString(item.Name, item.Value, true);
}
catch (Exception ex)
{
App.ShowError(ex.Message);
}
Core.SetPropertyString(item.Name, item.Value);
}
else if (item.File == "mpvnet")
App.ProcessProperty(item.Name, item.Value, true);
@@ -285,15 +277,16 @@ namespace mpvnet
void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
string activeFilter = "";
string searchText = SearchControl.Text;
foreach (var i in FilterStrings)
if (SearchControl.Text == i + ":")
foreach (string i in FilterStrings)
if (searchText == i + ":")
activeFilter = i;
if (activeFilter == "")
{
foreach (UIElement i in MainStackPanel.Children)
if ((i as ISettingControl).Contains(SearchControl.Text))
if ((i as ISettingControl).Contains(searchText) && searchText.Length > 1)
i.Visibility = Visibility.Visible;
else
i.Visibility = Visibility.Collapsed;
@@ -325,18 +318,11 @@ namespace mpvnet
SearchControl.Text = e.AddedItems[0] + ":";
}
void OpenSettingsTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
ProcessHelp.ShellExecute(Path.GetDirectoryName(Core.ConfPath));
void PreviewTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
Msg.ShowInfo("mpv.conf Preview" + BR2 + GetContent("mpv"));
void PreviewTextBlock_MouseUp(object sender, MouseButtonEventArgs e) => Msg.ShowInfo(GetContent("mpv"));
void ShowManualTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
ProcessHelp.ShellExecute("https://mpv.io/manual/master/");
void SupportTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
ProcessHelp.ShellExecute("https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#support");
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);

View File

@@ -50,7 +50,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(288F, 288F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(348, 0);
this.ClientSize = new System.Drawing.Size(857, 444);
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);

View File

@@ -3,7 +3,6 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
@@ -21,9 +20,11 @@ namespace mpvnet
{
public partial class MainForm : Form
{
public SnapManager SnapManager = new SnapManager();
public ElementHost CommandPaletteHost { get; set; }
public IntPtr mpvWindowHandle { get; set; }
public static MainForm Instance { get; set; }
public Dictionary<string, WpfControls.MenuItem> MenuItemDuplicate = new Dictionary<string, WpfControls.MenuItem>();
new WpfControls.ContextMenu ContextMenu { get; set; }
AutoResetEvent MenuAutoResetEvent { get; } = new AutoResetEvent(false);
@@ -35,7 +36,6 @@ namespace mpvnet
int TaskbarButtonCreatedMessage;
bool WasMaximized;
bool WasShown;
public MainForm()
{
@@ -45,14 +45,17 @@ namespace mpvnet
{
Instance = this;
Core.Shutdown += Core_Shutdown;
Core.ShowMenu += Core_ShowMenu;
Core.VideoSizeChanged += Core_VideoSizeChanged;
Core.ScaleWindow += Core_ScaleWindow;
Core.WindowScale += Core_WindowScale;
Core.FileLoaded += Core_FileLoaded;
Core.MoveWindow += Core_MoveWindow;
Core.Pause += Core_Pause;
Core.PlaylistPosChanged += Core_PlaylistPosChanged;
Core.ScaleWindow += Core_ScaleWindow;
Core.Seek += () => UpdateProgressBar();
Core.PlaylistPosChanged += (value) => SetTitle();
Core.ShowMenu += Core_ShowMenu;
Core.Shutdown += Core_Shutdown;
Core.VideoSizeChanged += Core_VideoSizeChanged;
Core.WindowScaleMpv += Core_WindowScaleMpv;
Core.WindowScaleNET += Core_WindowScaleNET;
if (Core.GPUAPI != "vulkan")
Init();
@@ -115,10 +118,45 @@ namespace mpvnet
}
}
void Core_MoveWindow(string direction)
{
BeginInvoke(new Action(() => {
Screen screen = Screen.FromControl(this);
Rectangle workingArea = GetWorkingArea(Handle, screen.WorkingArea);
switch (direction)
{
case "left":
Left = workingArea.Left;
break;
case "top":
Top = 0;
break;
case "right":
Left = workingArea.Width - Width + workingArea.Left;
break;
case "bottom":
Top = workingArea.Height - Height;
break;
case "center":
Left = (screen.Bounds.Width - Width) / 2;
Top = (screen.Bounds.Height - Height) / 2;
break;
}
}));
}
void Core_PlaylistPosChanged(int pos)
{
if (pos == -1)
SetTitle();
}
void Init()
{
Core.Init(Handle);
// bool methods not working correctly
Core.ObserveProperty("window-maximized", PropChangeWindowMaximized);
Core.ObserveProperty("window-minimized", PropChangeWindowMinimized);
@@ -126,7 +164,6 @@ namespace mpvnet
Core.ObservePropertyBool("fullscreen", PropChangeFullscreen);
Core.ObservePropertyBool("keepaspect-window", value => Core.KeepaspectWindow = value);
Core.ObservePropertyBool("ontop", PropChangeOnTop);
Core.ObservePropertyBool("pause", PropChangePause);
Core.ObservePropertyString("sid", PropChangeSid);
Core.ObservePropertyString("aid", PropChangeAid);
@@ -136,8 +173,6 @@ namespace mpvnet
Core.ObservePropertyInt("edition", PropChangeEdition);
Core.ObservePropertyDouble("window-scale", WindowScale);
Core.ProcessCommandLine(false);
}
@@ -172,7 +207,7 @@ namespace mpvnet
}));
}
void Core_WindowScale(float scale)
void Core_WindowScaleNET(float scale)
{
BeginInvoke(new Action(() => {
SetSize(
@@ -183,9 +218,9 @@ namespace mpvnet
}));
}
void WindowScale(double scale)
void Core_WindowScaleMpv(double scale)
{
if (!WasShown)
if (!Core.Shown)
return;
BeginInvoke(new Action(() => {
@@ -219,15 +254,17 @@ namespace mpvnet
Point pos = PointToClient(MousePosition);
float top = 0;
if (FormBorderStyle == FormBorderStyle.None)
if (!Core.Border)
top = ClientSize.Height * 0.1f;
return pos.Y > ClientSize.Height * 0.85 || pos.Y < top;
return pos.Y > ClientSize.Height * 0.78 || pos.Y < top;
}
void UpdateMenu()
{
lock (Core.MediaTracks)
Core.UpdateExternalTracks();
lock (Core.MediaTracksLock)
{
var trackMenuItem = FindMenuItem("Track");
@@ -235,42 +272,42 @@ namespace mpvnet
{
trackMenuItem.Items.Clear();
MediaTrack[] audTracks = Core.MediaTracks.Where(track => track.Type == "a").ToArray();
MediaTrack[] subTracks = Core.MediaTracks.Where(track => track.Type == "s").ToArray();
MediaTrack[] vidTracks = Core.MediaTracks.Where(track => track.Type == "v").ToArray();
MediaTrack[] ediTracks = Core.MediaTracks.Where(track => track.Type == "e").ToArray();
var audTracks = Core.MediaTracks.Where(track => track.Type == "a");
var subTracks = Core.MediaTracks.Where(track => track.Type == "s");
var vidTracks = Core.MediaTracks.Where(track => track.Type == "v");
var ediTracks = Core.MediaTracks.Where(track => track.Type == "e");
foreach (MediaTrack track in vidTracks)
{
var mi = new WpfControls.MenuItem() { Header = track.Text };
var mi = new WpfControls.MenuItem() { Header = track.Text.Replace("_", "__") };
mi.Click += (sender, args) => Core.CommandV("set", "vid", track.ID.ToString());
mi.IsChecked = Core.VID == track.ID.ToString();
trackMenuItem.Items.Add(mi);
}
if (vidTracks.Length > 0)
if (vidTracks.Count() > 0)
trackMenuItem.Items.Add(new WpfControls.Separator());
foreach (MediaTrack track in audTracks)
{
var mi = new WpfControls.MenuItem() { Header = track.Text };
var mi = new WpfControls.MenuItem() { Header = track.Text.Replace("_", "__") };
mi.Click += (sender, args) => Core.CommandV("set", "aid", track.ID.ToString());
mi.IsChecked = Core.AID == track.ID.ToString();
trackMenuItem.Items.Add(mi);
}
if (subTracks.Length > 0)
if (subTracks.Count() > 0)
trackMenuItem.Items.Add(new WpfControls.Separator());
foreach (MediaTrack track in subTracks)
{
var mi = new WpfControls.MenuItem() { Header = track.Text };
var mi = new WpfControls.MenuItem() { Header = track.Text.Replace("_", "__") };
mi.Click += (sender, args) => Core.CommandV("set", "sid", track.ID.ToString());
mi.IsChecked = Core.SID == track.ID.ToString();
trackMenuItem.Items.Add(mi);
}
if (subTracks.Length > 0)
if (subTracks.Count() > 0)
{
var mi = new WpfControls.MenuItem() { Header = "S: No subtitles" };
mi.Click += (sender, args) => Core.CommandV("set", "sid", "no");
@@ -278,12 +315,12 @@ namespace mpvnet
trackMenuItem.Items.Add(mi);
}
if (ediTracks.Length > 0)
if (ediTracks.Count() > 0)
trackMenuItem.Items.Add(new WpfControls.Separator());
foreach (MediaTrack track in ediTracks)
{
var mi = new WpfControls.MenuItem() { Header = track.Text };
var mi = new WpfControls.MenuItem() { Header = track.Text.Replace("_", "__") };
mi.Click += (sender, args) => Core.CommandV("set", "edition", track.ID.ToString());
mi.IsChecked = Core.Edition == track.ID;
trackMenuItem.Items.Add(mi);
@@ -291,21 +328,18 @@ namespace mpvnet
}
}
lock (Core.Chapters)
var chaptersMenuItem = FindMenuItem("Chapters");
if (chaptersMenuItem != null)
{
var chaptersMenuItem = FindMenuItem("Chapters");
chaptersMenuItem.Items.Clear();
if (chaptersMenuItem != null)
foreach (Chapter chapter in Core.GetChapters())
{
chaptersMenuItem.Items.Clear();
foreach (var pair in Core.Chapters)
{
var chapterMenuItem = new WpfControls.MenuItem() { Header = pair.Key };
chapterMenuItem.InputGestureText = TimeSpan.FromSeconds(pair.Value).ToString().Substring(0, 8);
chapterMenuItem.Click += (sender, args) => Core.CommandV("seek", pair.Value.ToString(CultureInfo.InvariantCulture), "absolute");
chaptersMenuItem.Items.Add(chapterMenuItem);
}
var chapterMenuItem = new WpfControls.MenuItem() { Header = chapter.Title };
chapterMenuItem.InputGestureText = chapter.TimeDisplay;
chapterMenuItem.Click += (sender, args) => Core.CommandV("seek", chapter.Time.ToString(CultureInfo.InvariantCulture), "absolute");
chaptersMenuItem.Items.Add(chapterMenuItem);
}
}
@@ -317,11 +351,12 @@ namespace mpvnet
foreach (string path in App.Settings.RecentFiles)
{
var mi = MenuHelp.Add(recentMenuItem.Items, path.ShortPath(100));
var file = App.GetTitleAndPath(path);
var mi = MenuHelp.Add(recentMenuItem.Items, file.Title.ShortPath(100));
if (mi != null)
mi.Click += (sender, args) =>
Core.LoadFiles(new[] { path }, true, ModifierKeys.HasFlag(Keys.Control));
Core.LoadFiles(new[] { file.Path }, true, ModifierKeys.HasFlag(Keys.Control));
}
recentMenuItem.Items.Add(new WpfControls.Separator());
@@ -369,7 +404,7 @@ namespace mpvnet
{
profilesMenuItem.Items.Clear();
foreach (string profile in ProfileNames)
foreach (string profile in Core.ProfileNames)
{
if (!profile.StartsWith("extension."))
{
@@ -387,23 +422,6 @@ namespace mpvnet
}
}
private string[] _ProfileNames;
public string[] ProfileNames {
get {
if (_ProfileNames == null)
{
string[] ignore = { "builtin-pseudo-gui", "encoding", "libmpv", "pseudo-gui", "default" };
string profileList = Core.GetPropertyString("profile-list");
var json = profileList.FromJson<List<Dictionary<string, object>>>();
_ProfileNames = json.Select(i => i["name"].ToString())
.Where(i => !ignore.Contains(i)).ToArray();
}
return _ProfileNames;
}
}
public WpfControls.MenuItem FindMenuItem(string text) => FindMenuItem(text, ContextMenu.Items);
WpfControls.MenuItem FindMenuItem(string text, WpfControls.ItemCollection items)
@@ -442,13 +460,23 @@ namespace mpvnet
}
Screen screen = Screen.FromControl(this);
int autoFitHeight = Convert.ToInt32(screen.WorkingArea.Height * Core.Autofit);
Rectangle workingArea = GetWorkingArea(Handle, screen.WorkingArea);
int autoFitHeight = Convert.ToInt32(workingArea.Height * Core.Autofit);
if (Core.VideoSize.Height == 0 || Core.VideoSize.Width == 0 ||
Core.VideoSize.Width / (float)Core.VideoSize.Height < App.MinimumAspectRatio)
if (App.AutofitAudio > 1) App.AutofitAudio = 1;
if (App.AutofitImage > 1) App.AutofitImage = 1;
if (Core.IsAudio) autoFitHeight = Convert.ToInt32(workingArea.Height * App.AutofitAudio);
if (Core.IsImage) autoFitHeight = Convert.ToInt32(workingArea.Height * App.AutofitImage);
if (Core.VideoSize.Height == 0 || Core.VideoSize.Width == 0)
Core.VideoSize = new Size((int)(autoFitHeight * (16 / 9f)), autoFitHeight);
float minAspectRatio = Core.IsAudio ? App.MinimumAspectRatioAudio : App.MinimumAspectRatio;
if (minAspectRatio != 0 && Core.VideoSize.Width / (float)Core.VideoSize.Height < minAspectRatio)
Core.VideoSize = new Size((int)(autoFitHeight * minAspectRatio), autoFitHeight);
Size videoSize = Core.VideoSize;
int height = videoSize.Height;
@@ -484,7 +512,7 @@ namespace mpvnet
height = windowSize.Height;
width = height * videoSize.Width / videoSize.Height;
}
else if (App.StartSize == "height-session")
else if (App.StartSize == "height-session" || App.StartSize == "session")
{
height = autoFitHeight;
width = height * videoSize.Width / videoSize.Height;
@@ -499,7 +527,7 @@ namespace mpvnet
width = autoFitHeight / 9 * 16;
height = (int)Math.Ceiling(width * videoSize.Height / (double)videoSize.Width);
}
else if (KeepSize() && windowSize.Height != 0)
else if (App.StartSize == "always" && windowSize.Height != 0)
{
height = windowSize.Height;
width = windowSize.Width;
@@ -513,8 +541,10 @@ namespace mpvnet
void SetSize(int width, int height, Screen screen, bool checkAutofit = true)
{
int maxHeight = screen.WorkingArea.Height - (Height - ClientSize.Height) - 2;
int maxWidth = screen.WorkingArea.Width - (Width - ClientSize.Width);
Rectangle workingArea = GetWorkingArea(Handle, screen.WorkingArea);
int maxHeight = workingArea.Height - (Height - ClientSize.Height) - 2;
int maxWidth = workingArea.Width - (Width - ClientSize.Width);
int startWidth = width;
int startHeight = height;
@@ -569,10 +599,10 @@ namespace mpvnet
Screen[] screens = Screen.AllScreens;
int minLeft = screens.Select(val => val.WorkingArea.X).Min();
int maxRight = screens.Select(val => val.WorkingArea.Right).Max();
int minTop = screens.Select(val => val.WorkingArea.Y).Min();
int maxBottom = screens.Select(val => val.WorkingArea.Bottom).Max();
int minLeft = screens.Select(val => GetWorkingArea(Handle, val.WorkingArea).X).Min();
int maxRight = screens.Select(val => GetWorkingArea(Handle, val.WorkingArea).Right).Max();
int minTop = screens.Select(val => GetWorkingArea(Handle, val.WorkingArea).Y).Min();
int maxBottom = screens.Select(val => GetWorkingArea(Handle, val.WorkingArea).Bottom).Max();
if (left < minLeft)
left = minLeft;
@@ -618,7 +648,12 @@ namespace mpvnet
if (WasMaximized)
WindowState = FormWindowState.Maximized;
else
{
WindowState = FormWindowState.Normal;
if (!Core.WasInitialSizeSet)
SetFormPosAndSize();
}
if (Core.Border)
FormBorderStyle = FormBorderStyle.Sizable;
@@ -633,7 +668,7 @@ namespace mpvnet
public int GetHorizontalLocation(Screen screen)
{
Rectangle workingArea = screen.WorkingArea;
Rectangle workingArea = GetWorkingArea(Handle, screen.WorkingArea);
Rectangle rect = new Rectangle(Left - workingArea.X, Top - workingArea.Y, Width, Height);
if (workingArea.Width / (float)Width < 1.1)
@@ -650,7 +685,7 @@ namespace mpvnet
public int GetVerticalLocation(Screen screen)
{
Rectangle workingArea = screen.WorkingArea;
Rectangle workingArea = GetWorkingArea(Handle, screen.WorkingArea);
Rectangle rect = new Rectangle(Left - workingArea.X, Top - workingArea.Y, Width, Height);
if (workingArea.Height / (float)Height < 1.1)
@@ -667,10 +702,9 @@ namespace mpvnet
public void BuildMenu()
{
string content = File.ReadAllText(Core.InputConfPath);
var items = CommandItem.GetItems(content);
var items = CommandItem.GetItems(Core.InputConfContent);
if (!content.Contains("#menu:"))
if (!Core.InputConfContent.Contains("#menu:"))
{
var defaultItems = CommandItem.GetItems(Properties.Resources.input_conf);
@@ -684,41 +718,48 @@ namespace mpvnet
foreach (CommandItem item in items)
{
var tempItem = item;
CommandItem tempItem = item;
if (string.IsNullOrEmpty(tempItem.Path))
continue;
var menuItem = MenuHelp.Add(ContextMenu.Items, tempItem.Path);
if (menuItem != null)
if (MenuItemDuplicate.ContainsKey(tempItem.Path))
{
menuItem.Click += (sender, args) => {
try {
App.RunTask(() => {
MenuAutoResetEvent.WaitOne();
System.Windows.Application.Current.Dispatcher.Invoke(
DispatcherPriority.Background, new Action(delegate { }));
if (!string.IsNullOrEmpty(tempItem.Command))
Core.Command(tempItem.Command);
});
}
catch (Exception ex) {
Msg.ShowException(ex);
}
};
var mi = MenuItemDuplicate[tempItem.Path];
mi.InputGestureText = mi.InputGestureText + ", " + tempItem.Input;
}
else
{
var menuItem = MenuHelp.Add(ContextMenu.Items, tempItem.Path);
menuItem.InputGestureText = tempItem.Input;
if (menuItem != null)
{
MenuItemDuplicate[tempItem.Path] = menuItem;
menuItem.Click += (sender, args) => {
try {
App.RunTask(() => {
MenuAutoResetEvent.WaitOne();
System.Windows.Application.Current.Dispatcher.Invoke(
DispatcherPriority.Background, new Action(delegate { }));
if (!string.IsNullOrEmpty(tempItem.Command))
Core.Command(tempItem.Command);
});
}
catch (Exception ex) {
Msg.ShowException(ex);
}
};
menuItem.InputGestureText = tempItem.Input;
}
}
}
}
void Core_FileLoaded()
{
string path = Core.GetPropertyString("path");
BeginInvoke(new Action(() => {
Text = Core.Expand(Title);
SetTitleInternal();
int interval = (int)(Core.Duration.TotalMilliseconds / 100);
@@ -732,17 +773,46 @@ namespace mpvnet
UpdateProgressBar();
}));
if (App.Settings.RecentFiles.Contains(path))
App.Settings.RecentFiles.Remove(path);
string path = Core.GetPropertyString("path");
path = Core.ConvertFilePath(path);
if (path.Contains("://"))
{
string title = Core.GetPropertyString("media-title");
if (!string.IsNullOrEmpty(title) && path != title)
path = path + "|" + title;
}
if (!string.IsNullOrEmpty(path) && path != @"bd://" && path != @"dvd://")
{
if (App.Settings.RecentFiles.Contains(path))
App.Settings.RecentFiles.Remove(path);
if (path != @"bd://" && path != @"dvd://")
App.Settings.RecentFiles.Insert(0, path);
while (App.Settings.RecentFiles.Count > App.RecentCount)
App.Settings.RecentFiles.RemoveAt(App.RecentCount);
while (App.Settings.RecentFiles.Count > App.RecentCount)
App.Settings.RecentFiles.RemoveAt(App.RecentCount);
}
}
void SetTitle() => BeginInvoke(new Action(() => Text = Core.Expand(Title)));
void SetTitle() => BeginInvoke(new Action(() => SetTitleInternal()));
void SetTitleInternal()
{
string title = Title;
if (title == "${filename}" && Core.Path.ContainsEx("://"))
title = "${media-title}";
string text = Core.Expand(title);
if (text == "(unavailable)" || Core.PlaylistPos == -1)
text = "mpv.net";
Text = text;
}
public void Voodoo()
{
@@ -752,7 +822,7 @@ namespace mpvnet
void SaveWindowProperties()
{
if (WindowState == FormWindowState.Normal && WasShown)
if (WindowState == FormWindowState.Normal && Core.Shown)
{
SavePosition();
App.Settings.WindowSize = ClientSize;
@@ -817,13 +887,14 @@ namespace mpvnet
case 0x20b: // WM_XBUTTONDOWN
case 0x20c: // WM_XBUTTONUP
case 0x20e: // WM_MOUSEHWHEEL
case 0x2a3: // WM_MOUSELEAVE
if (mpvWindowHandle == IntPtr.Zero)
mpvWindowHandle = FindWindowEx(Handle, IntPtr.Zero, "mpv", null);
if (mpvWindowHandle != IntPtr.Zero)
m.Result = SendMessage(mpvWindowHandle, m.Msg, m.WParam, m.LParam);
break;
case 0x051: // WM_INPUTLANGCHANGE
case 0x51: // WM_INPUTLANGCHANGE
ActivateKeyboardLayout(m.LParam, 0x00000100u /*KLF_SETFORPROCESS*/);
break;
case 0x319: // WM_APPCOMMAND
@@ -838,10 +909,10 @@ namespace mpvnet
}
}
break;
case 0x0312: // WM_HOTKEY
case 0x312: // WM_HOTKEY
GlobalHotkey.Execute(m.WParam.ToInt32());
break;
case 0x0200: // WM_MOUSEMOVE
case 0x200: // WM_MOUSEMOVE
if (Environment.TickCount - LastCycleFullscreen > 500)
{
Point pos = PointToClient(Cursor.Position);
@@ -851,26 +922,22 @@ namespace mpvnet
if (CursorHelp.IsPosDifferent(LastCursorPosition))
CursorHelp.Show();
break;
case 0x2a3: // WM_MOUSELEAVE
//osc won't auto hide after mouse left window in borderless mode
Core.Command($"mouse {ClientSize.Width / 2} {ClientSize.Height / 3}");
break;
case 0x203: // WM_LBUTTONDBLCLK
{
Point pos = PointToClient(Cursor.Position);
Core.Command($"mouse {pos.X} {pos.Y} 0 double");
}
break;
case 0x02E0: // WM_DPICHANGED
case 0x2E0: // WM_DPICHANGED
{
if (!WasShown)
if (!Core.Shown)
break;
RECT rect = Marshal.PtrToStructure<RECT>(m.LParam);
SetWindowPos(Handle, IntPtr.Zero, rect.Left, rect.Top, rect.Width, rect.Height, 0);
}
break;
case 0x0214: // WM_SIZING
case 0x214: // WM_SIZING
if (Core.KeepaspectWindow)
{
RECT rc = Marshal.PtrToStructure<RECT>(m.LParam);
@@ -898,7 +965,7 @@ namespace mpvnet
m.Result = new IntPtr(1);
}
return;
case 0x004A: // WM_COPYDATA
case 0x4A: // WM_COPYDATA
{
var copyData = (COPYDATASTRUCT)m.GetLParam(typeof(COPYDATASTRUCT));
string[] args = copyData.lpData.Split('\n');
@@ -922,6 +989,56 @@ namespace mpvnet
Activate();
}
return;
case 0x84: // WM_NCHITTEST
// resize borderless window
if (!Core.Border && !Core.Fullscreen) {
const int HTCLIENT = 1;
const int HTLEFT = 10;
const int HTRIGHT = 11;
const int HTTOP = 12;
const int HTTOPLEFT = 13;
const int HTTOPRIGHT = 14;
const int HTBOTTOM = 15;
const int HTBOTTOMLEFT = 16;
const int HTBOTTOMRIGHT = 17;
int x = (short)(m.LParam.ToInt32() & 0xFFFF); // LoWord
int y = (short)(m.LParam.ToInt32() >> 16); // HiWord
Point pt = PointToClient(new Point(x, y));
Size cs = ClientSize;
m.Result = new IntPtr(HTCLIENT);
int distance = FontHeight / 3;
if (pt.X >= cs.Width - distance && pt.Y >= cs.Height - distance && cs.Height >= distance)
m.Result = (IntPtr)HTBOTTOMRIGHT;
else if (pt.X <= distance && pt.Y >= cs.Height - distance && cs.Height >= distance)
m.Result = (IntPtr)HTBOTTOMLEFT;
else if (pt.X <= distance && pt.Y <= distance && cs.Height >= distance)
m.Result = (IntPtr)HTTOPLEFT;
else if (pt.X >= cs.Width - distance && pt.Y <= distance && cs.Height >= distance)
m.Result = (IntPtr)HTTOPRIGHT;
else if (pt.Y <= distance && cs.Height >= distance)
m.Result = (IntPtr)HTTOP;
else if (pt.Y >= cs.Height - distance && cs.Height >= distance)
m.Result = (IntPtr)HTBOTTOM;
else if (pt.X <= distance && cs.Height >= distance)
m.Result = (IntPtr)HTLEFT;
else if (pt.X >= cs.Width - distance && cs.Height >= distance)
m.Result = (IntPtr)HTRIGHT;
return;
}
break;
case 0x231: // WM_ENTERSIZEMOVE
case 0x005: // WM_SIZE
if (Core.SnapWindow)
SnapManager.OnSizeAndEnterSizeMove(this);
break;
case 0x216: // WM_MOVING
if (Core.SnapWindow)
SnapManager.OnMoving(ref m);
break;
}
if (m.Msg == TaskbarButtonCreatedMessage && Core.TaskbarProgress)
@@ -942,8 +1059,9 @@ namespace mpvnet
LastCursorPosition = MousePosition;
LastCursorChanged = Environment.TickCount;
}
else if (Environment.TickCount - LastCursorChanged > 1500 &&
!IsMouseInOSC() && ClientRectangle.Contains(PointToClient(MousePosition)) &&
else if (((Environment.TickCount - LastCursorChanged > 1500 &&
!IsMouseInOSC()) || Environment.TickCount - LastCursorChanged > 5000) &&
ClientRectangle.Contains(PointToClient(MousePosition)) &&
ActiveForm == this && !ContextMenu.IsVisible && !IsCommandPaletteVissible())
CursorHelp.Hide();
@@ -954,7 +1072,7 @@ namespace mpvnet
void UpdateProgressBar()
{
if (Core.TaskbarProgress && Taskbar != null)
Taskbar.SetValue(Core.GetPropertyDouble("time-pos"), Core.Duration.TotalSeconds);
Taskbar.SetValue(Core.GetPropertyDouble("time-pos", false), Core.Duration.TotalSeconds);
}
void PropChangeOnTop(bool value) => BeginInvoke(new Action(() => TopMost = value));
@@ -971,7 +1089,7 @@ namespace mpvnet
void PropChangeWindowMaximized()
{
if (!WasShown)
if (!Core.Shown)
return;
BeginInvoke(new Action(() =>
@@ -987,7 +1105,7 @@ namespace mpvnet
void PropChangeWindowMinimized()
{
if (!WasShown)
if (!Core.Shown)
return;
BeginInvoke(new Action(() =>
@@ -1016,13 +1134,11 @@ namespace mpvnet
}));
}
void PropChangePause(bool paused)
void Core_Pause()
{
Core.Paused = paused;
if (Taskbar != null && Core.TaskbarProgress)
{
if (paused)
if (Core.Paused)
Taskbar.SetState(TaskbarStates.Paused);
else
Taskbar.SetState(TaskbarStates.Normal);
@@ -1036,6 +1152,8 @@ namespace mpvnet
Core.VideoSizeAutoResetEvent.WaitOne(App.StartThreshold);
LastCycleFullscreen = Environment.TickCount;
SetFormPosAndSize();
if (Core.PlaylistPos == -1)
Core.ShowLogo();
}
protected override void OnActivated(EventArgs e)
@@ -1070,7 +1188,7 @@ namespace mpvnet
App.RunTask(() => App.Extension = new Extension());
App.RunTask(() => App.CopyMpvnetCom());
CSharpScriptHost.ExecuteScriptsInFolder(Core.ConfigFolder + "scripts-cs");
WasShown = true;
Core.Shown = true;
}
void ContextMenu_Closed(object sender, System.Windows.RoutedEventArgs e)
@@ -1083,7 +1201,7 @@ namespace mpvnet
base.OnResize(e);
SaveWindowProperties();
if (Core.IsLogoVisible)
if (Core.PlaylistPos == -1 && Core.Shown)
Core.ShowLogo();
if (FormBorderStyle != FormBorderStyle.None)
@@ -1094,7 +1212,7 @@ namespace mpvnet
WasMaximized = false;
}
if (WasShown)
if (Core.Shown)
{
if (WindowState == FormWindowState.Minimized)
Core.SetPropertyBool("window-minimized", true);
@@ -1117,6 +1235,8 @@ namespace mpvnet
if (!Core.ShutdownAutoResetEvent.WaitOne(10000))
Msg.ShowError("Shutdown thread failed to complete within 10 seconds.");
Core.Destroy();
}
protected override void OnMouseDown(MouseEventArgs e)
@@ -1254,7 +1374,7 @@ namespace mpvnet
if (CommandPaletteHost == null)
return;
CommandPaletteHost.Width = FontHeight * 25;
CommandPaletteHost.Width = FontHeight * 26;
if (CommandPaletteHost.Width > ClientSize.Width)
CommandPaletteHost.Width = ClientSize.Width;

View File

@@ -0,0 +1,81 @@

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using static mpvnet.Native;
namespace mpvnet
{
public class SnapManager
{
int DragOffsetX { get; set; }
int DragOffsetY { get; set; }
IntPtr Handle;
[Flags]
public enum SnapLocation
{
None = 0,
Left = 1 << 0,
Top = 1 << 1,
Right = 1 << 2,
Bottom = 1 << 3,
All = Left | Top | Right | Bottom
}
public int AnchorDistance { get; set; }
public int SnapDistance { get; set; }
bool InSnapRange(int a, int b) => Math.Abs(a - b) < SnapDistance;
void FindSnap(ref Rectangle effectiveBounds)
{
Screen currentScreen = Screen.FromPoint(effectiveBounds.Location);
Rectangle workingArea = GetWorkingArea(Handle, currentScreen.WorkingArea);
if (InSnapRange(effectiveBounds.Left, workingArea.Left + AnchorDistance))
effectiveBounds.X = workingArea.Left + AnchorDistance;
else if (InSnapRange(effectiveBounds.Right, workingArea.Right - AnchorDistance))
effectiveBounds.X = workingArea.Right - AnchorDistance - effectiveBounds.Width;
if (InSnapRange(effectiveBounds.Top, workingArea.Top + AnchorDistance))
effectiveBounds.Y = workingArea.Top + AnchorDistance;
else if (InSnapRange(effectiveBounds.Bottom, workingArea.Bottom - AnchorDistance))
effectiveBounds.Y = workingArea.Bottom - AnchorDistance - effectiveBounds.Height;
}
public void OnMoving(ref Message m)
{
if (Handle == IntPtr.Zero)
return;
RECT boundsLtrb = Marshal.PtrToStructure<RECT>(m.LParam);
Rectangle bounds = boundsLtrb.ToRectangle();
// This is where the window _would_ be located if snapping
// had not occurred. This prevents the cursor from sliding
// off the title bar if the snap distance is too large.
Rectangle effectiveBounds = new Rectangle(
Cursor.Position.X - DragOffsetX,
Cursor.Position.Y - DragOffsetY,
bounds.Width,
bounds.Height);
FindSnap(ref effectiveBounds);
RECT newLtrb = RECT.FromRectangle(effectiveBounds);
Marshal.StructureToPtr(newLtrb, m.LParam, false);
m.Result = new IntPtr(1);
}
public void OnSizeAndEnterSizeMove(Form form)
{
Handle = form.Handle;
SnapDistance = form.Font.Height;
// Need to handle window size changed as well when
// un-maximizing the form by dragging the title bar.
DragOffsetX = Cursor.Position.X - form.Left;
DragOffsetY = Cursor.Position.Y - form.Top;
}
}
}

View File

@@ -13,6 +13,7 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -25,7 +26,6 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@@ -69,6 +69,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -93,6 +94,7 @@
<Compile Include="Misc\Common.cs" />
<Compile Include="Misc\FolderBrowser.cs" />
<Compile Include="Misc\JSONParser.cs" />
<Compile Include="WinForms\SnapManager.cs" />
<Compile Include="WPF\HandyControl\Controls\Attach\BorderElement.cs" />
<Compile Include="WPF\HandyControl\Controls\Attach\MenuTopLineAttach.cs" />
<Compile Include="WPF\HandyControl\Tools\Converter\BorderCircularConverter.cs" />
@@ -186,10 +188,10 @@
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Native\libmpv.cs" />
<Compile Include="Misc\MainForm.cs">
<Compile Include="WinForms\MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Misc\MainForm.Designer.cs">
<Compile Include="WinForms\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Misc\Misc.cs" />
@@ -211,7 +213,7 @@
<DependentUpon>InputWindow.xaml</DependentUpon>
</Compile>
<Compile Include="WPF\WPF.cs" />
<EmbeddedResource Include="Misc\MainForm.resx">
<EmbeddedResource Include="WinForms\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>