Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5c9df31e4 | ||
|
|
c0a8e895f7 | ||
|
|
064ae44ecf | ||
|
|
005ba6e5ea | ||
|
|
9f6aba6cbd | ||
|
|
87e3d9ca3e | ||
|
|
29a0eae3d5 | ||
|
|
01b2492cde | ||
|
|
d2b1ca0c69 | ||
|
|
91b429e6b0 | ||
|
|
fa05e95892 | ||
|
|
701a58a4bf | ||
|
|
387c3f7896 | ||
|
|
eeb0189577 | ||
|
|
de4c2d6d70 | ||
|
|
63ee598ebd | ||
|
|
1bf8e568c5 | ||
|
|
f8f58dba5e | ||
|
|
ebb8ad351a | ||
|
|
0202c34c6f | ||
|
|
c3f2b22ff5 | ||
|
|
c1a03c3e4b | ||
|
|
e041908f04 | ||
|
|
270559c3f7 | ||
|
|
0dfd19eb45 | ||
|
|
9cdba6d2f2 | ||
|
|
50bf09ff8d | ||
|
|
c54fa708f8 | ||
|
|
7698e873ca | ||
|
|
89b8de2c40 | ||
|
|
259d2d882a | ||
|
|
b7fbef5a88 | ||
|
|
0ca9ac93f1 | ||
|
|
f7b3900a0a | ||
|
|
c98036dc42 | ||
|
|
a9e7ae4b97 | ||
|
|
30fb744114 | ||
|
|
d465516a6a | ||
|
|
0b951875e6 | ||
|
|
5ed65733a0 | ||
|
|
caac45a871 | ||
|
|
f4f69816a7 | ||
|
|
1dddf129df | ||
|
|
ca9690c3b3 | ||
|
|
3b0b098bda | ||
|
|
c72080e92c | ||
|
|
237a3cf132 | ||
|
|
562f149fff | ||
|
|
dc85372c36 | ||
|
|
2595465ec7 | ||
|
|
1db733ae13 | ||
|
|
ba3bc48297 | ||
|
|
5e16c47100 | ||
|
|
a13c6648a3 | ||
|
|
5dc244d6f6 | ||
|
|
da9bc4199b | ||
|
|
1868957388 | ||
|
|
0139a1ef70 | ||
|
|
0989b7ef95 | ||
|
|
16924e5a3b | ||
|
|
502e1a9651 | ||
|
|
36a7bbcfab | ||
|
|
8fda90e09a | ||
|
|
269457dbde | ||
|
|
c93647841e | ||
|
|
0f78ea38ac | ||
|
|
7eb60f3e4c | ||
|
|
2636da446e | ||
|
|
c7fab24044 | ||
|
|
2ce1f3d9c1 | ||
|
|
d2f9108c22 | ||
|
|
3a2b9ee542 | ||
|
|
5c93bc00f7 |
71
Changelog.md
Normal file
@@ -0,0 +1,71 @@
|
||||
### 4.3.1
|
||||
|
||||
- there was a old bug setting the screen property
|
||||
|
||||
### 4.3
|
||||
|
||||
- there was new bug in file association feature
|
||||
|
||||
### 4.2
|
||||
|
||||
- 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/inputConf.txt#L33)
|
||||
- a setting was added to force using a single mpv.net process instance
|
||||
|
||||
### 4.1
|
||||
|
||||
- drag & drop support for subtitles was added
|
||||
- libmpv was updated
|
||||
- command line support for stdin and URLs was added
|
||||
- there was a crash happening when the player is
|
||||
minimized in the taskbar
|
||||
|
||||
### 4.0
|
||||
|
||||
- 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)
|
||||
- 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
|
||||
- new color options with dedicated GUI support: sub-color, sub-border-color, sub-back-color
|
||||
- the config editor no longer shows the command line switches
|
||||
- the github start page was greatly improved
|
||||
- the setup.ps1 PowerShell script was greatly improved in regard of error handling and readability
|
||||
- a [manual to mpv.net](Manual.md) was created
|
||||
|
||||
### 3.7
|
||||
|
||||
- new icon design, probably better then before but still too simple
|
||||
- the radio buttons in the config editor have now a Windows 10 like design,
|
||||
they are larger and use the Windows theme color
|
||||
|
||||
### 3.6.1
|
||||
|
||||
- there was a bug causing an exception if both the input editor and config editor
|
||||
is opened, as soon as one is opened, the other can't be opened
|
||||
|
||||
### 3.6
|
||||
|
||||
- playing files from rar archives caused an exception
|
||||
- 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/inputConf.txt#L29)
|
||||
|
||||
### 3.5
|
||||
|
||||
- when the main windows gets activated and the clipboard content starts with http
|
||||
mpv.net will ask to play the URL, previously this was restricted to YouTube URLs
|
||||
- Python script errors show line and column whenever it is supported by IronPython
|
||||
- if conf files exist in the startup directory mpv.net will use the startup
|
||||
directory as config directory instead of creating default conf files in appdata
|
||||
- renamed commands are handled now by migration code instead of being broken
|
||||
|
||||
### 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/inputConf.txt#L149)
|
||||
- new zip download option added
|
||||
- new x86 download option added
|
||||
831
Manual.md
Normal file
@@ -0,0 +1,831 @@
|
||||
# mpv.net manual
|
||||
|
||||
## Table of contents
|
||||
|
||||
* [About mpv.net](#about-mpvnet)
|
||||
+ [Target Audience](#target-audience)
|
||||
* [Requirements](#requirements)
|
||||
* [Installation](#installation)
|
||||
+ [File Associations](#file-associations)
|
||||
* [Context Menu](#context-menu)
|
||||
+ [Open > Open Files](#open--open-files)
|
||||
+ [Open > Open URL](#open--open-url)
|
||||
+ [Open > Show media search](#open--show-media-search)
|
||||
+ [Open > Load external audio files](#open--load-external-audio-files)
|
||||
+ [Open > Load external subtitle files](#open--load-external-subtitle-files)
|
||||
+ [Play/Pause](#play-pause)
|
||||
+ [Stop](#stop)
|
||||
+ [Toggle Fullscreen](#toggle-fullscreen)
|
||||
+ [Navigate > Previous File](#navigate--previous-file)
|
||||
+ [Navigate > Next File](#navigate--next-file)
|
||||
+ [Navigate > Next Chapter](#navigate--next-chapter)
|
||||
+ [Navigate > Previous Chapter](#navigate--previous-chapter)
|
||||
+ [Navigate > Jump Next Frame](#navigate--jump-next-frame)
|
||||
+ [Navigate > Jump Previous Frame](#navigate--jump-previous-frame)
|
||||
+ [Navigate > Jump](#navigate--jump)
|
||||
+ [Pan & Scan > Increase Size](#pan--scan--increase-size)
|
||||
+ [Pan & Scan > Decrease Size](#pan--scan--decrease-size)
|
||||
+ [Pan & Scan > Move Left](#pan--scan--move-left)
|
||||
+ [Pan & Scan > Move Right](#pan--scan--move-right)
|
||||
+ [Pan & Scan > Move Up](#pan--scan--move-up)
|
||||
+ [Pan & Scan > Move Down](#pan--scan--move-down)
|
||||
+ [Pan & Scan > Decrease Height](#pan--scan--decrease-height)
|
||||
+ [Pan & Scan > Increase Height](#pan--scan--increase-height)
|
||||
+ [Pan & Scan > Reset](#pan--scan--reset)
|
||||
+ [Video > Decrease Contrast](#video--decrease-contrast)
|
||||
+ [Video > Increase Contrast](#video--increase-contrast)
|
||||
+ [Video > Decrease Brightness](#video--decrease-brightness)
|
||||
+ [Video > Increase Brightness](#video--increase-brightness)
|
||||
+ [Video > Decrease Gamma](#video--decrease-gamma)
|
||||
+ [Video > Increase Gamma](#video--increase-gamma)
|
||||
+ [Video > Decrease Saturation](#video--decrease-saturation)
|
||||
+ [Video > Increase Saturation](#video--increase-saturation)
|
||||
+ [Video > Take Screenshot](#video--take-screenshot)
|
||||
+ [Video > Toggle Deinterlace](#video--toggle-deinterlace)
|
||||
+ [Video > Cycle Aspect Ratio](#video--cycle-aspect-ratio)
|
||||
+ [Audio > Cycle/Next](#audio--cycle-next)
|
||||
+ [Audio > Delay +0.1](#audio--delay--01)
|
||||
+ [Audio > Delay -0.1](#audio--delay--01)
|
||||
+ [Subtitle > Cycle/Next](#subtitle--cycle-next)
|
||||
+ [Subtitle > Toggle Visibility](#subtitle--toggle-visibility)
|
||||
+ [Subtitle > Delay -0.1](#subtitle--delay--01)
|
||||
+ [Subtitle > Delay 0.1](#subtitle--delay-01)
|
||||
+ [Subtitle > Move Up](#subtitle--move-up)
|
||||
+ [Subtitle > Move Down](#subtitle--move-down)
|
||||
+ [Subtitle > Decrease Subtitle Font Size](#subtitle--decrease-subtitle-font-size)
|
||||
+ [Subtitle > Increase Subtitle Font Size](#subtitle--increase-subtitle-font-size)
|
||||
+ [Volume > Up](#volume--up)
|
||||
+ [Volume > Down](#volume--down)
|
||||
+ [Volume > Mute](#volume--mute)
|
||||
+ [Speed > -10%](#speed---10-)
|
||||
+ [Speed > 10%](#speed--10-)
|
||||
+ [Speed > Half](#speed--half)
|
||||
+ [Speed > Double](#speed--double)
|
||||
+ [Speed > Reset](#speed--reset)
|
||||
+ [Extensions > Rating > 0stars](#extensions--rating--0stars)
|
||||
+ [View > On Top > Enable](#view--on-top--enable)
|
||||
+ [View > On Top > Disable](#view--on-top--disable)
|
||||
+ [View > File Info](#view--file-info)
|
||||
+ [View > Show Statistics](#view--show-statistics)
|
||||
+ [View > Toggle Statistics](#view--toggle-statistics)
|
||||
+ [View > Toggle OSC Visibility](#view--toggle-osc-visibility)
|
||||
+ [View > Show Playlist](#view--show-playlist)
|
||||
+ [View > Show Audio/Video/Subtitle List](#view--show-audio-video-subtitle-list)
|
||||
+ [Settings > Show Config Editor](#settings--show-config-editor)
|
||||
+ [Settings > Show Input Editor](#settings--show-input-editor)
|
||||
+ [Settings > Open Config Folder](#settings--open-config-folder)
|
||||
+ [Tools > Command Palette](#tools--command-palette)
|
||||
+ [Tools > Show History](#tools--show-history)
|
||||
+ [Tools > Set/clear A-B loop points](#tools--set-clear-a-b-loop-points)
|
||||
+ [Tools > Toggle infinite file looping](#tools--toggle-infinite-file-looping)
|
||||
+ [Tools > Cycle Hardware Decoding](#tools--cycle-hardware-decoding)
|
||||
+ [Tools > Execute mpv command](#tools--execute-mpv-command)
|
||||
+ [Tools > Manage File Associations](#tools--manage-file-associations)
|
||||
+ [Help > Show mpv manual](#help--show-mpv-manual)
|
||||
+ [Help > Show mpv default keys](#help--show-mpv-default-keys)
|
||||
+ [Help > Show mpv.net default keys](#help--show-mpvnet-default-keys)
|
||||
+ [Help > Show mpv.net manual](#help--show-mpvnet-manual)
|
||||
+ [Help > About mpv.net](#help--about-mpvnet)
|
||||
+ [Exit](#exit)
|
||||
+ [Exit Watch Later](#exit-watch-later)
|
||||
* [Command Line Interface](#command-line-interface)
|
||||
* [Settings](#settings)
|
||||
|
||||
## About mpv.net
|
||||
|
||||
mpv.net is a media player for Windows. Similar like VLC mpv.net is not based on DirectShow like MPC, mpv.net is based on libmpv which in return is based on ffmpeg.
|
||||
|
||||
libmpv provides the majority of the features of the mpv media player, a fork of mplayer. mpv focuses on the usage of the command line interface, mpv.net retains the ability to be used from the command line and adds a simple and easy to use GUI on top of it.
|
||||
|
||||
mpv.net is meant to be a small single person project, it's designed to be mpv compatible, can use the same settings as mpv and offers almost all mpv features because they are all contained in libmpv, this means the official [mpv manual](https://mpv.io/manual/master/) fully applies to mpv.net.
|
||||
|
||||
### Target Audience
|
||||
|
||||
The target audience of mpv.net are Windows programmers and users that need something more advanced than common media players.
|
||||
|
||||
Furthermore mpv.net is well suited for Windows users who are interested to learn about the Linux operating system and portable apps, even though mpv.net self is not portable.
|
||||
|
||||
## Requirements
|
||||
|
||||
mpv.net is based on the .NET Framework and requires Windows 7 as minimum version of the Windows operating system. As of the writing of this manual the minimum required .NET Framework version is 4.7.2.
|
||||
|
||||
For optimal results a modern graphics card is recommended.
|
||||
|
||||
## Installation
|
||||
|
||||
mpv.net is available as setup and as portable download in the 7zip and zip archive format, to unpack the portable download 7zip can be used, it is available at www.7-zip.org.
|
||||
|
||||
If you are new to mpv.net the portable download is recommended, for regular mpv.net users the setup is typically more easy to use.
|
||||
|
||||
The x64 editions require more memory and have the advantage of decoders being typically first and better optimized for x64.
|
||||
|
||||
x86 should though still be well supported and work.
|
||||
|
||||
### File Associations
|
||||
|
||||
File Associations can be created using the setup or from within the apps context menu under 'Tools > Manage File Associations'.
|
||||
|
||||
Windows 10 prevents apps to register as the default app, to define the default video or audio player app in Windows 10 go to the Windows settings under 'Settings > Apps > Default apps' or shell execute 'ms-settings:defaultapps'.
|
||||
|
||||
It's also possible to change the default application using the Open With feature of the context menu in Windows File Explorer.
|
||||
|
||||
## Context Menu
|
||||
|
||||
The most important part of the user interface in mpv.net is the context menu, the menu can be customized as it is defined in the same file where the key bindings are defined.
|
||||
|
||||
### Open > Open Files
|
||||
|
||||
The Open Files menu entry is one way to open files in mpv.net, it supports multi selection.
|
||||
|
||||
Another way to open files is the command line, it is used by the Windows File Explorer if file associations exist.
|
||||
|
||||
A third way is to drag and drop files on the main window.
|
||||
|
||||
### Open > Open URL
|
||||
|
||||
The Open URL menu entry can be used to open URLs for example from YouTube.
|
||||
|
||||
mpv.net monitors the Windows clipboard and ask if URLs should be played in case it finds a URL in the clipboard.
|
||||
|
||||
### Open > Show media search
|
||||
|
||||
mpv.net supports system wide media searches using the Everything indexing service installed by the popular file search tool Everything (www.voidtools.com).
|
||||
|
||||
### Open > Load external audio files
|
||||
|
||||
Allows to load an external audio file. It's also possible to auto detect external audio files based on the file name, the option for this can be found in the settings under 'Settings > Show Config Editor > Audio > audio-file-auto'.
|
||||
|
||||
### Open > Load external subtitle files
|
||||
|
||||
Allows to load an external subtitle file. It's also possible to auto detect external subtitle files based on the file name, the option for this can be found in the settings under 'Settings > Show Config Editor > Subtitles > sub-auto'.
|
||||
|
||||
### Play/Pause
|
||||
|
||||
Play/Pause using the command:
|
||||
|
||||
`cycle pause`
|
||||
|
||||
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cproperty%3E-[up|down])
|
||||
|
||||
[pause property](https://mpv.io/manual/master/#options-pause)
|
||||
|
||||
### Stop
|
||||
|
||||
Stops the player and unloads the playlist using the command:
|
||||
|
||||
`stop`
|
||||
|
||||
[stop command](https://mpv.io/manual/master/#command-interface-stop)
|
||||
|
||||
### Toggle Fullscreen
|
||||
|
||||
Toggles fullscreen using the command:
|
||||
|
||||
`cycle fullscreen`
|
||||
|
||||
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cproperty%3E-[up|down])
|
||||
|
||||
[fullscreen property](https://mpv.io/manual/master/#options-fs)
|
||||
|
||||
### Navigate > Previous File
|
||||
|
||||
Navigates to the previous file in the playlist using the command:
|
||||
|
||||
`playlist-prev`
|
||||
|
||||
[playlist-prev command](https://mpv.io/manual/master/#command-interface-playlist-prev)
|
||||
|
||||
### Navigate > Next File
|
||||
|
||||
Navigates to the next file in the playlist using the command:
|
||||
|
||||
`playlist-next`
|
||||
|
||||
[playlist-next command](https://mpv.io/manual/master/#command-interface-playlist-next)
|
||||
|
||||
### Navigate > Next Chapter
|
||||
|
||||
Navigates to the next chapter using the command:
|
||||
|
||||
`add chapter 1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[chapter property](https://mpv.io/manual/master/#command-interface-chapter)
|
||||
|
||||
### Navigate > Previous Chapter
|
||||
|
||||
Navigates to the previous chapter using the command:
|
||||
|
||||
`add chapter -1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[chapter property](https://mpv.io/manual/master/#command-interface-chapter)
|
||||
|
||||
### Navigate > Jump Next Frame
|
||||
|
||||
Jumps to the next frame using the command:
|
||||
|
||||
`frame-step`
|
||||
|
||||
[frame-step command](https://mpv.io/manual/master/#command-interface-frame-step)
|
||||
|
||||
### Navigate > Jump Previous Frame
|
||||
|
||||
Jumps to the previous frame using the command:
|
||||
|
||||
`frame-back-step`
|
||||
|
||||
[frame-back-step command](https://mpv.io/manual/master/#command-interface-frame-back-step)
|
||||
|
||||
### Navigate > Jump
|
||||
|
||||
Seeking using the command:
|
||||
|
||||
`no-osd seek sec`
|
||||
|
||||
sec is the relative amount of seconds to jump, the no-osd prefix
|
||||
is used because mpv.net includes a script that shows the position
|
||||
when a seek operation is performed, the script uses a more simple
|
||||
time format.
|
||||
|
||||
[no-osd command prefix](https://mpv.io/manual/master/#command-interface-no-osd)
|
||||
|
||||
[seek command](https://mpv.io/manual/master/#command-interface-[relative|absolute|absolute-percent|relative-percent|exact|keyframes])
|
||||
|
||||
### Pan & Scan > Increase Size
|
||||
|
||||
Adds video zoom using the command:
|
||||
|
||||
`add video-zoom 0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[video-zoom property](https://mpv.io/manual/master/#options-video-zoom)
|
||||
|
||||
### Pan & Scan > Decrease Size
|
||||
|
||||
Adds negative video zoom using the command:
|
||||
|
||||
`add video-zoom -0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[video-zoom property](https://mpv.io/manual/master/#options-video-zoom)
|
||||
|
||||
### Pan & Scan > Move Left
|
||||
|
||||
`add video-pan-x -0.01`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[video-pan-x, video-pan-y property](https://mpv.io/manual/master/#options-video-pan-y)
|
||||
|
||||
### Pan & Scan > Move Right
|
||||
|
||||
`add video-pan-x 0.01`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[video-pan-x, video-pan-y property](https://mpv.io/manual/master/#options-video-pan-y)
|
||||
|
||||
### Pan & Scan > Move Up
|
||||
|
||||
`add video-pan-y -0.01`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[video-pan-x, video-pan-y property](https://mpv.io/manual/master/#options-video-pan-y)
|
||||
|
||||
### Pan & Scan > Move Down
|
||||
|
||||
`add video-pan-y 0.01`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[video-pan-x, video-pan-y property](https://mpv.io/manual/master/#options-video-pan-y)
|
||||
|
||||
### Pan & Scan > Decrease Height
|
||||
|
||||
`add panscan -0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[panscan property](https://mpv.io/manual/master/#options-panscan)
|
||||
|
||||
### Pan & Scan > Increase Height
|
||||
|
||||
`add panscan 0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[panscan property](https://mpv.io/manual/master/#options-panscan)
|
||||
|
||||
### Pan & Scan > Reset
|
||||
|
||||
Resets Pan & Scan, multiple commands in the same line are separated with semicolon.
|
||||
|
||||
`set video-zoom 0; set video-pan-x 0; set video-pan-y 0`
|
||||
|
||||
[video-zoom property](https://mpv.io/manual/master/#options-video-zoom)
|
||||
|
||||
[video-pan-x, video-pan-y property](https://mpv.io/manual/master/#options-video-pan-y)
|
||||
|
||||
### Video > Decrease Contrast
|
||||
|
||||
Decreases contrast with the following command:
|
||||
|
||||
`add contrast -1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[contrast property](https://mpv.io/manual/master/#options-contrast)
|
||||
|
||||
### Video > Increase Contrast
|
||||
|
||||
Increases contrast with the following command:
|
||||
|
||||
`add contrast 1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[contrast property](https://mpv.io/manual/master/#options-contrast)
|
||||
|
||||
### Video > Decrease Brightness
|
||||
|
||||
Decreases brightness using the following command:
|
||||
|
||||
`add brightness -1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[brightness property](https://mpv.io/manual/master/#options-brightness)
|
||||
|
||||
### Video > Increase Brightness
|
||||
|
||||
Increases brightness using the following command:
|
||||
|
||||
`add brightness 1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[brightness property](https://mpv.io/manual/master/#options-brightness)
|
||||
|
||||
### Video > Decrease Gamma
|
||||
|
||||
Decreases gamma using the following command:
|
||||
|
||||
`add gamma -1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[gamma property](https://mpv.io/manual/master/#options-gamma)
|
||||
|
||||
### Video > Increase Gamma
|
||||
|
||||
Increases gamma using the following command:
|
||||
|
||||
`add gamma 1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[gamma property](https://mpv.io/manual/master/#options-gamma)
|
||||
|
||||
### Video > Decrease Saturation
|
||||
|
||||
Decreases saturation using the following command:
|
||||
|
||||
`add saturation -1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[saturation property](https://mpv.io/manual/master/#options-saturation)
|
||||
|
||||
### Video > Increase Saturation
|
||||
|
||||
Increases saturation using the following command:
|
||||
|
||||
`add saturation 1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[saturation property](https://mpv.io/manual/master/#options-saturation)
|
||||
|
||||
### Video > Take Screenshot
|
||||
|
||||
`async screenshot`
|
||||
|
||||
[async command prefix](https://mpv.io/manual/master/#command-interface-async)
|
||||
|
||||
[screenshot command](https://mpv.io/manual/master/#command-interface-[subtitles|video|window|single|each-frame])
|
||||
|
||||
### Video > Toggle Deinterlace
|
||||
|
||||
Cycles the deinterlace property using the following command:
|
||||
|
||||
`cycle deinterlace`
|
||||
|
||||
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cproperty%3E-[up|down])
|
||||
|
||||
[deinterlace property](https://mpv.io/manual/master/#options-deinterlace)
|
||||
|
||||
### Video > Cycle Aspect Ratio
|
||||
|
||||
Cycles the aspect ratio using the following command:
|
||||
|
||||
`cycle-values video-aspect "16:9" "4:3" "2.35:1" "-1"`
|
||||
|
||||
[cycle-values command](https://mpv.io/manual/master/#command-interface-cycle-values)
|
||||
|
||||
[video-aspect property](https://mpv.io/manual/master/#options-video-aspect)
|
||||
|
||||
### Audio > Cycle/Next
|
||||
|
||||
This uses a mpv.net command that shows better info then the mpv preset
|
||||
and also has the advantage of not showing no audio.
|
||||
|
||||
### Audio > Delay +0.1
|
||||
|
||||
Adds a audio delay using the following command:
|
||||
|
||||
`add audio-delay 0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[audio-delay property](https://mpv.io/manual/master/#options-audio-delay)
|
||||
|
||||
### Audio > Delay -0.1
|
||||
|
||||
Adds a negative audio delay using the following command:
|
||||
|
||||
`add audio-delay -0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[audio-delay property](https://mpv.io/manual/master/#options-audio-delay)
|
||||
|
||||
### Subtitle > Cycle/Next
|
||||
|
||||
Shows the next subtitle track using the following command:
|
||||
|
||||
`cycle sub`
|
||||
|
||||
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cproperty%3E-[up|down])
|
||||
|
||||
[sub/sid property](https://mpv.io/manual/master/#options-sid)
|
||||
|
||||
### Subtitle > Toggle Visibility
|
||||
|
||||
Cycles the subtitle visibility using the following command:
|
||||
|
||||
`cycle sub-visibility`
|
||||
|
||||
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cproperty%3E-[up|down])
|
||||
|
||||
[sub-visibility property](https://mpv.io/manual/master/#options-no-sub-visibility)
|
||||
|
||||
### Subtitle > Delay -0.1
|
||||
|
||||
Adds a negative subtitle delay using the following command:
|
||||
|
||||
`add sub-delay -0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[sub-delay property](https://mpv.io/manual/master/#options-sub-delay)
|
||||
|
||||
### Subtitle > Delay 0.1
|
||||
|
||||
Adds a positive subtitle delay using the following command:
|
||||
|
||||
`add sub-delay 0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[sub-delay property](https://mpv.io/manual/master/#options-sub-delay)
|
||||
|
||||
### Subtitle > Move Up
|
||||
|
||||
Moves the subtitle up using the following command:
|
||||
|
||||
`add sub-pos -1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[sub-pos property](https://mpv.io/manual/master/#options-sub-pos)
|
||||
|
||||
### Subtitle > Move Down
|
||||
|
||||
Moves the subtitle down using the following command:
|
||||
|
||||
`add sub-pos 1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[sub-pos property](https://mpv.io/manual/master/#options-sub-pos)
|
||||
|
||||
### Subtitle > Decrease Subtitle Font Size
|
||||
|
||||
Decreases the subtitle font size using the following command:
|
||||
|
||||
`add sub-scale -0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[sub-scale property](https://mpv.io/manual/master/#options-sub-scale)
|
||||
|
||||
### Subtitle > Increase Subtitle Font Size
|
||||
|
||||
Increases the subtitle font size using the following command:
|
||||
|
||||
`add sub-scale 0.1`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[sub-scale property](https://mpv.io/manual/master/#options-sub-scale)
|
||||
|
||||
### Volume > Up
|
||||
|
||||
Increases the volume using the following command:
|
||||
|
||||
`add volume 10`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[volume property](https://mpv.io/manual/master/#options-volume)
|
||||
|
||||
### Volume > Down
|
||||
|
||||
Decreases the volume using the following command:
|
||||
|
||||
`add volume -10`
|
||||
|
||||
[add command](https://mpv.io/manual/master/#command-interface-add-%3Cproperty%3E-[%3Cvalue%3E])
|
||||
|
||||
[volume property](https://mpv.io/manual/master/#options-volume)
|
||||
|
||||
### Volume > Mute
|
||||
|
||||
Cycles the mute property using the following command:
|
||||
|
||||
`cycle mute`
|
||||
|
||||
[cycle command](https://mpv.io/manual/master/#command-interface-cycle-%3Cproperty%3E-[up|down])
|
||||
|
||||
[mute property](https://mpv.io/manual/master/#options-mute)
|
||||
|
||||
### Speed > -10%
|
||||
|
||||
Decreases the speed by 10% using the following command:
|
||||
|
||||
`multiply speed 1/1.1`
|
||||
|
||||
[multiply command](https://mpv.io/manual/master/#command-interface-multiply-%3Cproperty%3E-%3Cfactor%3E)
|
||||
|
||||
[speed property](https://mpv.io/manual/master/#options-speed)
|
||||
|
||||
### Speed > 10%
|
||||
|
||||
Increases the speed by 10% using the following command:
|
||||
|
||||
`multiply speed 1.1`
|
||||
|
||||
[multiply command](https://mpv.io/manual/master/#command-interface-multiply-%3Cproperty%3E-%3Cfactor%3E)
|
||||
|
||||
[speed property](https://mpv.io/manual/master/#options-speed)
|
||||
|
||||
### Speed > Half
|
||||
|
||||
Halfs the speed using the following command:
|
||||
|
||||
`multiply speed 0.5`
|
||||
|
||||
[multiply command](https://mpv.io/manual/master/#command-interface-multiply-%3Cproperty%3E-%3Cfactor%3E)
|
||||
|
||||
[speed property](https://mpv.io/manual/master/#options-speed)
|
||||
|
||||
### Speed > Double
|
||||
|
||||
Doubles the speed using the following command:
|
||||
|
||||
`multiply speed 2`
|
||||
|
||||
[multiply command](https://mpv.io/manual/master/#command-interface-multiply-%3Cproperty%3E-%3Cfactor%3E)
|
||||
|
||||
[speed property](https://mpv.io/manual/master/#options-speed)
|
||||
|
||||
### Speed > Reset
|
||||
|
||||
Resets the speed using the following command:
|
||||
|
||||
`set speed 1`
|
||||
|
||||
[set command](https://mpv.io/manual/master/#command-interface-set-%3Cproperty%3E-%22%3Cvalue%3E%22)
|
||||
|
||||
[speed property](https://mpv.io/manual/master/#options-speed)
|
||||
|
||||
### Extensions > Rating > 0stars
|
||||
|
||||
A plugin the writes the rating to the filename.
|
||||
|
||||
### View > On Top > Enable
|
||||
|
||||
Forces the player to stay on top of other windows using the following command:
|
||||
|
||||
`set ontop yes`
|
||||
|
||||
[set command](https://mpv.io/manual/master/#command-interface-set-%3Cproperty%3E-%22%3Cvalue%3E%22)
|
||||
|
||||
[ontop property](https://mpv.io/manual/master/#options-ontop)
|
||||
|
||||
### View > On Top > Disable
|
||||
|
||||
Disables the player to stay on top of other windows using the following command:
|
||||
|
||||
`set ontop no`
|
||||
|
||||
[set command](https://mpv.io/manual/master/#command-interface-set-%3Cproperty%3E-%22%3Cvalue%3E%22)
|
||||
|
||||
[ontop property](https://mpv.io/manual/master/#options-ontop)
|
||||
|
||||
### View > File Info
|
||||
|
||||
Shows info using a mpv.net command about the current file, shows length, position, formats, size and filename.
|
||||
|
||||
### View > Show Statistics
|
||||
|
||||
Show statistics using the following command:
|
||||
|
||||
`script-binding stats/display-stats`
|
||||
|
||||
[script-binding command](https://mpv.io/manual/master/#command-interface-script-binding)
|
||||
|
||||
### View > Toggle Statistics
|
||||
|
||||
Toggles statistics using the following command:
|
||||
|
||||
`script-binding stats/display-stats-toggle`
|
||||
|
||||
[script-binding command](https://mpv.io/manual/master/#command-interface-script-binding)
|
||||
|
||||
### View > Toggle OSC Visibility
|
||||
|
||||
Toggles OSC Visibility using the following command:
|
||||
|
||||
`script-binding osc/visibility`
|
||||
|
||||
[script-binding command](https://mpv.io/manual/master/#command-interface-script-binding)
|
||||
|
||||
### View > Show Playlist
|
||||
|
||||
Shows the playlist for 5 seconds using the following command:
|
||||
|
||||
`show-text ${playlist} 5000`
|
||||
|
||||
[show-text command](https://mpv.io/manual/master/#command-interface-show-text)
|
||||
|
||||
### View > Show Audio/Video/Subtitle List
|
||||
|
||||
Shows the Audio/Video/Subtitle list for 5 seconds using the following command:
|
||||
|
||||
`show-text ${track-list} 5000`
|
||||
|
||||
[show-text command](https://mpv.io/manual/master/#command-interface-show-text)
|
||||
|
||||
### Settings > Show Config Editor
|
||||
|
||||
Shows mpv.net's config editor.
|
||||
|
||||
### Settings > Show Input Editor
|
||||
|
||||
Shows mpv.net's key binding editor.
|
||||
|
||||
### Settings > Open Config Folder
|
||||
|
||||
Opens the config folder which contains:
|
||||
|
||||
mpv.conf file containing mpv settings
|
||||
|
||||
mpvnet.conf file containing mpv.net settings
|
||||
|
||||
input.conf containing mpv key bindings
|
||||
|
||||
User scripts and user extensions
|
||||
|
||||
### Tools > Command Palette
|
||||
|
||||
Shows the command palette window which allows to find mpv.net commands, it shows the command's location in the context menu and the key shortcut.
|
||||
|
||||
### Tools > Show History
|
||||
|
||||
When enabled shows a file that contains the playback history containing the time and filename.
|
||||
|
||||
### Tools > Set/clear A-B loop points
|
||||
|
||||
Enables to set loop start and end points using the following command:
|
||||
|
||||
`ab-loop`
|
||||
|
||||
[ab-loop command](https://mpv.io/manual/master/#command-interface-ab-loop)
|
||||
|
||||
### Tools > Toggle infinite file looping
|
||||
|
||||
Loops the current file infinitely using the following command:
|
||||
|
||||
cycle-values loop-file "inf" "no"
|
||||
|
||||
[cycle-values command](https://mpv.io/manual/master/#command-interface-cycle-values)
|
||||
|
||||
[loop-file command](https://mpv.io/manual/master/#options-loop)
|
||||
|
||||
### Tools > Cycle Hardware Decoding
|
||||
|
||||
Cycles the hwdec property to enable/disable hardware decoding using the following command:
|
||||
|
||||
`cycle-values hwdec "auto" "no"`
|
||||
|
||||
[cycle-values command](https://mpv.io/manual/master/#command-interface-cycle-values)
|
||||
|
||||
[hwdec property](https://mpv.io/manual/master/#options-hwdec)
|
||||
|
||||
### Tools > Execute mpv command
|
||||
|
||||
Allows to execute mpv commands.
|
||||
|
||||
### Tools > Manage File Associations
|
||||
|
||||
Allows to manage file associations.
|
||||
|
||||
### Help > Show mpv manual
|
||||
|
||||
Shows the [mpv manual](https://mpv.io/manual/stable/).
|
||||
|
||||
### Help > Show mpv default keys
|
||||
|
||||
Shows the [mpv default keys](https://github.com/mpv-player/mpv/blob/master/etc/input.conf)
|
||||
|
||||
### Help > Show mpv.net default keys
|
||||
|
||||
Shows the [mpv.net default keys](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt)
|
||||
|
||||
Help > Show mpv.net web site
|
||||
|
||||
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)
|
||||
|
||||
### Help > About mpv.net
|
||||
|
||||
Shows the mpv.net about dialog.
|
||||
|
||||
### Exit
|
||||
|
||||
Exits mpv.net using the following command:
|
||||
|
||||
`quit`
|
||||
|
||||
[quit command](https://mpv.io/manual/master/#command-interface-quit-[%3Ccode%3E])
|
||||
|
||||
### Exit Watch Later
|
||||
|
||||
Exits mpv.net and remembers the position in the file using the following command:
|
||||
|
||||
`quit-watch-later`
|
||||
|
||||
[quit-watch-later command](https://mpv.io/manual/master/#command-interface-quit-watch-later)
|
||||
|
||||
## Command Line Interface
|
||||
|
||||
mpvnet implements a basic CLI to set mpv commands.
|
||||
|
||||
Example:
|
||||
|
||||
mpvnet --mute=yes <file|URL>
|
||||
|
||||
## Settings
|
||||
|
||||
mpv.net is able to share the settings with mpv and mpv.net uses the same logic to decide from where the settings are loaded. The default location is:
|
||||
|
||||
```Text
|
||||
C:\Users\%username%\AppData\Roaming\mpv\mpv.conf
|
||||
```
|
||||
|
||||
If a directory named portable_config next to the mpvnet.exe exists, all config will be loaded from this directory only.
|
||||
|
||||
```Text
|
||||
<startup>\portable_config\mpv.conf
|
||||
```
|
||||
|
||||
In case there isn't any config folder mpv.net asks where to create it. If no mpv.conf file exists mpv.net generates it with the following defaults:
|
||||
|
||||
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt>
|
||||
|
||||
Config files located in the same directory as mpvnet.exe are loaded with lower priority. Some config files are loaded only once, which means that e.g. of 2 input.conf files located in two config directories, only the one from the directory with higher priority will be loaded.
|
||||
|
||||
The key bindings and the context menu definitions are stored in the input.conf file,
|
||||
if it's missing mpv.net generates it with the following defaults:
|
||||
|
||||
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt>
|
||||
110
README.md
@@ -1,26 +1,28 @@
|
||||
# mpv.net
|
||||

|
||||
|
||||
mpv.net is a modern media player for Windows that looks and works just like [mpv](https://mpv.io).
|
||||
# 🎞 mpv.net
|
||||
|
||||
mpv.net is a modern media player for Windows that works just like [mpv](https://mpv.io).
|
||||
|
||||
#### Based on libmpv
|
||||
|
||||
mpv.net is based on libmpv which offers a straightforward C API that was designed from the ground up to make mpv usable as a library and facilitate easy integration into other applications.
|
||||
mpv.net is based on libmpv which offers a straightforward C API that was designed from the ground up to make mpv usable as a library and facilitate easy integration into other applications. mpv is like vlc not based on DirectShow or Media Foundation.
|
||||
|
||||
#### CLI options
|
||||
#### Command Line Interface
|
||||
|
||||
mpv.net has the same [CLI options](https://mpv.io/manual/master/#options) as mpv.
|
||||
mpv.net has the [CLI of mpv](https://mpv.io/manual/master/#options).
|
||||
|
||||
#### High quality video output
|
||||
|
||||
mpv/libmpv has an OpenGL based video output that is capable of many features loved by videophiles, such as video scaling with popular high quality algorithms, color management, frame timing, interpolation, HDR, and more.
|
||||
libmpv has an OpenGL based video output that is capable of many features loved by videophiles, such as video scaling with popular high quality algorithms, color management, frame timing, interpolation, HDR, and more.
|
||||
|
||||
#### On Screen Controller
|
||||
|
||||
mpv.net uses the OSC of mpv/libmpv offering play controls with a modern flat design.
|
||||
The OSC of libmpv offers play controls with a modern flat design. ([Screenshot](#main-window-screenshot))
|
||||
|
||||
#### GPU video decoding
|
||||
|
||||
mpv/libmpv leverages the FFmpeg hwaccel APIs to support DXVA2 video decoding acceleration.
|
||||
libmpv leverages the FFmpeg hwaccel APIs to support DXVA2 video decoding acceleration.
|
||||
|
||||
#### Active development
|
||||
|
||||
@@ -31,6 +33,7 @@ Table of contents
|
||||
|
||||
- [Features](#features)
|
||||
- [Screenshots](#screenshots)
|
||||
- [Manual](#manual)
|
||||
- [Context Menu](#context-menu)
|
||||
- [Settings](#settings)
|
||||
- [Scripting](#scripting)
|
||||
@@ -38,20 +41,20 @@ Table of contents
|
||||
- [Architecture](#architecture)
|
||||
- [Support](#support)
|
||||
- [Links](#links)
|
||||
- [Download](#download)
|
||||
- [Changelog](#changelog)
|
||||
- [Download](#download)
|
||||
|
||||
### Features
|
||||
|
||||
- Customizable context menu defined in the same file as the key bindings ([Screenshot](#context-menu-screenshot))
|
||||
- Searchable config dialog ([Screenshot](#config-editor-screenshot))
|
||||
- Searchable input (key/mouse) binding editor ([Screenshot](#input-editor-screenshot))
|
||||
- Customizable context menu defined in the same file as the key bindings ([Screenshot](#context-menu-screenshot), [Defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt))
|
||||
- Searchable config dialog ([Screenshot](#config-editor-screenshot), [Defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt))
|
||||
- Searchable input (key/mouse) binding editor ([Screenshot](#input-editor-screenshot), [Defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt))
|
||||
- Searchable command palette to quickly launch commands and look for keys ([Screenshot](#command-palette-screenshot))
|
||||
- Modern UI with dark mode ([Screenshot](#config-editor-screenshot))
|
||||
- Addon/extension API for .NET languages
|
||||
- Scripting API for Python, C#, Lua, JavaScript and PowerShell ([wiki](https://github.com/stax76/mpv.net/wiki/Scripting))
|
||||
- mpv's OSC, IPC and conf files
|
||||
- Support of the same [CLI options](https://mpv.io/manual/master/#options) as mpv
|
||||
- [Command Line Interface](https://mpv.io/manual/master/#options)
|
||||
- DXVA2 video decoding acceleration
|
||||
- OpenGL based video output capable of features loved by videophiles, such as video scaling with popular high quality algorithms, color management, frame timing, interpolation, HDR, and more
|
||||
- Search feature powered by [Everything](https://www.voidtools.com) to find and play media ([Screenshot](#media-search-screenshot))
|
||||
@@ -93,6 +96,10 @@ Media search feature powered by [Everything](https://www.voidtools.com) to find
|
||||
|
||||

|
||||
|
||||
### Manual
|
||||
|
||||
[Manual](Manual.md)
|
||||
|
||||
### Context Menu
|
||||
|
||||
The context menu can be customized via input.conf file located in the config directory:
|
||||
@@ -127,6 +134,13 @@ In case there isn't any config folder mpv.net asks where to create it. If no mpv
|
||||
|
||||
Config files located in the same directory as mpvnet.exe are loaded with lower priority. Some config files are loaded only once, which means that e.g. of 2 input.conf files located in two config directories, only the one from the directory with higher priority will be loaded.
|
||||
|
||||
The key bindings and the context menu definitions are stored in the input.conf file,
|
||||
if it's missing mpv.net generates it with the following defaults:
|
||||
|
||||
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt>
|
||||
|
||||
mpv.net supports almost all mpv settings and features, [limitations are listed in the wiki](https://github.com/stax76/mpv.net/wiki/Limitations).
|
||||
|
||||
### Scripting
|
||||
|
||||
[Scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting)
|
||||
@@ -139,26 +153,34 @@ Config files located in the same directory as mpvnet.exe are loaded with lower p
|
||||
|
||||
mpv.net is written in C# 7.0 and runs on the .NET framework 4.7 or higher.
|
||||
|
||||
The Add-on implementation is based on the Managed Extensibility Framework,
|
||||
the entire application code is accessible for add-ons and Python scripts.
|
||||
The Add-on implementation is based on the [Managed Extensibility Framework](https://docs.microsoft.com/en-us/dotnet/framework/mef/).
|
||||
|
||||
There are no specific extension or scripting interfaces but instead everyting
|
||||
is accessible for .NET compatible languages (C#, VB.NET, F#, Python, PowerShell),
|
||||
this decision was made to keep the code simple and lightweight.
|
||||
|
||||
Python scripting is implemented with IronPython which uses Python 2.7.
|
||||
|
||||
The main/video window is WinForms based, other windows are WPF based.
|
||||
The main/video window is WinForms based, all other windows are WPF based.
|
||||
|
||||
The config editor adds it's controls dynamically and uses TOML to define it's
|
||||
content, there are only two simple types, StringSetting and OptionSetting.
|
||||
|
||||
mpv.net was started 2017 and consists of about 9000 lines of code.
|
||||
mpv.net was started 2017 and consists of about 6000 lines of code and markup.
|
||||
|
||||
Third party components are:
|
||||
IDE, Editor: Visual Studio, Visual Studio Code.
|
||||
|
||||
- [libmpv](https://mpv.io/)
|
||||
- [MediaInfo](https://mediaarea.net/en/MediaInfo)
|
||||
- [Tommy (TOML parser)](https://github.com/dezhidki/Tommy)
|
||||
- [IronPython](https://ironpython.net/)
|
||||
- [CS-Script](http://www.csscript.net/)
|
||||
- [Everything](https://www.voidtools.com)
|
||||
Due to mpv.net being my first WPF app and mpv.net never meant to be a large
|
||||
application best practices and design pattern are not always applied.
|
||||
|
||||
Third party components:
|
||||
|
||||
- [libmpv, the heard and soul of mpv.net](https://mpv.io/)
|
||||
- [MediaInfo, no media related project could do without](https://mediaarea.net/en/MediaInfo)
|
||||
- [Tommy, a single file TOML parser](https://github.com/dezhidki/Tommy)
|
||||
- [IronPython, bringing Python to dotnet](https://ironpython.net/)
|
||||
- [CS-Script, scripting with C#](http://www.csscript.net/)
|
||||
- [Everything, a blazing fast file search service](https://www.voidtools.com)
|
||||
|
||||
### Support
|
||||
|
||||
@@ -168,6 +190,8 @@ Third party components are:
|
||||
|
||||
[Issue tracker to report bugs and request features](https://github.com/stax76/mpv.net/issues)
|
||||
|
||||
[frank.skare.de@gmail.com](mailto:frank.skare.de@gmail.com?Subject=mpv.net%20support)
|
||||
|
||||
### Links
|
||||
|
||||
mpv manual: <https://mpv.io/manual/master/>
|
||||
@@ -192,42 +216,10 @@ mpv bugs and requests: <https://mpv.io/bug-reports/>
|
||||
|
||||
mpv.net bugs and requests: <https://github.com/stax76/mpv.net/issues>
|
||||
|
||||
### Download
|
||||
|
||||
<https://github.com/stax76/mpv.net/releases>
|
||||
|
||||
### Changelog
|
||||
|
||||
### 3.7
|
||||
[Changelog](Changelog.md)
|
||||
|
||||
- new icon design
|
||||
- the radio buttons in the config editor have now a Windows 10 like design,
|
||||
they are larger and use the Windows theme color
|
||||
### Download
|
||||
|
||||
### 3.6.1
|
||||
|
||||
- there was a bug causing an exception if both the input editor and config editor
|
||||
is opened, as soon as one is opened, the other can't be opened
|
||||
|
||||
### 3.6
|
||||
|
||||
- playing files from rar archives caused an exception
|
||||
- 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/inputConf.txt#L29)
|
||||
|
||||
### 3.5
|
||||
|
||||
- when the main windows gets activated and the clipboard content starts with http
|
||||
mpv.net will ask to play the URL, previously this was restricted to YouTube URLs
|
||||
- Python script errors show line and column whenever it is supported by IronPython
|
||||
- if conf files exist in the startup directory mpv.net will use the startup
|
||||
directory as config directory instead of creating default conf files in appdata
|
||||
- renamed commands are handled now by migration code instead of being broken
|
||||
|
||||
### 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/inputConf.txt#L149)
|
||||
- new zip download option added
|
||||
- new x86 download option added
|
||||
<https://github.com/stax76/mpv.net/releases>
|
||||
@@ -13,8 +13,8 @@ Public Class CSScriptAddon
|
||||
Sub New()
|
||||
Dim scriptFiles As New List(Of String)
|
||||
|
||||
If Directory.Exists(mp.MpvConfFolder + "scripts") Then
|
||||
scriptFiles.AddRange(Directory.GetFiles(mp.MpvConfFolder + "scripts", "*.cs"))
|
||||
If Directory.Exists(mp.ConfFolder + "scripts") Then
|
||||
scriptFiles.AddRange(Directory.GetFiles(mp.ConfFolder + "scripts", "*.cs"))
|
||||
End If
|
||||
|
||||
If Directory.Exists(Application.StartupPath + "\scripts") Then
|
||||
|
||||
@@ -30,6 +30,42 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
|
||||
|
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 277 KiB After Width: | Height: | Size: 214 KiB |
BIN
img/Main.png
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 5.8 MiB |
@@ -59,10 +59,10 @@ Global
|
||||
{55C88710-539D-4402-84C8-31694841C731}.Release|x86.Build.0 = Release|x86
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x64.Build.0 = Debug|x64
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Debug|x86.Build.0 = Debug|x86
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{06F854B0-00F9-4B53-94D9-0BE65A7C55D8}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
@@ -49,14 +50,16 @@ namespace DynamicGUI
|
||||
StringSetting stringSetting = new StringSetting();
|
||||
baseSetting = stringSetting;
|
||||
stringSetting.Default = setting["default"];
|
||||
if (setting.HasKey("folder")) stringSetting.IsFolder = true;
|
||||
}
|
||||
|
||||
baseSetting.Name = setting["name"];
|
||||
baseSetting.Filter = setting["filter"];
|
||||
|
||||
if (setting.HasKey("help")) baseSetting.Help = setting["help"];
|
||||
if (setting.HasKey("helpurl")) baseSetting.HelpURL = setting["helpurl"];
|
||||
if (setting.HasKey("width")) baseSetting.Width = setting["width"];
|
||||
if (setting.HasKey("type")) baseSetting.Type = setting["type"];
|
||||
|
||||
settingsList.Add(baseSetting);
|
||||
}
|
||||
return settingsList;
|
||||
@@ -72,12 +75,12 @@ namespace DynamicGUI
|
||||
public string Default { get; set; }
|
||||
public string HelpURL { get; set; }
|
||||
public string Filter { get; set; }
|
||||
public string Type { get; set; }
|
||||
public int Width { get; set; }
|
||||
}
|
||||
|
||||
public class StringSetting : SettingBase
|
||||
{
|
||||
public bool IsFolder { get; set; }
|
||||
}
|
||||
|
||||
public class OptionSetting : SettingBase
|
||||
@@ -100,13 +103,15 @@ namespace DynamicGUI
|
||||
set => _Text = value;
|
||||
}
|
||||
|
||||
public bool IsChecked
|
||||
public bool Checked
|
||||
{
|
||||
get => OptionSetting.Value == Name ;
|
||||
set {
|
||||
if (value)
|
||||
OptionSetting.Value = Name;
|
||||
}
|
||||
set { if (value) OptionSetting.Value = Name; }
|
||||
}
|
||||
|
||||
public Visibility Visibility
|
||||
{
|
||||
get => string.IsNullOrEmpty(Help) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<RadioButton x:Name="RadioButton" VerticalContentAlignment="Center" IsChecked="{Binding IsChecked}" GroupName="{Binding OptionSetting.Name}" Content="{Binding Text}" FontSize="16" FontWeight="Normal" VerticalAlignment="Top" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"></RadioButton>
|
||||
<TextBox x:Name="ItemHelpTextBox" TextWrapping="WrapWithOverflow" Text="{Binding Help}" Margin="10,0,0,0" BorderThickness="0" IsReadOnly="True" Padding="7,0,0,0" MinHeight="0" Foreground="{Binding Path=Foreground2, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" Background="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"></TextBox>
|
||||
<RadioButton x:Name="RadioButton" VerticalContentAlignment="Center" IsChecked="{Binding Checked}" GroupName="{Binding OptionSetting.Name}" Content="{Binding Text}" FontSize="16" FontWeight="Normal" VerticalAlignment="Top" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"></RadioButton>
|
||||
<TextBox x:Name="ItemHelpTextBox" TextWrapping="WrapWithOverflow" Text="{Binding Help}" Visibility="{Binding Visibility}" Margin="10,0,0,0" BorderThickness="0" IsReadOnly="True" Padding="7,0,0,0" MinHeight="0" Foreground="{Binding Path=Foreground2, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" Background="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"></TextBox>
|
||||
</WrapPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
|
||||
@@ -12,11 +12,13 @@ namespace DynamicGUI
|
||||
OptionSetting = optionSetting;
|
||||
InitializeComponent();
|
||||
TitleTextBox.Text = optionSetting.Name;
|
||||
if (string.IsNullOrEmpty(optionSetting.Help))
|
||||
HelpTextBox.Visibility = Visibility.Collapsed;
|
||||
HelpTextBox.Text = optionSetting.Help;
|
||||
ItemsControl.ItemsSource = optionSetting.Options;
|
||||
Link.SetURL(optionSetting.HelpURL);
|
||||
if (string.IsNullOrEmpty(optionSetting.HelpURL))
|
||||
LinkTextBlock.Visibility = Visibility.Collapsed;
|
||||
Link.SetURL(optionSetting.HelpURL);
|
||||
}
|
||||
|
||||
private string _SearchableText;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:DynamicGUI"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800" >
|
||||
d:DesignWidth="800">
|
||||
<Grid Margin="20,0">
|
||||
<StackPanel>
|
||||
<TextBox x:Name="TitleTextBox" FontSize="24" Margin="0,10" BorderThickness="0" IsReadOnly="True" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" Background="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"></TextBox>
|
||||
@@ -15,10 +15,10 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="ValueTextBox" Text="{Binding Path=Text, ElementName=StringSettingControl1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="150" HorizontalAlignment="Left" Height="20" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" Background="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
|
||||
<TextBox x:Name="ValueTextBox" Text="{Binding Path=Text, ElementName=StringSettingControl1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="150" HorizontalAlignment="Left" Height="20" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" Background="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" TextChanged="ValueTextBox_TextChanged"/>
|
||||
<Button x:Name="Button" Height="20" Grid.Column="1" Visibility="{Binding Path=Text, ElementName=StringSettingControl1}" Margin="5,0,0,0" Width="20" Click="Button_Click">...</Button>
|
||||
</Grid>
|
||||
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" Margin="0,0,0,10" BorderThickness="0" IsReadOnly="True" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" Background="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"></TextBox>
|
||||
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" BorderThickness="0" IsReadOnly="True" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" Background="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"></TextBox>
|
||||
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
||||
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||
</TextBlock>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using System.Windows;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using WinForms = System.Windows.Forms;
|
||||
|
||||
namespace DynamicGUI
|
||||
{
|
||||
@@ -13,10 +17,10 @@ namespace DynamicGUI
|
||||
InitializeComponent();
|
||||
TitleTextBox.Text = stringSetting.Name;
|
||||
HelpTextBox.Text = stringSetting.Help;
|
||||
ValueTextBox.Text = stringSetting.Value;
|
||||
if (stringSetting.Width > 0)
|
||||
ValueTextBox.Width = stringSetting.Width;
|
||||
if (!StringSetting.IsFolder)
|
||||
ValueTextBox.Text = StringSetting.Value;
|
||||
if (StringSetting.Width > 0)
|
||||
ValueTextBox.Width = StringSetting.Width;
|
||||
if (StringSetting.Type != "folder" && StringSetting.Type != "color")
|
||||
Button.Visibility = Visibility.Hidden;
|
||||
Link.SetURL(StringSetting.HelpURL);
|
||||
if (string.IsNullOrEmpty(stringSetting.HelpURL))
|
||||
@@ -29,7 +33,6 @@ namespace DynamicGUI
|
||||
get {
|
||||
if (_SearchableText is null)
|
||||
_SearchableText = (TitleTextBox.Text + HelpTextBox.Text +ValueTextBox.Text).ToLower();
|
||||
|
||||
return _SearchableText;
|
||||
}
|
||||
}
|
||||
@@ -45,13 +48,56 @@ namespace DynamicGUI
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
using (var d = new System.Windows.Forms.FolderBrowserDialog())
|
||||
switch (StringSetting.Type)
|
||||
{
|
||||
d.Description = "Choose a folder.";
|
||||
d.SelectedPath = ValueTextBox.Text;
|
||||
if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
ValueTextBox.Text = d.SelectedPath;
|
||||
case "folder":
|
||||
using (var d = new WinForms.FolderBrowserDialog())
|
||||
{
|
||||
d.Description = "Choose a folder.";
|
||||
d.SelectedPath = ValueTextBox.Text;
|
||||
if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
ValueTextBox.Text = d.SelectedPath;
|
||||
}
|
||||
break;
|
||||
case "color":
|
||||
using (var d = new WinForms.ColorDialog())
|
||||
{
|
||||
d.FullOpen = true;
|
||||
try {
|
||||
d.Color = System.Drawing.ColorTranslator.FromHtml(ValueTextBox.Text);
|
||||
} catch { }
|
||||
if (d.ShowDialog() == WinForms.DialogResult.OK)
|
||||
ValueTextBox.Text = System.Drawing.ColorTranslator.ToHtml(d.Color);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ValueTextBox_TextChanged(object sender, TextChangedEventArgs e) => Update();
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (StringSetting.Type == "color")
|
||||
{
|
||||
Color c = Colors.Transparent;
|
||||
if (ValueTextBox.Text != "")
|
||||
{
|
||||
try {
|
||||
if (ValueTextBox.Text.Contains("/"))
|
||||
{
|
||||
string[] a = ValueTextBox.Text.Split('/');
|
||||
if (a.Length == 3)
|
||||
c = Color.FromRgb(ToByte(a[0]), ToByte(a[1]), ToByte(a[2]));
|
||||
else if (a.Length == 4)
|
||||
c = Color.FromArgb(ToByte(a[3]), ToByte(a[0]), ToByte(a[1]), ToByte(a[2]));
|
||||
}
|
||||
else
|
||||
c = (Color)ColorConverter.ConvertFromString(ValueTextBox.Text);
|
||||
} catch {}
|
||||
}
|
||||
ValueTextBox.Background = new SolidColorBrush(c);
|
||||
}
|
||||
Byte ToByte(string val) => Convert.ToByte(Convert.ToSingle(val, CultureInfo.InvariantCulture) * 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace mpvnet
|
||||
foreach (string i in Directory.GetDirectories(dir))
|
||||
catalog.Catalogs.Add(new DirectoryCatalog(i, "*Addon.dll"));
|
||||
|
||||
dir = mp.MpvConfFolder + "\\Addons";
|
||||
dir = mp.ConfFolder + "\\Addons";
|
||||
|
||||
if (Directory.Exists(dir))
|
||||
foreach (string i in Directory.GetDirectories(dir))
|
||||
@@ -7,6 +7,8 @@ using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Interop;
|
||||
|
||||
using VB = Microsoft.VisualBasic;
|
||||
|
||||
namespace mpvnet
|
||||
{
|
||||
public class Command
|
||||
@@ -46,13 +48,13 @@ namespace mpvnet
|
||||
MainForm.Instance.Invoke(new Action(() => {
|
||||
using (var d = new OpenFileDialog() { Multiselect = true })
|
||||
if (d.ShowDialog() == DialogResult.OK)
|
||||
mp.LoadFiles(d.FileNames);
|
||||
mp.Load(d.FileNames);
|
||||
}));
|
||||
}
|
||||
|
||||
public static void open_conf_folder(string[] args)
|
||||
{
|
||||
Process.Start(mp.MpvConfFolder);
|
||||
Process.Start(mp.ConfFolder);
|
||||
}
|
||||
|
||||
public static void show_input_editor(string[] args)
|
||||
@@ -102,7 +104,7 @@ namespace mpvnet
|
||||
|
||||
public static void show_history(string[] args)
|
||||
{
|
||||
var fp = mp.MpvConfFolder + "history.txt";
|
||||
var fp = mp.ConfFolder + "history.txt";
|
||||
|
||||
if (File.Exists(fp))
|
||||
Process.Start(fp);
|
||||
@@ -154,7 +156,8 @@ namespace mpvnet
|
||||
|
||||
TimeSpan position = TimeSpan.FromSeconds(mp.get_property_number("time-pos"));
|
||||
TimeSpan duration2 = TimeSpan.FromSeconds(mp.get_property_number("duration"));
|
||||
string videoCodec = mp.get_property_string("video-format").ToUpper();
|
||||
string videoFormat = mp.get_property_string("video-format").ToUpper();
|
||||
string audioCodec = mp.get_property_string("audio-codec-name").ToUpper();
|
||||
|
||||
text = Path.GetFileName(path) + "\n" +
|
||||
FormatTime(position.TotalMinutes) + ":" +
|
||||
@@ -166,22 +169,23 @@ namespace mpvnet
|
||||
if (fileSize > 0)
|
||||
text += Convert.ToInt32(fileSize / 1024.0 / 1024.0).ToString() + " MB\n";
|
||||
|
||||
text += $"{videoCodec}\n";
|
||||
text += $"{videoFormat}\n{audioCodec}";
|
||||
|
||||
mp.commandv("show-text", text, "5000");
|
||||
string FormatTime(double value) => ((int)value).ToString("00");
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Msg.ShowException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void execute_mpv_command(string[] args)
|
||||
{
|
||||
MainForm.Instance.Invoke(new Action(() => {
|
||||
string command = Microsoft.VisualBasic.Interaction.InputBox("Enter a mpv command to be executed.", "Execute Command", RegistryHelp.GetString("HKCU\\Software\\" + Application.ProductName, "RecentExecutedCommand"));
|
||||
string command = VB.Interaction.InputBox("Enter a mpv command to be executed.", "Execute Command", RegistryHelp.GetString(App.RegPath, "RecentExecutedCommand"));
|
||||
if (string.IsNullOrEmpty(command)) return;
|
||||
RegistryHelp.SetObject("HKCU\\Software\\" + Application.ProductName, "RecentExecutedCommand", command);
|
||||
RegistryHelp.SetObject(App.RegPath, "RecentExecutedCommand", command);
|
||||
mp.command_string(command, false);
|
||||
}));
|
||||
}
|
||||
@@ -189,9 +193,9 @@ namespace mpvnet
|
||||
public static void open_url(string[] args)
|
||||
{
|
||||
MainForm.Instance.Invoke(new Action(() => {
|
||||
string command = Microsoft.VisualBasic.Interaction.InputBox("Enter URL to be opened.");
|
||||
string command = VB.Interaction.InputBox("Enter URL to be opened.");
|
||||
if (string.IsNullOrEmpty(command)) return;
|
||||
mp.LoadFiles(command);
|
||||
mp.Load(command);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -202,7 +206,6 @@ namespace mpvnet
|
||||
{
|
||||
d.InitialDirectory = Path.GetDirectoryName(mp.get_property_string("path", false));
|
||||
d.Multiselect = true;
|
||||
|
||||
if (d.ShowDialog() == DialogResult.OK)
|
||||
foreach (string i in d.FileNames)
|
||||
mp.commandv("sub-add", i);
|
||||
@@ -225,6 +228,16 @@ namespace mpvnet
|
||||
}));
|
||||
}
|
||||
|
||||
public static void add_files_to_playlist(string[] args)
|
||||
{
|
||||
MainForm.Instance.Invoke(new Action(() => {
|
||||
using (var d = new OpenFileDialog() { Multiselect = true })
|
||||
if (d.ShowDialog() == DialogResult.OK)
|
||||
foreach(string file in d.FileNames)
|
||||
mp.commandv("loadfile", file, "append");
|
||||
}));
|
||||
}
|
||||
|
||||
public static void cycle_audio(string[] args)
|
||||
{
|
||||
string filePath = mp.get_property_string("path", false);
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -12,18 +13,113 @@ using System.Runtime.Serialization;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using Microsoft.Win32;
|
||||
using VB = Microsoft.VisualBasic;
|
||||
|
||||
namespace mpvnet
|
||||
{
|
||||
public class App
|
||||
{
|
||||
public static string[] VideoTypes { get; } = "mkv mp4 mpg avi mov webm vob wmv flv avs 264 h264 asf webm mpeg mpv y4m avc hevc 265 h265 m2v m2ts vpy mts m4v".Split(" ".ToCharArray());
|
||||
public static string[] AudioTypes { get; } = "mp3 mp2 ac3 ogg opus flac wav w64 m4a dts dtsma dtshr dtshd eac3 thd thd+ac3 mka aac mpa".Split(" ".ToCharArray());
|
||||
public static string ConfFilePath { get; } = mp.ConfFolder + "\\mpvnet.conf";
|
||||
public static string RegPath { get; } = "HKCU\\Software\\" + Application.ProductName;
|
||||
public static string ClipboardMonitoring { get; set; } = "yes";
|
||||
|
||||
public static string[] VideoTypes { get; } = "mkv mp4 mpg avi mov webm vob wmv flv avs 264 h264 asf webm mpeg mpv y4m avc hevc 265 h265 m2v m2ts vpy mts m4v".Split(' ');
|
||||
public static string[] AudioTypes { get; } = "mp3 mp2 ac3 ogg opus flac wav w64 m4a dts dtsma dtshr dtshd eac3 thd thd+ac3 mka aac mpa".Split(' ');
|
||||
public static string[] SubtitleTypes { get; } = "srt ass idx sup ttxt ssa smi".Split(' ');
|
||||
|
||||
public static string DarkMode { get; set; } = "always";
|
||||
public static string ProcessInstance { get; set; } = "single";
|
||||
|
||||
public static bool DebugMode { get; set; } = false;
|
||||
|
||||
public static bool IsDarkMode {
|
||||
get => (DarkMode == "system" && Sys.IsDarkTheme) || DarkMode == "always";
|
||||
}
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
foreach (var i in Conf)
|
||||
ProcessProperty(i.Key, i.Value);
|
||||
|
||||
if (App.DebugMode)
|
||||
{
|
||||
try
|
||||
{
|
||||
string filePath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\mpvnet-debug.log";
|
||||
if (File.Exists(filePath)) File.Delete(filePath);
|
||||
Trace.Listeners.Clear();
|
||||
Trace.Listeners.Add(new TextWriterTraceListener(filePath));
|
||||
foreach (Screen screen in Screen.AllScreens)
|
||||
Trace.WriteLine(screen);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Msg.ShowException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Exit()
|
||||
{
|
||||
if (Trace.Listeners.Count > 0) Trace.Listeners[0].Close();
|
||||
}
|
||||
|
||||
static Dictionary<string, string> _Conf;
|
||||
|
||||
public static Dictionary<string, string> Conf {
|
||||
get {
|
||||
string darkMode = MainForm.Instance.MpvNetDarkMode;
|
||||
return (darkMode == "system" && Sys.IsDarkTheme) || darkMode == "always";
|
||||
if (_Conf == null)
|
||||
{
|
||||
_Conf = new Dictionary<string, string>();
|
||||
|
||||
if (File.Exists(ConfFilePath))
|
||||
foreach (string i in File.ReadAllLines(ConfFilePath))
|
||||
if (i.Contains("=") && !i.StartsWith("#"))
|
||||
_Conf[i.Substring(0, i.IndexOf("=")).Trim()] = i.Substring(i.IndexOf("=") + 1).Trim();
|
||||
}
|
||||
return _Conf;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ProcessProperty(string name, string value)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "clipboard-monitoring": ClipboardMonitoring = value; break;
|
||||
case "process-instance": ProcessInstance = value; break;
|
||||
case "dark-mode": DarkMode = value; break;
|
||||
case "debug-mode": DebugMode = value == "yes"; break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ProcessCommandLineEarly()
|
||||
{
|
||||
var args = Environment.GetCommandLineArgs().Skip(1);
|
||||
|
||||
foreach (string i in args)
|
||||
{
|
||||
if (i.StartsWith("--"))
|
||||
{
|
||||
if (i.Contains("="))
|
||||
{
|
||||
string left = i.Substring(2, i.IndexOf("=") - 2);
|
||||
string right = i.Substring(left.Length + 3);
|
||||
mp.ProcessProperty(left, right);
|
||||
ProcessProperty(left, right);
|
||||
}
|
||||
else
|
||||
{
|
||||
string switchName = i.Substring(2);
|
||||
|
||||
switch (switchName)
|
||||
{
|
||||
case "fs":
|
||||
case "fullscreen":
|
||||
mp.Fullscreen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,14 +239,18 @@ namespace mpvnet
|
||||
|
||||
public static void RemoveKey(string path)
|
||||
{
|
||||
GetRootKey(path).DeleteSubKeyTree(path.Substring(5), false);
|
||||
try {
|
||||
GetRootKey(path).DeleteSubKeyTree(path.Substring(5), false);
|
||||
} catch { }
|
||||
}
|
||||
|
||||
public static void RemoveValue(string path, string name)
|
||||
{
|
||||
using (RegistryKey rk = GetRootKey(path).OpenSubKey(path.Substring(5), true))
|
||||
if (!(rk is null))
|
||||
rk.DeleteValue(name, false);
|
||||
try {
|
||||
using (RegistryKey rk = GetRootKey(path).OpenSubKey(path.Substring(5), true))
|
||||
if (!(rk is null))
|
||||
rk.DeleteValue(name, false);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
static RegistryKey GetRootKey(string path)
|
||||
@@ -293,4 +393,15 @@ namespace mpvnet
|
||||
Math.Abs(screenPos.Y - Control.MousePosition.Y) > 10;
|
||||
}
|
||||
}
|
||||
|
||||
public class SingleProcess
|
||||
{
|
||||
public static int Message { get; } = RegisterWindowMessage("mpvnet_IPC");
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
|
||||
static extern int RegisterWindowMessage(string id);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool AllowSetForegroundWindow(int dwProcessId);
|
||||
}
|
||||
}
|
||||
67
mpv.net/Misc/Program.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace mpvnet
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] args = Environment.GetCommandLineArgs().Skip(1).ToArray();
|
||||
|
||||
if (args.Length == 2 && args[0] == "--reg-file-assoc")
|
||||
{
|
||||
if (args[1] == "audio") FileAssociation.Register(App.AudioTypes);
|
||||
if (args[1] == "video") FileAssociation.Register(App.VideoTypes);
|
||||
if (args[1] == "unreg") FileAssociation.Unregister();
|
||||
return;
|
||||
}
|
||||
|
||||
App.Init();
|
||||
Mutex mutex = new Mutex(true, "mpvnetProcessInstance", out bool isFirst);
|
||||
|
||||
if ((App.ProcessInstance == "single" || App.ProcessInstance == "queue") && !isFirst)
|
||||
{
|
||||
List<string> files = new List<string>();
|
||||
|
||||
foreach (string arg in args)
|
||||
if (!arg.StartsWith("--") && (File.Exists(arg) || arg == "-" || arg.StartsWith("http")))
|
||||
files.Add(arg);
|
||||
|
||||
if (files.Count > 0)
|
||||
RegistryHelp.SetObject(App.RegPath, "ShellFiles", files.ToArray());
|
||||
|
||||
RegistryHelp.SetObject(App.RegPath, "ProcessInstanceMode", App.ProcessInstance);
|
||||
|
||||
foreach(Process process in Process.GetProcessesByName("mpvnet"))
|
||||
{
|
||||
try {
|
||||
SingleProcess.AllowSetForegroundWindow(process.Id);
|
||||
Native.SendMessage(process.MainWindowHandle, SingleProcess.Message, IntPtr.Zero, IntPtr.Zero);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
mutex.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
mutex.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Msg.ShowException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,9 @@ namespace mpvnet
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool EnableWindow(IntPtr hWnd, bool bEnable);
|
||||
|
||||
[DllImport("user32.dll", EntryPoint = "GetWindowLong")]
|
||||
private static extern IntPtr GetWindowLong32(IntPtr hWnd, int nIndex);
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace mpvnet
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
|
||||
if (args.Length == 3 && args[1] == "--reg-file-assoc")
|
||||
{
|
||||
if (args[2] == "audio") FileAssociation.Register(App.AudioTypes);
|
||||
if (args[2] == "video") FileAssociation.Register(App.VideoTypes);
|
||||
if (args[2] == "unreg") FileAssociation.Unregister();
|
||||
return;
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Msg.ShowException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,11 @@ using System.Runtime.InteropServices;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("mpv.net")]
|
||||
[assembly: AssemblyDescription("A lightweight media player")]
|
||||
[assembly: AssemblyDescription("A modern media player")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("mpv.net")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017-2019 stax76")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017-2019 Frank Skare (stax76)")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -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("3.7.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.7.0.0")]
|
||||
[assembly: AssemblyVersion("4.3.1.0")]
|
||||
[assembly: AssemblyFileVersion("4.3.1.0")]
|
||||
|
||||
87
mpv.net/Properties/Resources.Designer.cs
generated
@@ -60,30 +60,117 @@ namespace mpvnet.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to
|
||||
/// # This file defines the input (keys and mouse) bindings of mpv and mpv.net
|
||||
/// # and it also defines the context menu of mpv.net. mpv.net has an input
|
||||
/// # editor and an config editor as alternative to editing conf text files.
|
||||
/// # The input and config editor can be found in mpv.net's context menu at:
|
||||
///
|
||||
/// # Settings > Show Config Editor
|
||||
/// # Settings > Show Input Editor
|
||||
///
|
||||
/// # The defaults of this file can be found at:
|
||||
///
|
||||
/// # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt
|
||||
///
|
||||
/// # th [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string inputConf {
|
||||
get {
|
||||
return ResourceManager.GetString("inputConf", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to
|
||||
/// # This file defines the input (keys and mouse) bindings of mpv and mpv.net
|
||||
/// # and it also defines the context menu of mpv.net. mpv.net has an input
|
||||
/// # editor and an config editor as alternatives to editing conf text files.
|
||||
/// # The input and config editor can be found in mpv.net's context menu at:
|
||||
///
|
||||
/// # Settings > Show Config Editor
|
||||
/// # Settings > Show Input Editor
|
||||
///
|
||||
/// # The defaults of this file can be found at:
|
||||
///
|
||||
/// # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt
|
||||
///
|
||||
/// # t [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string inputConfHeader {
|
||||
get {
|
||||
return ResourceManager.GetString("inputConfHeader", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to
|
||||
///# mpv manual: https://mpv.io/manual/master/
|
||||
///
|
||||
///# mpv.net mpv.conf defaults: https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt
|
||||
///
|
||||
///input-ar-delay = 500
|
||||
///input-ar-rate = 20
|
||||
///volume = 50
|
||||
///hwdec = yes
|
||||
///keep-open = yes
|
||||
///keep-open-pause = no
|
||||
///osd-playing-msg = ${filename}
|
||||
///screenshot-directory = ~~desktop/
|
||||
///input-default-bindings = no
|
||||
///.
|
||||
/// </summary>
|
||||
internal static string mpvConf {
|
||||
get {
|
||||
return ResourceManager.GetString("mpvConf", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [[settings]]
|
||||
///name = "hwdec"
|
||||
///default = "no"
|
||||
///filter = "Video"
|
||||
///helpurl = "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:"
|
||||
///options = [{ name = "no", help = "always use software decoding" },
|
||||
/// { name = "auto", help = "enabl [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string mpvConfToml {
|
||||
get {
|
||||
return ResourceManager.GetString("mpvConfToml", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap mpvnet {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("mpvnet", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [[settings]]
|
||||
///name = "dark-mode"
|
||||
///default = "always"
|
||||
///filter = "mpv.net"
|
||||
///help = "Enables a dark theme."
|
||||
///options = [{ name = "always" },
|
||||
/// { name = "system" , help = "Available on Windows 10 or higher" },
|
||||
/// { name = "never" }]
|
||||
///
|
||||
///[[settings]]
|
||||
///name = "clipboard-monitoring"
|
||||
///default = "yes"
|
||||
///filter = "mpv.net"
|
||||
///help = "Monitors the clipboard for URLs to play."
|
||||
///options = [{ name = "yes" },
|
||||
/// { name = "no" }].
|
||||
/// </summary>
|
||||
internal static string mpvNetConfToml {
|
||||
get {
|
||||
return ResourceManager.GetString("mpvNetConfToml", resourceCulture);
|
||||
|
||||
@@ -130,6 +130,9 @@
|
||||
<data name="mpvConfToml" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\mpvConfToml.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="mpvnet" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\mpvnet.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="mpvNetConfToml" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\mpvNetConfToml.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
|
||||
@@ -26,11 +26,13 @@
|
||||
|
||||
o script-message mpv.net open-files #menu: Open > Open Files...
|
||||
u script-message mpv.net open-url #menu: Open > Open URL...
|
||||
Ctrl+S script-message mpv.net show-media-search #menu: Open > Show media search...
|
||||
_ 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 add-files-to-playlist #menu: Open > Add files to playlist...
|
||||
Ctrl+S script-message mpv.net show-media-search #menu: Open > Show media search...
|
||||
_ ignore #menu: Open > -
|
||||
_ ignore #menu: Open > Recent
|
||||
|
||||
_ ignore #menu: -
|
||||
@@ -74,7 +76,7 @@
|
||||
Ctrl+BS set video-zoom 0; set video-pan-x 0; set video-pan-y 0 #menu: Pan & Scan > Reset
|
||||
|
||||
Ctrl+1 add contrast -1 #menu: Video > Decrease Contrast
|
||||
Ctrl+2 add contrast #menu: Video > Increase Contrast
|
||||
Ctrl+2 add contrast 1 #menu: Video > Increase Contrast
|
||||
_ ignore #menu: Video > -
|
||||
Ctrl+3 add brightness -1 #menu: Video > Decrease Brightness
|
||||
Ctrl+4 add brightness 1 #menu: Video > Increase Brightness
|
||||
@@ -137,7 +139,7 @@
|
||||
F8 show-text ${playlist} 5000 #menu: View > Show Playlist
|
||||
F9 show-text ${track-list} 5000 #menu: View > Show Audio/Video/Subtitle List
|
||||
|
||||
Ctrl+c script-message mpv.net show-conf-editor #menu: Settings > Show Config Editor
|
||||
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
|
||||
|
||||
@@ -153,6 +155,7 @@
|
||||
_ script-message mpv.net shell-execute https://github.com/mpv-player/mpv/blob/master/etc/input.conf #menu: Help > Show mpv default keys
|
||||
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt #menu: Help > Show mpv.net default keys
|
||||
_ script-message mpv.net shell-execute https://mpv-net.github.io/mpv.net-web-site/ #menu: Help > Show mpv.net web site
|
||||
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/blob/master/Manual.md #menu: Help > Show mpv.net manual
|
||||
_ ignore #menu: Help > -
|
||||
_ script-message mpv.net show-about #menu: Help > About mpv.net
|
||||
|
||||
|
||||
@@ -3,38 +3,37 @@ name = "hwdec"
|
||||
default = "no"
|
||||
filter = "Video"
|
||||
helpurl = "https://mpv.io/manual/master/#options-hwdec"
|
||||
help = "--hwdec=<mode> 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:"
|
||||
options = [{ name = "no", help = "always use software decoding (Default)" },
|
||||
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:"
|
||||
options = [{ name = "no", help = "always use software decoding" },
|
||||
{ name = "auto", help = "enable best hw decoder (see below)" },
|
||||
{ name = "yes", help = "exactly the same as auto" },
|
||||
{ name = "auto-copy", help = "enable best hw decoder with copy-back (see below)" },
|
||||
{ name = "dxva2", help = "requires --vo=gpu with --gpu-context=d3d11, --gpu-context=angle or --gpu-context=dxinterop (Windows only)" },
|
||||
{ name = "dxva2", help = "requires vo=gpu with gpu-context=d3d11, gpu-context=angle or gpu-context=dxinterop (Windows only)" },
|
||||
{ name = "dxva2-copy", help = "copies video back to system RAM (Windows only)" },
|
||||
{ name = "d3d11va", help = "requires --vo=gpu with --gpu-context=d3d11 or --gpu-context=angle (Windows 8+ only)" },
|
||||
{ name = "d3d11va", help = "requires vo=gpu with gpu-context=d3d11 or gpu-context=angle (Windows 8+ only)" },
|
||||
{ name = "d3d11va-copy", help = "copies video back to system RAM (Windows 8+ only)" },
|
||||
{ name = "cuda", help = "requires --vo=gpu (Any platform CUDA is available)" },
|
||||
{ name = "cuda", help = "requires vo=gpu (Any platform CUDA is available)" },
|
||||
{ name = "cuda-copy", help = "copies video back to system RAM (Any platform CUDA is available)" },
|
||||
{ name = "nvdec", help = "requires --vo=gpu (Any platform CUDA is available)" },
|
||||
{ name = "nvdec", help = "requires vo=gpu (Any platform CUDA is available)" },
|
||||
{ name = "nvdec-copy", help = "copies video back to system RAM (Any platform CUDA is available)" },
|
||||
{ name = "crystalhd", help = "copies video back to system RAM (Any platform supported by hardware)" },
|
||||
{ name = "rkmpp", help = "requires --vo=gpu (some RockChip devices only)" }]
|
||||
{ name = "rkmpp", help = "requires vo=gpu (some RockChip devices only)" }]
|
||||
|
||||
[[settings]]
|
||||
name = "gpu-api"
|
||||
default = "auto"
|
||||
filter = "Video"
|
||||
help = "--gpu-api=<type> Controls which type of graphics APIs will be accepted."
|
||||
options = [{ name = "auto", help = "Use any available API (Default)" },
|
||||
help = "Controls which type of graphics APIs will be accepted."
|
||||
options = [{ name = "auto", help = "Use any available API" },
|
||||
{ name = "opengl", help = "Allow only OpenGL (requires OpenGL 2.1+ or GLES 2.0+)" },
|
||||
{ name = "vulkan", help = "Allow only Vulkan (requires a valid/working --spirv-compiler)" },
|
||||
{ name = "d3d11", help = "Allow only --gpu-context=d3d11" }]
|
||||
{ name = "vulkan", help = "Allow only Vulkan (requires a valid/working spirv-compiler)" },
|
||||
{ name = "d3d11", help = "Allow only gpu-context=d3d11" }]
|
||||
|
||||
[[settings]]
|
||||
name = "gpu-context"
|
||||
default = "auto"
|
||||
filter = "Video"
|
||||
help = "--gpu-context=<sys> The value auto (the default) selects the GPU context. You can also pass help to get a complete list of compiled in backends (sorted by autoprobe order)."
|
||||
options = [{ name = "auto", help = "auto-select (Default)" },
|
||||
options = [{ name = "auto", help = "auto-select" },
|
||||
{ name = "win", help = "Win32/WGL" },
|
||||
{ name = "winvk", help = "VK_KHR_win32_surface" },
|
||||
{ name = "angle", help = "Direct3D11 through the OpenGL ES translation layer ANGLE. This supports almost everything the win backend does (if the ANGLE build is new enough)." },
|
||||
@@ -45,16 +44,16 @@ options = [{ name = "auto", help = "auto-select (Default)" },
|
||||
name = "vo"
|
||||
default = "gpu"
|
||||
filter = "Video"
|
||||
help = "Video output drivers to be used.\n\nFor more information visit:"
|
||||
helpurl = "https://mpv.io/manual/master/#video-output-drivers-vo"
|
||||
help = "--gpu=<mode> Video output drivers to be used. Default = gpu.\n\nFor more information visit:"
|
||||
options = [{ name = "gpu", help = "General purpose, customizable, GPU-accelerated video output driver. It supports extended scaling methods, dithering, color management, custom shaders, HDR, and more. (Default)" },
|
||||
options = [{ name = "gpu", help = "General purpose, customizable, GPU-accelerated video output driver. It supports extended scaling methods, dithering, color management, custom shaders, HDR, and more." },
|
||||
{ name = "direct3d", help = "Video output driver that uses the Direct3D interface" }]
|
||||
|
||||
[[settings]]
|
||||
name = "video-sync"
|
||||
default = "audio"
|
||||
filter = "Video"
|
||||
help = "--video-sync=<audio|...> How the player synchronizes audio and video.\n\nFor more information visit:"
|
||||
help = "How the player synchronizes audio and video.\n\nFor more information visit:"
|
||||
helpurl = "https://mpv.io/manual/master/#options-video-sync"
|
||||
options = [{ name = "audio" },
|
||||
{ name = "display-resample" },
|
||||
@@ -69,49 +68,49 @@ options = [{ name = "audio" },
|
||||
name = "scale"
|
||||
default = "bilinear"
|
||||
filter = "Video"
|
||||
help = "--scale=<filter> 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"
|
||||
options = [{ name = "bilinear", help = "Bilinear hardware texture filtering (fastest, very low quality). This is the default for compatibility reasons." },
|
||||
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"
|
||||
options = [{ name = "bilinear", help = "Bilinear hardware texture filtering (fastest, very low quality)." },
|
||||
{ name = "spline36", help = "Mid quality and speed. This is the default when using gpu-hq." },
|
||||
{ name = "lanczos", help = "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)" },
|
||||
{ name = "ewa_lanczos", help = "Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc)" },
|
||||
{ name = "ewa_lanczossharp", help = "A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default." },
|
||||
{ name = "mitchell", help = "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)." },
|
||||
{ name = "oversample", help = "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)." },
|
||||
{ name = "linear", help = "A --tscale filter." }]
|
||||
{ name = "mitchell", help = "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)." },
|
||||
{ name = "oversample", help = "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)." },
|
||||
{ name = "linear", help = "A tscale filter." }]
|
||||
|
||||
[[settings]]
|
||||
name = "cscale"
|
||||
default = "bilinear"
|
||||
filter = "Video"
|
||||
help = "--cscale=<filter> As --scale, but for interpolating chroma information. If the image is not subsampled, this option is ignored entirely."
|
||||
options = [{ name = "bilinear", help = "Bilinear hardware texture filtering (fastest, very low quality). This is the default for compatibility reasons." },
|
||||
help = "As scale, but for interpolating chroma information. If the image is not subsampled, this option is ignored entirely."
|
||||
options = [{ name = "bilinear", help = "Bilinear hardware texture filtering (fastest, very low quality)." },
|
||||
{ name = "spline36", help = "Mid quality and speed. This is the default when using gpu-hq." },
|
||||
{ name = "lanczos", help = "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)" },
|
||||
{ name = "ewa_lanczos", help = "Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc)" },
|
||||
{ name = "ewa_lanczossharp", help = "A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default." },
|
||||
{ name = "mitchell", help = "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)." },
|
||||
{ name = "oversample", help = "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)." },
|
||||
{ name = "linear", help = "A --tscale filter." }]
|
||||
{ name = "mitchell", help = "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)." },
|
||||
{ name = "oversample", help = "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)." },
|
||||
{ name = "linear", help = "A tscale filter." }]
|
||||
|
||||
[[settings]]
|
||||
name = "dscale"
|
||||
default = "bilinear"
|
||||
filter = "Video"
|
||||
help = "--dscale=<filter> Like --scale, but apply these filters on downscaling instead. If this option is unset, the filter implied by --scale will be applied."
|
||||
options = [{ name = "bilinear", help = "Bilinear hardware texture filtering (fastest, very low quality). This is the default for compatibility reasons." },
|
||||
help = "Like scale, but apply these filters on downscaling instead. If this option is unset, the filter implied by scale will be applied."
|
||||
options = [{ name = "bilinear", help = "Bilinear hardware texture filtering (fastest, very low quality)." },
|
||||
{ name = "spline36", help = "Mid quality and speed. This is the default when using gpu-hq." },
|
||||
{ name = "lanczos", help = "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)" },
|
||||
{ name = "ewa_lanczos", help = "Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc)" },
|
||||
{ name = "ewa_lanczossharp", help = "A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default." },
|
||||
{ name = "mitchell", help = "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)." },
|
||||
{ name = "oversample", help = "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)." },
|
||||
{ name = "linear", help = "A --tscale filter." }]
|
||||
{ name = "mitchell", help = "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)." },
|
||||
{ name = "oversample", help = "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)." },
|
||||
{ name = "linear", help = "A tscale filter." }]
|
||||
|
||||
[[settings]]
|
||||
name = "dither-depth"
|
||||
default = "no"
|
||||
filter = "Video"
|
||||
help = "--dither-depth=<N|no|auto> Set dither target depth to N. Default: no. 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."
|
||||
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."
|
||||
options = [{ name = "no", help = "Disable any dithering done by mpv." },
|
||||
{ name = "auto", help = "Automatic selection. If output bit depth cannot be detected, 8 bits per component are assumed." },
|
||||
{ name = "8", help = "Dither to 8 bit output." }]
|
||||
@@ -120,7 +119,7 @@ options = [{ name = "no", help = "Disable any dithering done by mpv." },
|
||||
name = "correct-downscaling"
|
||||
default = "no"
|
||||
filter = "Video"
|
||||
help = "--correct-downscaling 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."
|
||||
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."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
@@ -128,7 +127,7 @@ options = [{ name = "yes" },
|
||||
name = "sigmoid-upscaling"
|
||||
default = "no"
|
||||
filter = "Video"
|
||||
help = "--sigmoid-upscaling When upscaling, use a sigmoidal color transform to avoid emphasizing ringing artifacts. This also implies --linear-scaling."
|
||||
help = "When upscaling, use a sigmoidal color transform to avoid emphasizing ringing artifacts. This also implies linear-scaling."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
@@ -136,7 +135,7 @@ options = [{ name = "yes" },
|
||||
name = "deband"
|
||||
default = "no"
|
||||
filter = "Video"
|
||||
help = "--deband 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."
|
||||
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."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
@@ -144,59 +143,98 @@ options = [{ name = "yes" },
|
||||
name = "volume"
|
||||
default = "100"
|
||||
filter = "Audio"
|
||||
help = "--volume=<integer> 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"
|
||||
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"
|
||||
|
||||
[[settings]]
|
||||
name = "alang"
|
||||
default = ""
|
||||
filter = "Audio"
|
||||
help = "--alang=<languagecode[,languagecode,...]> 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."
|
||||
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."
|
||||
|
||||
[[settings]]
|
||||
name = "audio-file-auto"
|
||||
default = "no"
|
||||
filter = "Audio"
|
||||
help = "--audio-file-auto=<no|exact|fuzzy|all>, --no-audio-file-auto Load additional audio files matching the video filename. The parameter specifies how external audio files are matched."
|
||||
options = [{ name = "no", help = "Don't automatically load external audio files (default)." },
|
||||
help = "Load additional audio files matching the video filename. The parameter specifies how external audio files are matched."
|
||||
options = [{ name = "no", help = "Don't automatically load external audio files." },
|
||||
{ name = "exact", help = "Load the media filename with audio file extension." },
|
||||
{ name = "fuzzy", help = "Load all audio files containing media filename." },
|
||||
{ name = "all", help = "Load all audio files in the current and --audio-file-paths directories." }]
|
||||
{ name = "all", help = "Load all audio files in the current and audio-file-paths directories." }]
|
||||
|
||||
[[settings]]
|
||||
name = "slang"
|
||||
default = ""
|
||||
filter = "Subtitle"
|
||||
help = "--slang=<languagecode[,languagecode,...]> 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."
|
||||
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."
|
||||
|
||||
[[settings]]
|
||||
name = "sub-auto"
|
||||
default = "exact"
|
||||
filter = "Subtitle"
|
||||
help = "--sub-auto=<no|exact|fuzzy|all>, --no-sub-auto Load additional subtitle files matching the video filename. The parameter specifies how external subtitle files are matched. exact is enabled by default."
|
||||
help = "Load additional subtitle files matching the video filename. The parameter specifies how external subtitle files are matched. exact is enabled by default."
|
||||
options = [{ name = "no", help = "Don't automatically load external subtitle files." },
|
||||
{ name = "exact", help = "Load the media filename with subtitle file extension (Default)." },
|
||||
{ name = "exact", help = "Load the media filename with subtitle file extension." },
|
||||
{ name = "fuzzy", help = "Load all subs containing media filename." },
|
||||
{ name = "all", help = "Load all subs in the current and --sub-file-paths directories." }]
|
||||
{ name = "all", help = "Load all subs in the current and sub-file-paths directories." }]
|
||||
|
||||
[[settings]]
|
||||
name = "sub-font"
|
||||
default = ""
|
||||
filter = "Subtitle"
|
||||
help = "Specify font to use for subtitles that do not themselves specify a particular font. The default is sans-serif."
|
||||
|
||||
[[settings]]
|
||||
name = "sub-font-size"
|
||||
default = ""
|
||||
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"
|
||||
|
||||
[[settings]]
|
||||
name = "sub-color"
|
||||
default = ""
|
||||
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"
|
||||
|
||||
[[settings]]
|
||||
name = "sub-border-color"
|
||||
default = ""
|
||||
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)."
|
||||
|
||||
[[settings]]
|
||||
name = "sub-back-color"
|
||||
default = ""
|
||||
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."
|
||||
|
||||
[[settings]]
|
||||
name = "screen"
|
||||
default = ""
|
||||
filter = "Screen"
|
||||
help = "--screen=<default|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. Default: default."
|
||||
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."
|
||||
|
||||
[[settings]]
|
||||
name = "osd-playing-msg"
|
||||
default = ""
|
||||
width = 300
|
||||
filter = "Screen"
|
||||
help = "--osd-playing-msg=<value> 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:"
|
||||
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:"
|
||||
helpurl = "https://mpv.io/manual/master/#property-expansion"
|
||||
|
||||
[[settings]]
|
||||
name = "osd-font-size"
|
||||
default = "55"
|
||||
filter = "Screen"
|
||||
help = "Specify the OSD font size. See sub-font-size for details. Default: 55"
|
||||
|
||||
[[settings]]
|
||||
name = "fullscreen"
|
||||
default = "no"
|
||||
filter = "Screen"
|
||||
help = "--fullscreen=<yes|no>, fs=<yes|no> Start the player in fullscreen mode. Default: no."
|
||||
help = "Start the player in fullscreen mode."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
@@ -204,21 +242,21 @@ options = [{ name = "yes" },
|
||||
name = "screenshot-directory"
|
||||
default = ""
|
||||
width = 500
|
||||
folder = true
|
||||
type = "folder"
|
||||
filter = "Screen"
|
||||
help = "--screenshot-directory=<value> 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.\n\nThis option is not set by default, and thus will write screenshots to the directory from which mpv was started. In pseudo-gui mode (see PSEUDO GUI MODE), this is set to the desktop."
|
||||
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.\n\nThis option is not set by default, and thus will write screenshots to the directory from which mpv was started. In pseudo-gui mode (see PSEUDO GUI MODE), this is set to the desktop."
|
||||
|
||||
[[settings]]
|
||||
name = "autofit"
|
||||
default = "50%"
|
||||
filter = "Screen"
|
||||
help = "--autofit=<percent value> Set the initial window size in percent. Please note that this setting is only partly implemented in mpv.net, accepted are only integer values with percent sign added. Default: 50%."
|
||||
help = "Set the initial window size in percent. Please note that this setting is only partly implemented in mpv.net, accepted are only integer values with percent sign added. Default: 50%"
|
||||
|
||||
[[settings]]
|
||||
name = "keep-open-pause"
|
||||
default = "yes"
|
||||
filter = "Playback"
|
||||
help = "--keep-open-pause=<yes|no> 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. Default: yes."
|
||||
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."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
@@ -226,22 +264,22 @@ options = [{ name = "yes" },
|
||||
name = "keep-open"
|
||||
default = "no"
|
||||
filter = "Playback"
|
||||
help = "--keep-open=<yes|no|always> Do not terminate when playing or seeking beyond the end of the file, and there is not next file to be played (and --loop is not used). Instead, pause the player. When trying to seek beyond end of the file, the player will attempt to seek to the last frame.\n\nNormally, this will act like set pause yes on EOF, unless the --keep-open-pause=no option is set."
|
||||
options = [{ name = "yes", help = "Don't terminate if the current file is the last playlist entry. Equivalent to --keep-open without arguments."},
|
||||
{ name = "no", help = "If the current file ends, go to the next file or terminate. (Default.)" },
|
||||
help = "Do not terminate when playing or seeking beyond the end of the file, and there is not next file to be played (and loop is not used). Instead, pause the player. When trying to seek beyond end of the file, the player will attempt to seek to the last frame.\n\nNormally, this will act like set pause yes on EOF, unless the keep-open-pause=no option is set."
|
||||
options = [{ name = "yes", help = "Don't terminate if the current file is the last playlist entry. Equivalent to keep-open without arguments."},
|
||||
{ name = "no", help = "If the current file ends, go to the next file or terminate." },
|
||||
{ name = "always", help = "Like yes, but also applies to files before the last playlist entry. This means playback will never automatically advance to the next file."}]
|
||||
|
||||
[[settings]]
|
||||
name = "loop-file"
|
||||
default = ""
|
||||
filter = "Playback"
|
||||
help = "--loop-file=<N|inf|no>, loop=<N|inf|no> Loop a single file N times. inf means forever, no means normal playback. For compatibility, --loop-file and --loop-file=yes are also accepted, and are the same as --loop-file=inf.\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.\n\n--loop is an alias for this option."
|
||||
help = "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."
|
||||
|
||||
[[settings]]
|
||||
name = "save-position-on-quit"
|
||||
default = "no"
|
||||
filter = "Playback"
|
||||
help = "--save-position-on-quit=<yes|no> 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."
|
||||
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."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
@@ -249,29 +287,29 @@ options = [{ name = "yes" },
|
||||
name = "input-ar-delay"
|
||||
default = ""
|
||||
filter = "Input"
|
||||
help = "--input-ar-delay=<integer> Delay in milliseconds before we start to autorepeat a key (0 to disable)."
|
||||
help = "Delay in milliseconds before we start to autorepeat a key (0 to disable)."
|
||||
|
||||
[[settings]]
|
||||
name = "input-ar-rate"
|
||||
default = ""
|
||||
filter = "Input"
|
||||
help = "--input-ar-rate=<integer> Number of key presses to generate per second on autorepeat."
|
||||
help = "Number of key presses to generate per second on autorepeat."
|
||||
|
||||
[[settings]]
|
||||
name = "hr-seek"
|
||||
default = "absolute"
|
||||
filter = "Playback"
|
||||
help = "--hr-seek=<no|absolute|yes> 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."
|
||||
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."
|
||||
options = [{ name = "yes", help = "Use precise seeks whenever possible." },
|
||||
{ name = "no", help = "Never use precise seeks." },
|
||||
{ name = "absolute", help = "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 (default)." },
|
||||
{ name = "absolute", help = "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." },
|
||||
{ name = "always", help = "Same as yes (for compatibility)." }]
|
||||
|
||||
[[settings]]
|
||||
name = "track-auto-selection"
|
||||
default = "yes"
|
||||
filter = "Playback"
|
||||
help = "--track-auto-selection=<yes|no> Enable the default track auto-selection (default: yes). 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."
|
||||
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."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
@@ -279,4 +317,4 @@ options = [{ name = "yes" },
|
||||
name = "loop-playlist"
|
||||
default = ""
|
||||
filter = "Playback"
|
||||
help = "--loop-playlist=<N|inf|force|no>, --loop-playlist 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. --loop-playlist is the same as --loop-playlist=inf.\n\nThe 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."
|
||||
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."
|
||||
@@ -5,4 +5,29 @@ filter = "mpv.net"
|
||||
help = "Enables a dark theme."
|
||||
options = [{ name = "always" },
|
||||
{ name = "system" , help = "Available on Windows 10 or higher" },
|
||||
{ name = "never" }]
|
||||
{ name = "never" }]
|
||||
|
||||
[[settings]]
|
||||
name = "clipboard-monitoring"
|
||||
default = "yes"
|
||||
filter = "mpv.net"
|
||||
help = "Monitors the clipboard for URLs to play."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
[[settings]]
|
||||
name = "process-instance"
|
||||
default = "single"
|
||||
filter = "mpv.net"
|
||||
help = "Defines if more then one mpv.net process is allowed."
|
||||
options = [{ name = "multi", help = "Create a new process everytime the shell starts mpv.net" },
|
||||
{ name = "single", help = "Force a single process everytime the shell starts mpv.net" },
|
||||
{ name = "queue", help = "Force a single process and add files to playlist" }]
|
||||
|
||||
[[settings]]
|
||||
name = "debug-mode"
|
||||
default = "no"
|
||||
filter = "mpv.net"
|
||||
help = "Writes debug info to a file located on the desktop."
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
BIN
mpv.net/Resources/mpvnet.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
@@ -13,11 +13,11 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Controls:SearchTextBoxUserControl HintText="Find a setting" x:Name="SearchControl" Width="250" Margin="0,20,0,10" Grid.ColumnSpan="2" />
|
||||
<ScrollViewer x:Name="MainScrollViewer" VerticalScrollBarVisibility="Auto" Grid.Row="1" Grid.Column="1" Margin="0,0,0,10">
|
||||
<Controls:SearchTextBoxUserControl HintText="Find a setting" x:Name="SearchControl" Width="250" Margin="0,20,0,0" Grid.ColumnSpan="2"/>
|
||||
<ScrollViewer x:Name="MainScrollViewer" VerticalScrollBarVisibility="Auto" Grid.Row="1" Grid.Column="2" Margin="0,0,0,10">
|
||||
<StackPanel x:Name="MainStackPanel"></StackPanel>
|
||||
</ScrollViewer>
|
||||
<StackPanel Margin="20,0,0,0" Grid.Row="1">
|
||||
@@ -7,6 +7,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Linq;
|
||||
|
||||
using DynamicGUI;
|
||||
|
||||
@@ -14,8 +15,8 @@ namespace mpvnet
|
||||
{
|
||||
public partial class ConfWindow : Window
|
||||
{
|
||||
private List<SettingBase> MpvSettingsDefinitions = Settings.LoadSettings(Properties.Resources.mpvConfToml);
|
||||
private List<SettingBase> MpvNetSettingsDefinitions = Settings.LoadSettings(Properties.Resources.mpvNetConfToml);
|
||||
private List<SettingBase> SettingsDefinitions = Settings.LoadSettings(Properties.Resources.mpvConfToml);
|
||||
private List<SettingBase> NetSettingsDefinitions = Settings.LoadSettings(Properties.Resources.mpvNetConfToml);
|
||||
private Dictionary<string, Dictionary<string, string>> Comments = new Dictionary<string, Dictionary<string, string>>();
|
||||
|
||||
public ObservableCollection<string> FilterStrings { get; } = new ObservableCollection<string>();
|
||||
@@ -25,10 +26,10 @@ namespace mpvnet
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
SearchControl.SearchTextBox.TextChanged += SearchTextBox_TextChanged;
|
||||
LoadSettings(MpvSettingsDefinitions, MpvConf);
|
||||
LoadSettings(MpvNetSettingsDefinitions, MpvNetConf);
|
||||
LoadSettings(SettingsDefinitions, Conf);
|
||||
LoadSettings(NetSettingsDefinitions, NetConf);
|
||||
SearchControl.Text = RegistryHelp.GetString(@"HKCU\Software\mpv.net", "config editor search");
|
||||
|
||||
|
||||
if (App.IsDarkMode)
|
||||
{
|
||||
Foreground = Brushes.White;
|
||||
@@ -79,21 +80,21 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, string> _mpvConf;
|
||||
private Dictionary<string, string> _Conf;
|
||||
|
||||
public Dictionary<string, string> MpvConf {
|
||||
public Dictionary<string, string> Conf {
|
||||
get {
|
||||
if (_mpvConf == null) _mpvConf = LoadConf(mp.MpvConfPath);
|
||||
return _mpvConf;
|
||||
if (_Conf == null) _Conf = LoadConf(mp.ConfPath);
|
||||
return _Conf;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, string> _mpvNetConf;
|
||||
private Dictionary<string, string> _NetConf;
|
||||
|
||||
public Dictionary<string, string> MpvNetConf {
|
||||
public Dictionary<string, string> NetConf {
|
||||
get {
|
||||
if (_mpvNetConf == null) _mpvNetConf = LoadConf(mp.MpvNetConfPath);
|
||||
return _mpvNetConf;
|
||||
if (_NetConf == null) _NetConf = LoadConf(App.ConfFilePath);
|
||||
return _NetConf;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,19 +139,19 @@ namespace mpvnet
|
||||
{
|
||||
bool isDirty = false;
|
||||
|
||||
foreach (SettingBase i in MpvSettingsDefinitions)
|
||||
foreach (SettingBase i in SettingsDefinitions)
|
||||
if (i.StartValue != i.Value)
|
||||
isDirty = true;
|
||||
|
||||
foreach (SettingBase i in MpvNetSettingsDefinitions)
|
||||
foreach (SettingBase i in NetSettingsDefinitions)
|
||||
if (i.StartValue != i.Value)
|
||||
isDirty = true;
|
||||
|
||||
if (!isDirty)
|
||||
return;
|
||||
|
||||
WriteToDisk(mp.MpvConfPath, MpvConf, MpvSettingsDefinitions);
|
||||
WriteToDisk(mp.MpvNetConfPath, MpvNetConf, MpvNetSettingsDefinitions);
|
||||
WriteToDisk(mp.ConfPath, Conf, SettingsDefinitions);
|
||||
WriteToDisk(App.ConfFilePath, NetConf, NetSettingsDefinitions);
|
||||
|
||||
Msg.Show("Changes will be available on next mpv.net startup.");
|
||||
}
|
||||
@@ -215,6 +216,8 @@ namespace mpvnet
|
||||
{
|
||||
SearchControl.SearchTextBox.SelectAll();
|
||||
Keyboard.Focus(SearchControl.SearchTextBox);
|
||||
foreach (var i in MainStackPanel.Children.OfType<StringSettingControl>())
|
||||
i.Update();
|
||||
}
|
||||
|
||||
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
@@ -225,7 +228,7 @@ namespace mpvnet
|
||||
|
||||
private void OpenSettingsTextBlock_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
Process.Start(Path.GetDirectoryName(mp.MpvConfPath));
|
||||
Process.Start(Path.GetDirectoryName(mp.ConfPath));
|
||||
}
|
||||
|
||||
private void ShowManualTextBlock_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
@@ -113,7 +113,7 @@ namespace mpvnet
|
||||
void Execute()
|
||||
{
|
||||
if (ListView.SelectedItem != null)
|
||||
mp.LoadFiles(ListView.SelectedItem as string);
|
||||
mp.Load(ListView.SelectedItem as string);
|
||||
Keyboard.Focus(FilterTextBox);
|
||||
}
|
||||
|
||||
@@ -24,15 +24,6 @@ namespace mpvnet
|
||||
bool IgnoreDpiChanged = true;
|
||||
List<string> RecentFiles;
|
||||
|
||||
public string MpvNetDarkMode { get; set; } = "always";
|
||||
public bool MpvFullscreen { get; set; }
|
||||
public float MpvAutofit { get; set; } = 0.50f;
|
||||
public int MpvScreen { get; set; } = -1;
|
||||
public string MpvSid { get; set; } = "";
|
||||
public string MpvAid { get; set; } = "";
|
||||
public string MpvVid { get; set; } = "";
|
||||
public int MpvEdition { get; set; }
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -49,25 +40,18 @@ namespace mpvnet
|
||||
MinimumSize = new Size(FontHeight * 16, FontHeight * 9);
|
||||
Text += " " + Application.ProductVersion;
|
||||
|
||||
object recent = RegistryHelp.GetObject("HKCU\\Software\\" + Application.ProductName, "Recent");
|
||||
object recent = RegistryHelp.GetObject(App.RegPath, "Recent");
|
||||
|
||||
if (recent is string[] r)
|
||||
RecentFiles = new List<string>(r);
|
||||
else
|
||||
RecentFiles = new List<string>();
|
||||
|
||||
foreach (var i in mp.mpvConf)
|
||||
ProcessMpvProperty(i.Key, i.Value);
|
||||
|
||||
foreach (var i in mp.mpvNetConf)
|
||||
ProcessMpvNetProperty(i.Key, i.Value);
|
||||
|
||||
ProcessCommandLineEarly();
|
||||
|
||||
if (MpvScreen == -1) MpvScreen = Array.IndexOf(Screen.AllScreens, Screen.PrimaryScreen);
|
||||
SetScreen(MpvScreen);
|
||||
|
||||
ChangeFullscreen(MpvFullscreen);
|
||||
var dummy = mp.Conf;
|
||||
App.ProcessCommandLineEarly();
|
||||
if (mp.Screen == -1) mp.Screen = Array.IndexOf(Screen.AllScreens, Screen.PrimaryScreen);
|
||||
SetScreen(mp.Screen);
|
||||
ChangeFullscreen(mp.Fullscreen);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -94,7 +78,7 @@ namespace mpvnet
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "vid", track.ID.ToString()); };
|
||||
mi.Checked = MpvVid == track.ID.ToString();
|
||||
mi.Checked = mp.Vid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
@@ -105,7 +89,7 @@ namespace mpvnet
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "aid", track.ID.ToString()); };
|
||||
mi.Checked = MpvAid == track.ID.ToString();
|
||||
mi.Checked = mp.Aid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
@@ -116,7 +100,7 @@ namespace mpvnet
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "sid", track.ID.ToString()); };
|
||||
mi.Checked = MpvSid == track.ID.ToString();
|
||||
mi.Checked = mp.Sid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
@@ -124,7 +108,7 @@ namespace mpvnet
|
||||
{
|
||||
MenuItem mi = new MenuItem("S: No subtitles");
|
||||
mi.Action = () => { mp.commandv("set", "sid", "no"); };
|
||||
mi.Checked = MpvSid == "no";
|
||||
mi.Checked = mp.Sid == "no";
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
@@ -135,7 +119,7 @@ namespace mpvnet
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "edition", track.ID.ToString()); };
|
||||
mi.Checked = MpvEdition == track.ID;
|
||||
mi.Checked = mp.Edition == track.ID;
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
}
|
||||
@@ -166,7 +150,7 @@ namespace mpvnet
|
||||
recent.DropDownItems.Clear();
|
||||
|
||||
foreach (string path in RecentFiles)
|
||||
MenuItem.Add(recent.DropDownItems, path, () => mp.LoadFiles(path));
|
||||
MenuItem.Add(recent.DropDownItems, path, () => mp.Load(path));
|
||||
|
||||
recent.DropDownItems.Add(new ToolStripSeparator());
|
||||
MenuItem mi = new MenuItem("Clear List");
|
||||
@@ -215,7 +199,7 @@ namespace mpvnet
|
||||
{
|
||||
if (IsFullscreen || mp.VideoSize.Width == 0) return;
|
||||
Screen screen = Screen.FromControl(this);
|
||||
int height = Convert.ToInt32(screen.Bounds.Height * MpvAutofit);
|
||||
int height = Convert.ToInt32(screen.Bounds.Height * mp.Autofit);
|
||||
int width = Convert.ToInt32(height * mp.VideoSize.Width / (double)mp.VideoSize.Height);
|
||||
Point middlePos = new Point(Left + Width / 2, Top + Height / 2);
|
||||
var rect = new Native.RECT(new Rectangle(screen.Bounds.X, screen.Bounds.Y, width, height));
|
||||
@@ -230,7 +214,7 @@ namespace mpvnet
|
||||
if (IsFullscreen || mp.VideoSize.Width == 0) return;
|
||||
Screen screen = Screen.FromControl(this);
|
||||
int height = ClientSize.Height;
|
||||
if (height > screen.Bounds.Height * 0.9) height = Convert.ToInt32(screen.Bounds.Height * MpvAutofit);
|
||||
if (height > screen.Bounds.Height * 0.9) height = Convert.ToInt32(screen.Bounds.Height * mp.Autofit);
|
||||
int width = Convert.ToInt32(height * mp.VideoSize.Width / (double)mp.VideoSize.Height);
|
||||
Point middlePos = new Point(Left + Width / 2, Top + Height / 2);
|
||||
var rect = new Native.RECT(new Rectangle(screen.Bounds.X, screen.Bounds.Y, width, height));
|
||||
@@ -238,72 +222,9 @@ namespace mpvnet
|
||||
int left = middlePos.X - rect.Width / 2;
|
||||
int top = middlePos.Y - rect.Height / 2;
|
||||
Screen[] screens = Screen.AllScreens;
|
||||
if (left < screens[0].Bounds.Left) left = screens[0].Bounds.Left;
|
||||
int maxLeft = screens[0].Bounds.Left + screens.Select((sc) => sc.Bounds.Width).Sum() - rect.Width - SystemInformation.CaptionHeight;
|
||||
if (left > maxLeft) left = maxLeft;
|
||||
Native.SetWindowPos(Handle, IntPtr.Zero /* HWND_TOP */, left, top, rect.Width, rect.Height, 4 /* SWP_NOZORDER */);
|
||||
}
|
||||
|
||||
protected void ProcessCommandLineEarly()
|
||||
{
|
||||
var args = Environment.GetCommandLineArgs().Skip(1);
|
||||
|
||||
foreach (string i in args)
|
||||
{
|
||||
if (i.StartsWith("--"))
|
||||
{
|
||||
if (i.Contains("="))
|
||||
{
|
||||
string left = i.Substring(2, i.IndexOf("=") - 2);
|
||||
string right = i.Substring(left.Length + 3);
|
||||
ProcessMpvProperty(left, right);
|
||||
ProcessMpvNetProperty(left, right);
|
||||
}
|
||||
else
|
||||
{
|
||||
string switchName = i.Substring(2);
|
||||
|
||||
switch (switchName)
|
||||
{
|
||||
case "fs":
|
||||
case "fullscreen":
|
||||
MpvFullscreen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessMpvProperty(string name, string value)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "autofit":
|
||||
if (value.Length == 3 && value.EndsWith("%"))
|
||||
if (int.TryParse(value.Substring(0, 2), out int result))
|
||||
MpvAutofit = result / 100f;
|
||||
break;
|
||||
case "fs":
|
||||
case "fullscreen":
|
||||
MpvFullscreen = value == "yes";
|
||||
break;
|
||||
case "screen":
|
||||
MpvScreen = Convert.ToInt32(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessMpvNetProperty(string name, string value)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "dark-mode":
|
||||
MpvNetDarkMode = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void BuildMenu()
|
||||
{
|
||||
string content = File.ReadAllText(mp.InputConfPath);
|
||||
@@ -414,16 +335,20 @@ namespace mpvnet
|
||||
case 0x0104: // WM_SYSKEYDOWN
|
||||
case 0x0105: // WM_SYSKEYUP
|
||||
case 0x020A: // WM_MOUSEWHEEL
|
||||
if (mp.MpvWindowHandle != IntPtr.Zero)
|
||||
Native.SendMessage(mp.MpvWindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
if (mp.WindowHandle != IntPtr.Zero)
|
||||
Native.SendMessage(mp.WindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
break;
|
||||
case 0x0200: // WM_MOUSEMOVE
|
||||
Point pos = PointToClient(Cursor.Position);
|
||||
mp.command_string($"mouse {pos.X} {pos.Y}");
|
||||
if (CursorHelp.IsPosDifferent(LastCursorPosChanged)) CursorHelp.Show();
|
||||
break;
|
||||
case 0x319: // WM_APPCOMMAND
|
||||
if (mp.MpvWindowHandle != IntPtr.Zero)
|
||||
Native.PostMessage(mp.MpvWindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
if (mp.WindowHandle != IntPtr.Zero)
|
||||
Native.PostMessage(mp.WindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
break;
|
||||
case 0x203: // Native.WM.LBUTTONDBLCLK
|
||||
if (!IsMouseInOSC())
|
||||
mp.command_string("cycle fullscreen");
|
||||
if (!IsMouseInOSC()) mp.command_string("cycle fullscreen");
|
||||
break;
|
||||
case 0x02E0: // WM_DPICHANGED
|
||||
if (IgnoreDpiChanged) break;
|
||||
@@ -449,6 +374,30 @@ namespace mpvnet
|
||||
m.Result = new IntPtr(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m.Msg == SingleProcess.Message)
|
||||
{
|
||||
object filesObject = RegistryHelp.GetObject(App.RegPath, "ShellFiles");
|
||||
|
||||
if (filesObject is string[] files)
|
||||
{
|
||||
switch (RegistryHelp.GetString(App.RegPath, "ProcessInstanceMode"))
|
||||
{
|
||||
case "single":
|
||||
mp.Load(files);
|
||||
break;
|
||||
case "queue":
|
||||
foreach (string file in files)
|
||||
mp.commandv("loadfile", file, "append");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RegistryHelp.RemoveValue(App.RegPath, "ShellFiles");
|
||||
Activate();
|
||||
return;
|
||||
}
|
||||
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
|
||||
@@ -463,9 +412,9 @@ namespace mpvnet
|
||||
{
|
||||
base.OnDragDrop(e);
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
mp.LoadFiles(e.Data.GetData(DataFormats.FileDrop) as String[]);
|
||||
mp.Load(e.Data.GetData(DataFormats.FileDrop) as String[]);
|
||||
if (e.Data.GetDataPresent(DataFormats.Text))
|
||||
mp.LoadFiles(e.Data.GetData(DataFormats.Text).ToString());
|
||||
mp.Load(e.Data.GetData(DataFormats.Text).ToString());
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
@@ -485,15 +434,6 @@ namespace mpvnet
|
||||
mp.commandv("quit");
|
||||
}
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseMove(e);
|
||||
mp.command_string($"mouse {e.X} {e.Y}");
|
||||
|
||||
if (CursorHelp.IsPosDifferent(LastCursorPosChanged))
|
||||
CursorHelp.Show();
|
||||
}
|
||||
|
||||
bool IsMouseInOSC() => PointToClient(Control.MousePosition).Y > ClientSize.Height * 0.9;
|
||||
|
||||
void Timer_Tick(object sender, EventArgs e)
|
||||
@@ -529,32 +469,38 @@ namespace mpvnet
|
||||
|
||||
void mpPropChangeOnTop(bool value) => BeginInvoke(new Action(() => TopMost = value));
|
||||
|
||||
void mpPropChangeAid(string value) => MpvAid = value;
|
||||
void mpPropChangeAid(string value) => mp.Aid = value;
|
||||
|
||||
void mpPropChangeSid(string value) => MpvSid = value;
|
||||
void mpPropChangeSid(string value) => mp.Sid = value;
|
||||
|
||||
void mpPropChangeVid(string value) => MpvVid = value;
|
||||
void mpPropChangeVid(string value) => mp.Vid = value;
|
||||
|
||||
void mpPropChangeEdition(int value) => MpvEdition = value;
|
||||
void mpPropChangeEdition(int value) => mp.Edition = value;
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
if ((MpvNetDarkMode == "system" && Sys.IsDarkTheme) || MpvNetDarkMode == "always")
|
||||
ToolStripRendererEx.ColorTheme = Color.Black;
|
||||
if (App.IsDarkMode) ToolStripRendererEx.ColorTheme = Color.Black;
|
||||
ContextMenu = new ContextMenuStripEx(components);
|
||||
ContextMenu.Opened += ContextMenu_Opened;
|
||||
ContextMenu.Opening += ContextMenu_Opening;
|
||||
BuildMenu();
|
||||
ContextMenuStrip = ContextMenu;
|
||||
IgnoreDpiChanged = false;
|
||||
CheckURL();
|
||||
CheckURLinClipboard();
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
if (mp.IsLogoVisible) mp.ShowLogo();
|
||||
}
|
||||
|
||||
protected override void OnFormClosed(FormClosedEventArgs e)
|
||||
{
|
||||
base.OnFormClosed(e);
|
||||
RegistryHelp.SetObject("HKCU\\Software\\" + Application.ProductName, "Recent", RecentFiles.ToArray());
|
||||
RegistryHelp.SetObject(App.RegPath, "Recent", RecentFiles.ToArray());
|
||||
App.Exit();
|
||||
mp.commandv("quit");
|
||||
mp.AutoResetEvent.WaitOne(3000);
|
||||
}
|
||||
@@ -568,19 +514,20 @@ namespace mpvnet
|
||||
protected override void OnActivated(EventArgs e)
|
||||
{
|
||||
base.OnActivated(e);
|
||||
CheckURL();
|
||||
CheckURLinClipboard();
|
||||
}
|
||||
|
||||
void CheckURL()
|
||||
void CheckURLinClipboard()
|
||||
{
|
||||
if (App.ClipboardMonitoring != "yes") return;
|
||||
string clipboard = Clipboard.GetText();
|
||||
|
||||
if (clipboard.StartsWith("http") && RegistryHelp.GetString("HKCU\\Software\\" + Application.ProductName, "LastURL") != clipboard && Visible)
|
||||
if (clipboard.StartsWith("http") && RegistryHelp.GetString(App.RegPath, "LastURL") != clipboard && Visible)
|
||||
{
|
||||
RegistryHelp.SetObject("HKCU\\Software\\" + Application.ProductName, "LastURL", clipboard);
|
||||
RegistryHelp.SetObject(App.RegPath, "LastURL", clipboard);
|
||||
|
||||
if (Msg.ShowQuestion("Play URL?", clipboard) == MsgResult.OK)
|
||||
mp.LoadFiles(clipboard);
|
||||
mp.Load(clipboard);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,20 +137,20 @@
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Addon.cs" />
|
||||
<Compile Include="Misc\Addon.cs" />
|
||||
<Page Include="Controls\SearchTextBoxUserControl.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Windows\AboutWindow.xaml">
|
||||
<Page Include="WPF\AboutWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Windows\EverythingWindow.xaml">
|
||||
<Page Include="WPF\EverythingWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Windows\CommandPaletteWindow.xaml">
|
||||
<Page Include="WPF\CommandPaletteWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -169,53 +169,52 @@
|
||||
<DependentUpon>StringSettingControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DynamicGUI\Tommy.cs" />
|
||||
<Compile Include="MediaInfo.cs" />
|
||||
<Compile Include="Menu.cs">
|
||||
<Compile Include="Native\MediaInfo.cs" />
|
||||
<Compile Include="WinForms\Menu.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PowerShellScript.cs" />
|
||||
<Compile Include="Scripting\PowerShellScript.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PythonScript.cs" />
|
||||
<Compile Include="libmpv.cs" />
|
||||
<Compile Include="MainForm.cs">
|
||||
<Compile Include="Scripting\PythonScript.cs" />
|
||||
<Compile Include="mpv\libmpv.cs" />
|
||||
<Compile Include="WinForms\MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<Compile Include="WinForms\MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Misc.cs" />
|
||||
<Compile Include="mp.cs" />
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Native.cs" />
|
||||
<Compile Include="NativeHelp.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Misc\Misc.cs" />
|
||||
<Compile Include="mpv\mp.cs" />
|
||||
<Compile Include="Misc\Command.cs" />
|
||||
<Compile Include="Native\Native.cs" />
|
||||
<Compile Include="Native\NativeHelp.cs" />
|
||||
<Compile Include="Misc\Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TaskDialog.cs" />
|
||||
<Compile Include="Windows\EverythingWindow.xaml.cs">
|
||||
<Compile Include="Native\TaskDialog.cs" />
|
||||
<Compile Include="WPF\EverythingWindow.xaml.cs">
|
||||
<DependentUpon>EverythingWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\CommandPaletteWindow.xaml.cs">
|
||||
<Compile Include="WPF\CommandPaletteWindow.xaml.cs">
|
||||
<DependentUpon>CommandPaletteWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\ConfWindow.xaml.cs">
|
||||
<Compile Include="WPF\ConfWindow.xaml.cs">
|
||||
<DependentUpon>ConfWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\AboutWindow.xaml.cs">
|
||||
<Compile Include="WPF\AboutWindow.xaml.cs">
|
||||
<DependentUpon>AboutWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\LearnWindow.xaml.cs">
|
||||
<Compile Include="WPF\LearnWindow.xaml.cs">
|
||||
<DependentUpon>LearnWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\InputWindow.xaml.cs">
|
||||
<Compile Include="WPF\InputWindow.xaml.cs">
|
||||
<DependentUpon>InputWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="trash.cs" />
|
||||
<Compile Include="WPF\WPF.cs" />
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<EmbeddedResource Include="WinForms\MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
@@ -224,8 +223,17 @@
|
||||
<SubType>Designer</SubType>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="..\Changelog.md">
|
||||
<Link>Changelog.md</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Manual.md">
|
||||
<Link>Manual.md</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\README.md">
|
||||
<Link>README.md</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="app.manifest" />
|
||||
<None Include="packages.config" />
|
||||
@@ -245,6 +253,7 @@
|
||||
<Content Include="mpvnet.ico" />
|
||||
<Content Include="Resources\mpvConf.txt" />
|
||||
<Content Include="Resources\mpvConfToml.txt" />
|
||||
<None Include="Resources\mpvnet.png" />
|
||||
<Content Include="Resources\mpvNetConfToml.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -263,19 +272,20 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Windows\ConfWindow.xaml">
|
||||
<Page Include="WPF\ConfWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Windows\LearnWindow.xaml">
|
||||
<Page Include="WPF\LearnWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Windows\InputWindow.xaml">
|
||||
<Page Include="WPF\InputWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -50,9 +52,10 @@ namespace mpvnet
|
||||
public static event Action QueueOverflow; // MPV_EVENT_QUEUE_OVERFLOW
|
||||
public static event Action Hook; // MPV_EVENT_HOOK
|
||||
|
||||
public static IntPtr MpvHandle { get; set; }
|
||||
public static IntPtr MpvWindowHandle { get; set; }
|
||||
public static IntPtr Handle { get; set; }
|
||||
public static IntPtr WindowHandle { get; set; }
|
||||
public static Addon Addon { get; set; }
|
||||
public static bool IsLogoVisible { set; get; }
|
||||
public static List<KeyValuePair<string, Action<bool>>> BoolPropChangeActions { get; set; } = new List<KeyValuePair<string, Action<bool>>>();
|
||||
public static List<KeyValuePair<string, Action<int>>> IntPropChangeActions { get; set; } = new List<KeyValuePair<string, Action<int>>>();
|
||||
public static List<KeyValuePair<string, Action<string>>> StringPropChangeActions { get; set; } = new List<KeyValuePair<string, Action<string>>>();
|
||||
@@ -62,15 +65,22 @@ namespace mpvnet
|
||||
public static List<MediaTrack> MediaTracks { get; set; } = new List<MediaTrack>();
|
||||
public static List<KeyValuePair<string, double>> Chapters { get; set; } = new List<KeyValuePair<string, double>>();
|
||||
|
||||
public static string InputConfPath { get; } = MpvConfFolder + "\\input.conf";
|
||||
public static string MpvConfPath { get; } = MpvConfFolder + "\\mpv.conf";
|
||||
public static string MpvNetConfPath { get; } = MpvConfFolder + "\\mpvnet.conf";
|
||||
public static string InputConfPath { get; } = ConfFolder + "\\input.conf";
|
||||
public static string ConfPath { get; } = ConfFolder + "\\mpv.conf";
|
||||
|
||||
static string _MpvConfFolder;
|
||||
public static bool Fullscreen { get; set; }
|
||||
public static float Autofit { get; set; } = 0.50f;
|
||||
public static int Screen { get; set; } = -1;
|
||||
public static string Sid { get; set; } = "";
|
||||
public static string Aid { get; set; } = "";
|
||||
public static string Vid { get; set; } = "";
|
||||
public static int Edition { get; set; }
|
||||
|
||||
public static string MpvConfFolder {
|
||||
static string _ConfFolder;
|
||||
|
||||
public static string ConfFolder {
|
||||
get {
|
||||
if (_MpvConfFolder == null)
|
||||
if (_ConfFolder == null)
|
||||
{
|
||||
string portableFolder = Application.StartupPath + "\\portable_config\\";
|
||||
string appdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\";
|
||||
@@ -88,75 +98,62 @@ namespace mpvnet
|
||||
td.AddCommandLink("portable", portableFolder, portableFolder);
|
||||
td.AddCommandLink("startup", startupFolder, startupFolder);
|
||||
td.AllowCancel = false;
|
||||
_MpvConfFolder = td.Show();
|
||||
_ConfFolder = td.Show();
|
||||
}
|
||||
}
|
||||
else if (Directory.Exists(portableFolder))
|
||||
_MpvConfFolder = portableFolder;
|
||||
_ConfFolder = portableFolder;
|
||||
else if (Directory.Exists(appdataFolder))
|
||||
_MpvConfFolder = appdataFolder;
|
||||
_ConfFolder = appdataFolder;
|
||||
else if (File.Exists(Application.StartupPath + "\\mpv.conf"))
|
||||
_MpvConfFolder = Application.StartupPath + "\\";
|
||||
_ConfFolder = Application.StartupPath + "\\";
|
||||
|
||||
if (string.IsNullOrEmpty(_MpvConfFolder)) _MpvConfFolder = appdataFolder;
|
||||
if (!Directory.Exists(_MpvConfFolder)) Directory.CreateDirectory(_MpvConfFolder);
|
||||
if (string.IsNullOrEmpty(_ConfFolder)) _ConfFolder = appdataFolder;
|
||||
if (!Directory.Exists(_ConfFolder)) Directory.CreateDirectory(_ConfFolder);
|
||||
|
||||
if (!File.Exists(_MpvConfFolder + "\\input.conf"))
|
||||
File.WriteAllText(_MpvConfFolder + "\\input.conf", Properties.Resources.inputConf);
|
||||
if (!File.Exists(_ConfFolder + "\\input.conf"))
|
||||
File.WriteAllText(_ConfFolder + "\\input.conf", Properties.Resources.inputConf);
|
||||
|
||||
if (!File.Exists(_MpvConfFolder + "\\mpv.conf"))
|
||||
File.WriteAllText(_MpvConfFolder + "\\mpv.conf", Properties.Resources.mpvConf);
|
||||
if (!File.Exists(_ConfFolder + "\\mpv.conf"))
|
||||
File.WriteAllText(_ConfFolder + "\\mpv.conf", Properties.Resources.mpvConf);
|
||||
}
|
||||
return _MpvConfFolder;
|
||||
return _ConfFolder;
|
||||
}
|
||||
}
|
||||
|
||||
static Dictionary<string, string> _mpvConf;
|
||||
static Dictionary<string, string> _Conf;
|
||||
|
||||
public static Dictionary<string, string> mpvConf {
|
||||
public static Dictionary<string, string> Conf {
|
||||
get {
|
||||
if (_mpvConf == null)
|
||||
if (_Conf == null)
|
||||
{
|
||||
_mpvConf = new Dictionary<string, string>();
|
||||
_Conf = new Dictionary<string, string>();
|
||||
|
||||
if (File.Exists(MpvConfPath))
|
||||
foreach (var i in File.ReadAllLines(MpvConfPath))
|
||||
if (File.Exists(ConfPath))
|
||||
foreach (var i in File.ReadAllLines(ConfPath))
|
||||
if (i.Contains("=") && ! i.StartsWith("#"))
|
||||
_mpvConf[i.Substring(0, i.IndexOf("=")).Trim()] = i.Substring(i.IndexOf("=") + 1).Trim();
|
||||
_Conf[i.Substring(0, i.IndexOf("=")).Trim()] = i.Substring(i.IndexOf("=") + 1).Trim();
|
||||
|
||||
foreach (var i in Conf)
|
||||
ProcessProperty(i.Key, i.Value);
|
||||
}
|
||||
return _mpvConf;
|
||||
}
|
||||
}
|
||||
|
||||
static Dictionary<string, string> _mpvNetConf;
|
||||
|
||||
public static Dictionary<string, string> mpvNetConf {
|
||||
get {
|
||||
if (_mpvNetConf == null)
|
||||
{
|
||||
_mpvNetConf = new Dictionary<string, string>();
|
||||
|
||||
if (File.Exists(MpvNetConfPath))
|
||||
foreach (string i in File.ReadAllLines(MpvNetConfPath))
|
||||
if (i.Contains("=") && !i.StartsWith("#"))
|
||||
_mpvNetConf[i.Substring(0, i.IndexOf("=")).Trim()] = i.Substring(i.IndexOf("=") + 1).Trim();
|
||||
}
|
||||
return _mpvNetConf;
|
||||
return _Conf;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
string dummy = MpvConfFolder;
|
||||
string dummy = ConfFolder;
|
||||
LoadLibrary("mpv-1.dll");
|
||||
MpvHandle = mpv_create();
|
||||
Handle = mpv_create();
|
||||
set_property_string("input-default-bindings", "yes");
|
||||
set_property_string("osc", "yes");
|
||||
set_property_string("config", "yes");
|
||||
set_property_string("wid", MainForm.Hwnd.ToString());
|
||||
set_property_string("force-window", "yes");
|
||||
set_property_string("input-media-keys", "yes");
|
||||
mpv_initialize(MpvHandle);
|
||||
mpv_initialize(Handle);
|
||||
ShowLogo();
|
||||
ProcessCommandLine();
|
||||
Task.Run(() => { LoadScripts(); });
|
||||
Task.Run(() => { Addon = new Addon(); });
|
||||
@@ -180,8 +177,8 @@ namespace mpvnet
|
||||
if (Path.GetExtension(scriptPath) == ".ps1")
|
||||
PowerShellScript.Init(scriptPath);
|
||||
|
||||
if (Directory.Exists(mp.MpvConfFolder + "Scripts"))
|
||||
foreach (var scriptPath in Directory.GetFiles(mp.MpvConfFolder + "Scripts"))
|
||||
if (Directory.Exists(mp.ConfFolder + "Scripts"))
|
||||
foreach (var scriptPath in Directory.GetFiles(mp.ConfFolder + "Scripts"))
|
||||
if (Path.GetExtension(scriptPath) == ".py")
|
||||
PythonScripts.Add(new PythonScript(File.ReadAllText(scriptPath)));
|
||||
else if (Path.GetExtension(scriptPath) == ".ps1")
|
||||
@@ -192,11 +189,14 @@ namespace mpvnet
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
IntPtr ptr = mpv_wait_event(MpvHandle, -1);
|
||||
IntPtr ptr = mpv_wait_event(Handle, -1);
|
||||
mpv_event evt = (mpv_event)Marshal.PtrToStructure(ptr, typeof(mpv_event));
|
||||
|
||||
if (MpvWindowHandle == IntPtr.Zero)
|
||||
MpvWindowHandle = FindWindowEx(MainForm.Hwnd, IntPtr.Zero, "mpv", null);
|
||||
if (WindowHandle == IntPtr.Zero)
|
||||
{
|
||||
WindowHandle = FindWindowEx(MainForm.Hwnd, IntPtr.Zero, "mpv", null);
|
||||
//Native.EnableWindow(WindowHandle, true);
|
||||
}
|
||||
|
||||
//Debug.WriteLine(evt.event_id.ToString());
|
||||
|
||||
@@ -226,11 +226,12 @@ namespace mpvnet
|
||||
break;
|
||||
case mpv_event_id.MPV_EVENT_END_FILE:
|
||||
var end_fileData = (mpv_event_end_file)Marshal.PtrToStructure(evt.data, typeof(mpv_event_end_file));
|
||||
EndFile?.Invoke((EndFileEventMode)end_fileData.reason);
|
||||
EndFileEventMode reason = (EndFileEventMode)end_fileData.reason;
|
||||
EndFile?.Invoke(reason);
|
||||
break;
|
||||
case mpv_event_id.MPV_EVENT_FILE_LOADED:
|
||||
HideLogo();
|
||||
FileLoaded?.Invoke();
|
||||
LoadFolder();
|
||||
WriteHistory(mp.get_property_string("path"));
|
||||
break;
|
||||
case mpv_event_id.MPV_EVENT_TRACKS_CHANGED:
|
||||
@@ -241,6 +242,8 @@ namespace mpvnet
|
||||
break;
|
||||
case mpv_event_id.MPV_EVENT_IDLE:
|
||||
Idle?.Invoke();
|
||||
if (mp.get_property_int("playlist-count") == 0)
|
||||
ShowLogo();
|
||||
break;
|
||||
case mpv_event_id.MPV_EVENT_PAUSE:
|
||||
Pause?.Invoke();
|
||||
@@ -343,6 +346,15 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
static void HideLogo()
|
||||
{
|
||||
if (IsLogoVisible)
|
||||
{
|
||||
mp.commandv("overlay-remove", "0");
|
||||
IsLogoVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
static List<PythonEventObject> PythonEventObjects = new List<PythonEventObject>();
|
||||
|
||||
public static void register_event(string name, IronPython.Runtime.PythonFunction pyFunc)
|
||||
@@ -389,11 +401,11 @@ namespace mpvnet
|
||||
|
||||
public static void commandv(params string[] args)
|
||||
{
|
||||
if (MpvHandle == IntPtr.Zero)
|
||||
if (Handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
IntPtr mainPtr = AllocateUtf8IntPtrArrayWithSentinel(args, out IntPtr[] byteArrayPointers);
|
||||
int err = mpv_command(MpvHandle, mainPtr);
|
||||
int err = mpv_command(Handle, mainPtr);
|
||||
|
||||
if (err < 0)
|
||||
throw new Exception($"{(mpv_error)err}");
|
||||
@@ -406,10 +418,10 @@ namespace mpvnet
|
||||
|
||||
public static void command_string(string command, bool throwException = false)
|
||||
{
|
||||
if (MpvHandle == IntPtr.Zero)
|
||||
if (Handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
int err = mpv_command_string(MpvHandle, command);
|
||||
int err = mpv_command_string(Handle, command);
|
||||
|
||||
if (err < 0 && throwException)
|
||||
throw new Exception($"{(mpv_error)err}\r\n\r\n" + command);
|
||||
@@ -418,7 +430,7 @@ namespace mpvnet
|
||||
public static void set_property_string(string name, string value, bool throwOnException = false)
|
||||
{
|
||||
byte[] bytes = GetUtf8Bytes(value);
|
||||
int err = mpv_set_property(MpvHandle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_STRING, ref bytes);
|
||||
int err = mpv_set_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_STRING, ref bytes);
|
||||
|
||||
if (err < 0 && throwOnException)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -428,7 +440,7 @@ namespace mpvnet
|
||||
{
|
||||
try
|
||||
{
|
||||
int err = mpv_get_property(MpvHandle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_STRING, out IntPtr lpBuffer);
|
||||
int err = mpv_get_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_STRING, out IntPtr lpBuffer);
|
||||
|
||||
if (err < 0 && throwOnException)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -447,7 +459,7 @@ namespace mpvnet
|
||||
|
||||
public static int get_property_int(string name, bool throwOnException = false)
|
||||
{
|
||||
int err = mpv_get_property(MpvHandle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_INT64, out IntPtr lpBuffer);
|
||||
int err = mpv_get_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_INT64, out IntPtr lpBuffer);
|
||||
|
||||
if (err < 0 && throwOnException)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -458,7 +470,7 @@ namespace mpvnet
|
||||
public static double get_property_number(string name, bool throwOnException = false)
|
||||
{
|
||||
double val = 0;
|
||||
int err = mpv_get_property(MpvHandle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_DOUBLE, ref val);
|
||||
int err = mpv_get_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_DOUBLE, ref val);
|
||||
|
||||
if (err < 0 && throwOnException)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -468,7 +480,7 @@ namespace mpvnet
|
||||
|
||||
public static bool get_property_bool(string name, bool throwOnException = false)
|
||||
{
|
||||
int err = mpv_get_property(MpvHandle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_FLAG, out IntPtr lpBuffer);
|
||||
int err = mpv_get_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_FLAG, out IntPtr lpBuffer);
|
||||
|
||||
if (err < 0 && throwOnException)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -479,7 +491,7 @@ namespace mpvnet
|
||||
public static void set_property_int(string name, int value, bool throwOnException = false)
|
||||
{
|
||||
Int64 val = value;
|
||||
int err = mpv_set_property(MpvHandle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_INT64, ref val);
|
||||
int err = mpv_set_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_INT64, ref val);
|
||||
|
||||
if (err < 0 && throwOnException)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -487,7 +499,7 @@ namespace mpvnet
|
||||
|
||||
public static void observe_property_int(string name, Action<int> action)
|
||||
{
|
||||
int err = mpv_observe_property(MpvHandle, (ulong)action.GetHashCode(), name, mpv_format.MPV_FORMAT_INT64);
|
||||
int err = mpv_observe_property(Handle, (ulong)action.GetHashCode(), name, mpv_format.MPV_FORMAT_INT64);
|
||||
|
||||
if (err < 0)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -497,7 +509,7 @@ namespace mpvnet
|
||||
|
||||
public static void observe_property_bool(string name, Action<bool> action)
|
||||
{
|
||||
int err = mpv_observe_property(MpvHandle, (ulong)action.GetHashCode(), name, mpv_format.MPV_FORMAT_FLAG);
|
||||
int err = mpv_observe_property(Handle, (ulong)action.GetHashCode(), name, mpv_format.MPV_FORMAT_FLAG);
|
||||
|
||||
if (err < 0)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -507,7 +519,7 @@ namespace mpvnet
|
||||
|
||||
public static void observe_property_string(string name, Action<string> action)
|
||||
{
|
||||
int err = mpv_observe_property(MpvHandle, (ulong)action.GetHashCode(), name, mpv_format.MPV_FORMAT_STRING);
|
||||
int err = mpv_observe_property(Handle, (ulong)action.GetHashCode(), name, mpv_format.MPV_FORMAT_STRING);
|
||||
|
||||
if (err < 0)
|
||||
throw new Exception($"{name}: {(mpv_error)err}");
|
||||
@@ -518,12 +530,19 @@ namespace mpvnet
|
||||
protected static void ProcessCommandLine()
|
||||
{
|
||||
var args = Environment.GetCommandLineArgs().Skip(1);
|
||||
List<string> files = new List<string>();
|
||||
|
||||
foreach (string i in args)
|
||||
if (!i.StartsWith("--") && File.Exists(i))
|
||||
mp.commandv("loadfile", i, "append");
|
||||
{
|
||||
if (!i.StartsWith("--") && (File.Exists(i) || i == "-" || i.StartsWith("http")))
|
||||
{
|
||||
files.Add(i);
|
||||
if (i.StartsWith("http"))
|
||||
RegistryHelp.SetObject(App.RegPath, "LastURL", i);
|
||||
}
|
||||
}
|
||||
|
||||
mp.set_property_string("playlist-pos", "0");
|
||||
mp.Load(files.ToArray());
|
||||
|
||||
foreach (string i in args)
|
||||
{
|
||||
@@ -541,44 +560,38 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadFiles(params string[] files)
|
||||
public static void Load(params string[] files)
|
||||
{
|
||||
int count = mp.get_property_int("playlist-count");
|
||||
if (files is null || files.Length == 0) return;
|
||||
HideLogo();
|
||||
|
||||
foreach (string file in files)
|
||||
mp.commandv("loadfile", file, "append");
|
||||
for (int i = 0; i < files.Length; i++)
|
||||
if (App.SubtitleTypes.Contains(Path.GetExtension(files[i]).TrimStart('.').ToLower()))
|
||||
mp.commandv("sub-add", files[i]);
|
||||
else
|
||||
if (i == 0)
|
||||
mp.commandv("loadfile", files[i]);
|
||||
else
|
||||
mp.commandv("loadfile", files[i], "append");
|
||||
|
||||
mp.set_property_int("playlist-pos", count);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
mp.commandv("playlist-remove", "0");
|
||||
|
||||
mp.LoadFolder();
|
||||
Task.Run(() => LoadFolder()); // user reported race condition
|
||||
}
|
||||
|
||||
static bool WasFolderLoaded;
|
||||
|
||||
static void LoadFolder()
|
||||
{
|
||||
if (WasFolderLoaded) return;
|
||||
|
||||
if (get_property_int("playlist-count") == 1)
|
||||
{
|
||||
string path = get_property_string("path");
|
||||
if (!File.Exists(path)) return;
|
||||
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
|
||||
files = files.Where((file) => App.VideoTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower()) ||
|
||||
App.AudioTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower())).ToList();
|
||||
files.Sort(new StringLogicalComparer());
|
||||
int index = files.IndexOf(path);
|
||||
files.Remove(path);
|
||||
foreach (string i in files)
|
||||
commandv("loadfile", i, "append");
|
||||
if (index > 0)
|
||||
commandv("playlist-move", "0", (index + 1).ToString());
|
||||
}
|
||||
|
||||
WasFolderLoaded = true;
|
||||
Thread.Sleep(50); // user reported race condition
|
||||
string path = mp.get_property_string("path");
|
||||
if (!File.Exists(path) || get_property_int("playlist-count") != 1) return;
|
||||
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
|
||||
files = files.Where((file) =>
|
||||
App.VideoTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower()) ||
|
||||
App.AudioTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower())).ToList();
|
||||
files.Sort(new StringLogicalComparer());
|
||||
int index = files.IndexOf(path);
|
||||
files.Remove(path);
|
||||
foreach (string i in files)
|
||||
commandv("loadfile", i, "append");
|
||||
if (index > 0) commandv("playlist-move", "0", (index + 1).ToString());
|
||||
}
|
||||
|
||||
static IntPtr AllocateUtf8IntPtrArrayWithSentinel(string[] arr, out IntPtr[] byteArrayPointers)
|
||||
@@ -631,7 +644,7 @@ namespace mpvnet
|
||||
|
||||
if (File.Exists(LastHistoryPath) && totalMinutes > 1)
|
||||
{
|
||||
string historyFilepath = mp.MpvConfFolder + "history.txt";
|
||||
string historyFilepath = mp.ConfFolder + "history.txt";
|
||||
|
||||
File.AppendAllText(historyFilepath, DateTime.Now.ToString().Substring(0, 16) +
|
||||
" " + totalMinutes.ToString().PadLeft(3) + " " +
|
||||
@@ -642,6 +655,48 @@ namespace mpvnet
|
||||
LastHistoryStartDateTime = DateTime.Now;
|
||||
}
|
||||
|
||||
public static void ShowLogo()
|
||||
{
|
||||
if (MainForm.Instance is null) return;
|
||||
Rectangle cr = MainForm.Instance.ClientRectangle;
|
||||
if (cr.Width == 0 || cr.Height == 0) return;
|
||||
|
||||
using (Bitmap b = new Bitmap(cr.Width, cr.Height))
|
||||
{
|
||||
using (Graphics g = Graphics.FromImage(b))
|
||||
{
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.Clear(Color.Black);
|
||||
int iconWidth = cr.Height / 7;
|
||||
Rectangle r = new Rectangle(cr.Width / 2 - iconWidth / 2, cr.Height / 2 - iconWidth / 2, iconWidth, iconWidth);
|
||||
g.DrawImage(Properties.Resources.mpvnet, r);
|
||||
BitmapData bd = b.LockBits(cr, ImageLockMode.ReadOnly, PixelFormat.Format32bppPArgb);
|
||||
mp.commandv("overlay-add", "0", "0", "0", "&" + bd.Scan0.ToInt64().ToString(), "0", "bgra", bd.Width.ToString(), bd.Height.ToString(), bd.Stride.ToString());
|
||||
b.UnlockBits(bd);
|
||||
IsLogoVisible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ProcessProperty(string name, string value)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "autofit":
|
||||
if (value.Length == 3 && value.EndsWith("%"))
|
||||
if (int.TryParse(value.Substring(0, 2), out int result))
|
||||
mp.Autofit = result / 100f;
|
||||
break;
|
||||
case "fs":
|
||||
case "fullscreen":
|
||||
mp.Fullscreen = value == "yes";
|
||||
break;
|
||||
case "screen":
|
||||
mp.Screen = Convert.ToInt32(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void ReadMetaData()
|
||||
{
|
||||
lock (MediaTracks)
|
||||
@@ -1,22 +0,0 @@
|
||||
//public static string GetAssociatedApplication(string ext)
|
||||
//{
|
||||
// uint returnValue = 0U;
|
||||
// // ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE
|
||||
// if (1 == Native.AssocQueryString(0x40, 2, ext, null, null, ref returnValue))
|
||||
// {
|
||||
// if (returnValue > 0)
|
||||
// {
|
||||
// StringBuilder sb = new StringBuilder(Convert.ToInt32(returnValue));
|
||||
// // ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE
|
||||
// if (0 == Native.AssocQueryString(0x40, 2, ext, null, sb, ref returnValue))
|
||||
// {
|
||||
// var ret = sb.ToString();
|
||||
// if (File.Exists(ret)) return ret;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return "";
|
||||
//}
|
||||
|
||||
//[DllImport("Shlwapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
//public static extern uint AssocQueryString(uint flags, uint str, string pszAssoc, string pszExtra, StringBuilder pszOut, ref uint pcchOut);
|
||||
53
setup.ps1
@@ -1,3 +1,4 @@
|
||||
# exit the script if the exit code is greater than 0
|
||||
function CheckExitCode {
|
||||
if ($LastExitCode -gt 0) {
|
||||
Write-Host "`nExit code $LastExitCode was returned.`n" -ForegroundColor Red
|
||||
@@ -5,47 +6,43 @@ function CheckExitCode {
|
||||
}
|
||||
}
|
||||
|
||||
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
|
||||
# exit the script if the file don't exist
|
||||
function CheckFileExist($path) {
|
||||
if (![IO.File]::Exists($path)) {
|
||||
Write-Host "`nFile is missing:`n`n$path`n" -ForegroundColor Red
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x64
|
||||
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
|
||||
$innoSetup = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
|
||||
$sevenZip = "C:\Program Files\7-Zip\7z.exe"
|
||||
|
||||
CheckExitCode
|
||||
# exit the script if one of the executables don't exist
|
||||
CheckFileExist($msbuild); CheckFileExist($innoSetup); CheckFileExist($sevenZip);
|
||||
|
||||
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x86
|
||||
# build the projects using msbuild
|
||||
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x64; CheckExitCode
|
||||
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x86; CheckExitCode
|
||||
|
||||
CheckExitCode
|
||||
|
||||
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /Darch="x64" setup.iss
|
||||
|
||||
CheckExitCode
|
||||
|
||||
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /Darch="x86" setup.iss
|
||||
|
||||
CheckExitCode
|
||||
# build the setups using inno setup
|
||||
& $innoSetup /Darch="x64" setup.iss; CheckExitCode
|
||||
& $innoSetup /Darch="x86" setup.iss; CheckExitCode
|
||||
|
||||
# create the x64 portable archives using 7zip
|
||||
$scriptDir = Split-Path -Path $PSCommandPath -Parent
|
||||
$desktopDir = [Environment]::GetFolderPath("Desktop")
|
||||
|
||||
$exePath = $scriptDir + "\mpv.net\bin\x64\mpvnet.exe"
|
||||
$version = [Diagnostics.FileVersionInfo]::GetVersionInfo($exePath).FileVersion
|
||||
$targetDir = $desktopDir + "\mpv.net-portable-x64-" + $version
|
||||
Copy-Item $scriptDir\mpv.net\bin\x64 $targetDir -Recurse -Exclude System.Management.Automation.xml -Force
|
||||
& "C:\Program Files\7-Zip\7z.exe" a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"
|
||||
|
||||
CheckExitCode
|
||||
|
||||
& "C:\Program Files\7-Zip\7z.exe" a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*"
|
||||
|
||||
CheckExitCode
|
||||
& $sevenZip a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"; CheckExitCode
|
||||
& $sevenZip a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*"; CheckExitCode
|
||||
|
||||
# create the x86 portable archives using 7zip
|
||||
$exePath = $scriptDir + "\mpv.net\bin\x86\mpvnet.exe"
|
||||
$version = [Diagnostics.FileVersionInfo]::GetVersionInfo($exePath).FileVersion
|
||||
$targetDir = $desktopDir + "\mpv.net-portable-x86-" + $version
|
||||
Copy-Item $scriptDir\mpv.net\bin\x86 $targetDir -Recurse -Exclude System.Management.Automation.xml -Force
|
||||
& "C:\Program Files\7-Zip\7z.exe" a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"
|
||||
|
||||
CheckExitCode
|
||||
|
||||
& "C:\Program Files\7-Zip\7z.exe" a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*"
|
||||
|
||||
CheckExitCode
|
||||
& $sevenZip a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"; CheckExitCode
|
||||
& $sevenZip a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*"; CheckExitCode
|
||||