Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad4199aff0 | ||
|
|
3164e2322c | ||
|
|
a6d4570b81 | ||
|
|
4fc9c61ecf | ||
|
|
5a969aac7d | ||
|
|
1b9229d4d9 | ||
|
|
225979d220 | ||
|
|
0c3a03181a | ||
|
|
867a83f15a | ||
|
|
1d78d4e4e2 | ||
|
|
23bef4d971 | ||
|
|
9b95b87177 | ||
|
|
aa8ae225c5 | ||
|
|
1bb05c4d99 | ||
|
|
619fcef63f | ||
|
|
9170e55d81 | ||
|
|
dc1240f606 | ||
|
|
cb11279091 | ||
|
|
fd956d401f | ||
|
|
6ea8a67390 | ||
|
|
6d02203727 | ||
|
|
0d396947c1 | ||
|
|
6c85ea9625 | ||
|
|
2d9a67c502 | ||
|
|
d9000a570b |
@@ -11,18 +11,24 @@ Public Class CSScriptAddon
|
|||||||
Implements IAddon
|
Implements IAddon
|
||||||
|
|
||||||
Sub New()
|
Sub New()
|
||||||
Dim scriptDir = mp.MpvConfFolder + "scripts"
|
Dim scriptFiles As New List(Of String)
|
||||||
If Not Directory.Exists(scriptDir) Then Return
|
|
||||||
Dim csFiles = Directory.GetFiles(scriptDir, "*.cs").ToList
|
If Directory.Exists(mp.MpvConfFolder + "scripts") Then
|
||||||
csFiles.AddRange(Directory.GetFiles(Application.StartupPath + "\\Scripts", "*.cs"))
|
scriptFiles.AddRange(Directory.GetFiles(mp.MpvConfFolder + "scripts", "*.cs"))
|
||||||
If csFiles.Count = 0 Then Return
|
End If
|
||||||
|
|
||||||
|
If Directory.Exists(Application.StartupPath + "\scripts") Then
|
||||||
|
scriptFiles.AddRange(Directory.GetFiles(Application.StartupPath + "\scripts", "*.cs"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
If scriptFiles.Count = 0 Then Return
|
||||||
CSScriptLibrary.CSScript.EvaluatorConfig.Engine = EvaluatorEngine.CodeDom
|
CSScriptLibrary.CSScript.EvaluatorConfig.Engine = EvaluatorEngine.CodeDom
|
||||||
|
|
||||||
For Each i In csFiles
|
For Each i In scriptFiles
|
||||||
Try
|
Try
|
||||||
CSScriptLibrary.CSScript.Evaluator.LoadCode(File.ReadAllText(i))
|
CSScriptLibrary.CSScript.Evaluator.LoadCode(File.ReadAllText(i))
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MainForm.Instance.ShowMsgBox(ex.ToString(), MessageBoxIcon.Error)
|
Sys.Msg.ShowException(ex)
|
||||||
End Try
|
End Try
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -47,6 +47,48 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OptionInfer>On</OptionInfer>
|
<OptionInfer>On</OptionInfer>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DefineDebug>true</DefineDebug>
|
||||||
|
<DefineTrace>true</DefineTrace>
|
||||||
|
<OutputPath>..\mpv.net\bin\x86\Addons\CSScriptAddon\</OutputPath>
|
||||||
|
<NoWarn>42105,42106,42107,42353,42354,42355</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<DefineTrace>true</DefineTrace>
|
||||||
|
<OutputPath>..\mpv.net\bin\x86\Addons\CSScriptAddon\</OutputPath>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>42105,42106,42107,42353,42354,42355</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DefineDebug>true</DefineDebug>
|
||||||
|
<DefineTrace>true</DefineTrace>
|
||||||
|
<OutputPath>..\mpv.net\bin\x64\Addons\CSScriptAddon\</OutputPath>
|
||||||
|
<NoWarn>42105,42106,42107,42353,42354,42355</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<DefineTrace>true</DefineTrace>
|
||||||
|
<OutputPath>..\mpv.net\bin\x64\Addons\CSScriptAddon\</OutputPath>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>42105,42106,42107,42353,42354,42355</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="CSScriptLibrary, Version=3.27.5.0, Culture=neutral, PublicKeyToken=70fcc3d18c749033, processorArchitecture=MSIL">
|
<Reference Include="CSScriptLibrary, Version=3.27.5.0, Culture=neutral, PublicKeyToken=70fcc3d18c749033, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
|||||||
140
README.md
@@ -8,23 +8,23 @@ mpv.net is based on libmpv which offers a straightforward C API that was designe
|
|||||||
|
|
||||||
#### CLI options
|
#### CLI options
|
||||||
|
|
||||||
mpv.net has a basic CLI parser to support mpv's [CLI options](https://mpv.io/manual/master/#options).
|
mpv.net has the same [CLI options](https://mpv.io/manual/master/#options) as mpv.
|
||||||
|
|
||||||
#### High quality video output
|
#### High quality video output
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
#### On Screen Controller
|
#### On Screen Controller
|
||||||
|
|
||||||
mpv.net uses mpv's OSC offering play controls with a modern flat design.
|
mpv.net uses the OSC of mpv/libmpv offering play controls with a modern flat design.
|
||||||
|
|
||||||
#### GPU video decoding
|
#### GPU video decoding
|
||||||
|
|
||||||
libmpv leverages the FFmpeg hwaccel APIs to support DXVA2 video decoding acceleration.
|
mpv/libmpv leverages the FFmpeg hwaccel APIs to support DXVA2 video decoding acceleration.
|
||||||
|
|
||||||
#### Active development
|
#### Active development
|
||||||
|
|
||||||
mpv.net is under active development, focusing on user feedback. Want a feature? Post a [patch](https://github.com/stax76/mpv.net/pulls) or [request it](https://github.com/stax76/mpv.net/issues)!
|
mpv.net is under active development. Want a feature? Post a [patch](https://github.com/stax76/mpv.net/pulls) or [request it](https://github.com/stax76/mpv.net/issues)!
|
||||||
|
|
||||||
Table of contents
|
Table of contents
|
||||||
-----------------
|
-----------------
|
||||||
@@ -50,45 +50,50 @@ Table of contents
|
|||||||
- Modern UI with dark mode ([Screenshot](#config-editor))
|
- Modern UI with dark mode ([Screenshot](#config-editor))
|
||||||
- Addon/extension API for .NET languages
|
- Addon/extension API for .NET languages
|
||||||
- Scripting API for Python, C#, Lua, JavaScript and PowerShell ([wiki](https://github.com/stax76/mpv.net/wiki/Scripting))
|
- Scripting API for Python, C#, Lua, JavaScript and PowerShell ([wiki](https://github.com/stax76/mpv.net/wiki/Scripting))
|
||||||
- mpv's OSC, CLI, IPC and conf files
|
- mpv's OSC, IPC and conf files
|
||||||
|
- Support of the same [CLI options](https://mpv.io/manual/master/#options) as mpv
|
||||||
|
- 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
|
||||||
|
|
||||||
### Screenshots
|
### Screenshots
|
||||||
|
|
||||||
#### Main Window
|
#### Main Window Screenshot
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Context Menu
|
#### Context Menu Screenshot
|
||||||
|
|
||||||
Context menu defined in the input.conf file with dark mode support.
|
Context menu defined in the input.conf file with dark mode support.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Config Editor
|
#### Config Editor Screenshot
|
||||||
|
|
||||||
A searchable config editor as alternative to edit the mpv.conf file manually.
|
A searchable config editor as alternative to edit the mpv.conf file manually.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Input Editor
|
#### Input Editor Screenshot
|
||||||
|
|
||||||
A searchable key and mouse binding editor.
|
A searchable key and mouse binding editor.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Command Palette
|
#### Command Palette Screenshot
|
||||||
|
|
||||||
Forgot where a command in the menu is located or what shortcut key it has?
|
Forgot where a command in the menu is located or what shortcut key it has?
|
||||||
Just press Ctrl+Shift+P and find it easily in the searchable command palette.
|
Just press Ctrl+Shift+P and find it easily in the searchable command palette.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Context Menu
|
### Context Menu
|
||||||
|
|
||||||
The context menu can be customized via input.conf file located at:
|
The context menu can be customized via input.conf file located in the config directory:
|
||||||
```
|
|
||||||
|
```Text
|
||||||
C:\Users\%username%\AppData\Roaming\mpv\input.conf
|
C:\Users\%username%\AppData\Roaming\mpv\input.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
if it's missing mpv.net generates it with the following defaults:
|
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>
|
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt>
|
||||||
@@ -97,17 +102,21 @@ input.conf defines mpv's key and mouse bindings and mpv.net uses comments to def
|
|||||||
|
|
||||||
### Settings
|
### Settings
|
||||||
|
|
||||||
mpv.net shares the settings with mpv, settings can be edited in a settings dialog or in a config file called mpv.conf located at:
|
mpv.net shares the settings with mpv, settings can be edited in a settings dialog or in a config file called mpv.conf located in the config directory:
|
||||||
```
|
|
||||||
|
```Text
|
||||||
C:\Users\%username%\AppData\Roaming\mpv\mpv.conf
|
C:\Users\%username%\AppData\Roaming\mpv\mpv.conf
|
||||||
```
|
```
|
||||||
or alternativly at:
|
|
||||||
```
|
or in a portable setup at:
|
||||||
|
|
||||||
|
```Text
|
||||||
<startup>\portable_config\mpv.conf
|
<startup>\portable_config\mpv.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
if it's missing mpv.net generates it with the following defaults:
|
if it's missing mpv.net generates it with the following defaults:
|
||||||
|
|
||||||
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpv.conf.txt>
|
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt>
|
||||||
|
|
||||||
### Scripting
|
### Scripting
|
||||||
|
|
||||||
@@ -117,13 +126,11 @@ Scripting is supported via Python, C#, Lua, JavaScript and PowerShell
|
|||||||
|
|
||||||
### Add-ons
|
### Add-ons
|
||||||
|
|
||||||
Add-ons have to be located at:
|
Add-ons are located in the config directory:
|
||||||
|
|
||||||
C:\Users\\<user\>\AppData\Roaming\mpv\Addons\ExampleAddon\ExampleAddon.dll
|
```Text
|
||||||
|
C:\Users\%username%\AppData\Roaming\mpv\Addons\ExampleAddon\ExampleAddon.dll
|
||||||
\<startup\>\Addons\ExampleAddon\ExampleAddon.dll
|
```
|
||||||
|
|
||||||
\<startup\>\portable_config\Addons\ExampleAddon\ExampleAddon.dll
|
|
||||||
|
|
||||||
The add-on filename must end with 'Addon.dll'.
|
The add-on filename must end with 'Addon.dll'.
|
||||||
|
|
||||||
@@ -151,10 +158,10 @@ mpv.net was started 2017 and consists of about 9000 lines of code.
|
|||||||
|
|
||||||
Third party components are:
|
Third party components are:
|
||||||
|
|
||||||
- libmpv
|
- [libmpv](https://mpv.io/)
|
||||||
- MediaInfo
|
- [MediaInfo](https://mediaarea.net/en/MediaInfo)
|
||||||
- Tommy (TOML parser)
|
- [Tommy (TOML parser)](https://github.com/dezhidki/Tommy)
|
||||||
- IronPython
|
- [IronPython](https://ironpython.net/)
|
||||||
|
|
||||||
### Support
|
### Support
|
||||||
|
|
||||||
@@ -194,7 +201,25 @@ mpv.net bugs and requests: <https://github.com/stax76/mpv.net/issues>
|
|||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
### 3.2 (2019-0?-??)
|
### 3.4 (2019-05-03)
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
### 3.3 (2019-05-01)
|
||||||
|
|
||||||
|
- dark mode support was added to the command palette and partly to the input editor
|
||||||
|
- a new icon was designed. [Website](https://mpv-net.github.io/mpv.net-web-site/)
|
||||||
|
- all windows (main, conf, input, about, command palette) can now be closed
|
||||||
|
by just pressing the Escape key
|
||||||
|
- new feature added to open recent files and URLs with the context menu. [Default Binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L33)
|
||||||
|
- the info command (i key) now works also for URLs
|
||||||
|
- CSScriptAddon add-on didn't load cs scripts from \<startup\>\\scripts
|
||||||
|
- error handling was improved by showing an improved message box that supports a text copy feature, a support link and text heading and text folding
|
||||||
|
- libmpv was updated
|
||||||
|
|
||||||
|
### 3.2 (2019-04-27)
|
||||||
|
|
||||||
- mpvInputEdit and mpvConfEdit were discontinued and merged into
|
- mpvInputEdit and mpvConfEdit were discontinued and merged into
|
||||||
mpvnet because separate apps were to difficult to work with
|
mpvnet because separate apps were to difficult to work with
|
||||||
@@ -206,52 +231,9 @@ mpv.net bugs and requests: <https://github.com/stax76/mpv.net/issues>
|
|||||||
- MediaInfo and youtube-dl were updated
|
- MediaInfo and youtube-dl were updated
|
||||||
- a new JavaScript example script was added to the wiki and the
|
- a new JavaScript example script was added to the wiki and the
|
||||||
script descriptions were improved. [Scripting Page](https://github.com/stax76/mpv.net/wiki/Scripting).
|
script descriptions were improved. [Scripting Page](https://github.com/stax76/mpv.net/wiki/Scripting).
|
||||||
- greatly improved README.md file and github startpage
|
- greatly improved README.md file and [github startpage](https://github.com/stax76/mpv.net)
|
||||||
- About dialog added
|
- About dialog added
|
||||||
- the input editor shows only a closing message if actually a change was made
|
- the input editor shows only a closing message if actually a change was made
|
||||||
- the input editor don't show menu separators any longer
|
- the input editor don't show confusing menu separators any longer. [Screenshot](https://github.com/stax76/mpv.net#input-editor)
|
||||||
- new Command Palette feature added. [Screenshot](https://github.com/stax76/mpv.net#command-palette), [Default input binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L141)
|
- new Command Palette feature added. [Screenshot](https://github.com/stax76/mpv.net#command-palette), [Default input binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L141)
|
||||||
- the history feature had a bug causing files to be logged more than once
|
- the history feature had a bug causing files to be logged more than once
|
||||||
|
|
||||||
### 3.1 (2019-04-23)
|
|
||||||
|
|
||||||
- the Tracks and Chapters menu are now only added if default bindings exist and
|
|
||||||
it's now possible to move the chapters menu to the top level by editing input.conf
|
|
||||||
- mpvnet supports now like mpv a portable settings directory. If a directory named portable_config
|
|
||||||
next to the mpvnet.exe exists, all config will be loaded and written in this directory.
|
|
||||||
- there is now a portable download in 7zip format.
|
|
||||||
|
|
||||||
### 3.0 (2019-04-20)
|
|
||||||
|
|
||||||
- the history feature logs now only files that were opened longer than 90 seconds
|
|
||||||
- the default input command for cycling the audio tracks was replaced with an
|
|
||||||
mpv.net command that shows detailed track info and has no 'no audio' track. [Default binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L89).
|
|
||||||
- new website at <https://mpv-net.github.io/mpv.net-web-site/>
|
|
||||||
- the Tracks menu supports now MKV edition selection. [Default binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L106).
|
|
||||||
- the Navigate menu supports now chapter selection. [Default binding](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L57).
|
|
||||||
- opening the context menu was crashing if the default binding for Tracks was missing
|
|
||||||
|
|
||||||
### 2.9 (2019-04-16)
|
|
||||||
|
|
||||||
- clicking the right top corner in full screen mode
|
|
||||||
closes the player but it did not work on all displays
|
|
||||||
- the info display was changed to display the filename on top
|
|
||||||
so it's not displayed in the middle of the screen
|
|
||||||
- on start up of the config editor all text is now selected in the
|
|
||||||
search text box so it's ready for a new search to be typed
|
|
||||||
- the config editor was changed to write the settings to disk
|
|
||||||
only if the settings were actually modified, also the message
|
|
||||||
that says that the settings will be available on next start
|
|
||||||
is now only shown if the settings were actually modified.
|
|
||||||
- there was an instance in the context menu where the sub menu
|
|
||||||
arrow was overlapping with the text
|
|
||||||
- in the input editor when only one character is entered in the
|
|
||||||
search text box the search is performed only in the input and
|
|
||||||
not in the command or menu
|
|
||||||
- in the input editor the routine that generates the input string
|
|
||||||
was completely rewritten because it was adding Shift where it
|
|
||||||
wasn't necessary (it took a huge amount of time to implement)
|
|
||||||
- the context menu has a new track menu where the active track
|
|
||||||
can be seen and selected, it shows video, audio and subtitle
|
|
||||||
tracks with various metadata. [Menu default definition](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L104).
|
|
||||||
The screenshots were updated showing the [new track menu](https://github.com/stax76/mpv.net#screenshots).
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>..\mpv.net\bin\x86\Debug\</OutputPath>
|
<OutputPath>..\mpv.net\bin\x86\Addons\RatingAddon\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
<OutputPath>..\mpv.net\bin\x86\Release\</OutputPath>
|
<OutputPath>..\mpv.net\bin\x86\Addons\RatingAddon\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>..\mpv.net\bin\x64\Debug\</OutputPath>
|
<OutputPath>..\mpv.net\bin\x64\Addons\RatingAddon\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
<OutputPath>..\mpv.net\bin\x64\Release\</OutputPath>
|
<OutputPath>..\mpv.net\bin\x64\Addons\RatingAddon\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 238 KiB |
|
Before Width: | Height: | Size: 277 KiB After Width: | Height: | Size: 277 KiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.9 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
BIN
img/mpvnet.pdn
Normal file
BIN
img/mpvnet.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
30
mpv.net.sln
@@ -11,50 +11,36 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CSScriptAddon", "CSScriptAd
|
|||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
Debug|x86 = Debug|x86
|
Debug|x86 = Debug|x86
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
Release|x64 = Release|x64
|
Release|x64 = Release|x64
|
||||||
Release|x86 = Release|x86
|
Release|x86 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.ActiveCfg = Debug|x64
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.Build.0 = Debug|x64
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.Build.0 = Debug|x64
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.ActiveCfg = Debug|x86
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.Build.0 = Debug|x86
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.Build.0 = Debug|x86
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.ActiveCfg = Release|x64
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.ActiveCfg = Release|x64
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.Build.0 = Release|x64
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.Build.0 = Release|x64
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x86.ActiveCfg = Release|x86
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x86.ActiveCfg = Release|x86
|
||||||
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x86.Build.0 = Release|x86
|
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x86.Build.0 = Release|x86
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|x64.ActiveCfg = Debug|x64
|
{55C88710-539D-4402-84C8-31694841C731}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|x64.Build.0 = Debug|x64
|
{55C88710-539D-4402-84C8-31694841C731}.Debug|x64.Build.0 = Debug|x64
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|x86.ActiveCfg = Debug|x86
|
{55C88710-539D-4402-84C8-31694841C731}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Debug|x86.Build.0 = Debug|x86
|
{55C88710-539D-4402-84C8-31694841C731}.Debug|x86.Build.0 = Debug|x86
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Release|x64.ActiveCfg = Release|x64
|
{55C88710-539D-4402-84C8-31694841C731}.Release|x64.ActiveCfg = Release|x64
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Release|x64.Build.0 = Release|x64
|
{55C88710-539D-4402-84C8-31694841C731}.Release|x64.Build.0 = Release|x64
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Release|x86.ActiveCfg = Release|x86
|
{55C88710-539D-4402-84C8-31694841C731}.Release|x86.ActiveCfg = Release|x86
|
||||||
{55C88710-539D-4402-84C8-31694841C731}.Release|x86.Build.0 = Release|x86
|
{55C88710-539D-4402-84C8-31694841C731}.Release|x86.Build.0 = Release|x86
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x64.Build.0 = Debug|x64
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x64.ActiveCfg = Debug|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x64.Build.0 = Debug|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x86.Build.0 = Debug|x86
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x86.ActiveCfg = Debug|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x64.ActiveCfg = Release|x64
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Debug|x86.Build.0 = Debug|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x64.Build.0 = Release|x64
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x86.ActiveCfg = Release|x86
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|Any CPU.Build.0 = Release|Any CPU
|
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x86.Build.0 = Release|x86
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{71808A87-8B1C-4DF8-957C-D79C3B164CCA}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -46,14 +46,9 @@ namespace mpvnet
|
|||||||
public static void open_files(string[] args)
|
public static void open_files(string[] args)
|
||||||
{
|
{
|
||||||
MainForm.Instance.Invoke(new Action(() => {
|
MainForm.Instance.Invoke(new Action(() => {
|
||||||
using (var d = new OpenFileDialog())
|
using (var d = new OpenFileDialog() { Multiselect = true })
|
||||||
{
|
|
||||||
d.Multiselect = true;
|
|
||||||
d.Filter = Misc.GetFilter(Misc.FileTypes);
|
|
||||||
|
|
||||||
if (d.ShowDialog() == DialogResult.OK)
|
if (d.ShowDialog() == DialogResult.OK)
|
||||||
mp.LoadFiles(d.FileNames);
|
mp.LoadFiles(d.FileNames);
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,22 +111,26 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FileInfo fileInfo = new FileInfo(mp.get_property_string("path"));
|
string performer, title, album, genre, date, duration, text = "";
|
||||||
|
long fileSize = 0;
|
||||||
|
string path = mp.get_property_string("path");
|
||||||
|
int width = mp.get_property_int("video-params/w");
|
||||||
|
int height = mp.get_property_int("video-params/h");
|
||||||
|
|
||||||
using (MediaInfo mediaInfo = new MediaInfo(fileInfo.FullName))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
string width = mediaInfo.GetInfo(MediaInfoStreamKind.Video, "Width");
|
fileSize = new FileInfo(path).Length;
|
||||||
|
|
||||||
if (width == "")
|
if (App.AudioTypes.Contains(Path.GetExtension(path).ToLower().TrimStart('.')))
|
||||||
{
|
{
|
||||||
string performer = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Performer");
|
using (MediaInfo mediaInfo = new MediaInfo(path))
|
||||||
string title = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Title");
|
{
|
||||||
string album = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Album");
|
performer = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Performer");
|
||||||
string genre = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Genre");
|
title = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Title");
|
||||||
string date = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Recorded_Date");
|
album = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Album");
|
||||||
string duration = mediaInfo.GetInfo(MediaInfoStreamKind.Audio, "Duration/String");
|
genre = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Genre");
|
||||||
|
date = mediaInfo.GetInfo(MediaInfoStreamKind.General, "Recorded_Date");
|
||||||
string text = "";
|
duration = mediaInfo.GetInfo(MediaInfoStreamKind.Audio, "Duration/String");
|
||||||
|
|
||||||
if (performer != "") text += "Artist: " + performer + "\n";
|
if (performer != "") text += "Artist: " + performer + "\n";
|
||||||
if (title != "") text += "Title: " + title + "\n";
|
if (title != "") text += "Title: " + title + "\n";
|
||||||
@@ -141,37 +140,30 @@ namespace mpvnet
|
|||||||
if (duration != "") text += "Length: " + duration + "\n";
|
if (duration != "") text += "Length: " + duration + "\n";
|
||||||
|
|
||||||
mp.commandv("show-text", text, "5000");
|
mp.commandv("show-text", text, "5000");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
string height = mediaInfo.GetInfo(MediaInfoStreamKind.Video, "Height");
|
|
||||||
TimeSpan position = TimeSpan.FromSeconds(mp.get_property_number("time-pos"));
|
TimeSpan position = TimeSpan.FromSeconds(mp.get_property_number("time-pos"));
|
||||||
TimeSpan duration = TimeSpan.FromSeconds(mp.get_property_number("duration"));
|
TimeSpan duration2 = TimeSpan.FromSeconds(mp.get_property_number("duration"));
|
||||||
string bitrate = mediaInfo.GetInfo(MediaInfoStreamKind.Video, "BitRate");
|
|
||||||
|
|
||||||
if (bitrate == "")
|
|
||||||
bitrate = "0";
|
|
||||||
|
|
||||||
double bitrate2 = Convert.ToDouble(bitrate) / 1000.0 / 1000.0;
|
|
||||||
string videoCodec = mp.get_property_string("video-format").ToUpper();
|
string videoCodec = mp.get_property_string("video-format").ToUpper();
|
||||||
string filename = fileInfo.Name;
|
|
||||||
|
|
||||||
string text = filename + "\n" +
|
text = Path.GetFileName(path) + "\n" +
|
||||||
FormatTime(position.TotalMinutes) + ":" +
|
FormatTime(position.TotalMinutes) + ":" +
|
||||||
FormatTime(position.Seconds) + " / " +
|
FormatTime(position.Seconds) + " / " +
|
||||||
FormatTime(duration.TotalMinutes) + ":" +
|
FormatTime(duration2.TotalMinutes) + ":" +
|
||||||
FormatTime(duration.Seconds) + "\n" +
|
FormatTime(duration2.Seconds) + "\n" +
|
||||||
$"{width} x {height}\n" +
|
$"{width} x {height}\n";
|
||||||
$"{bitrate2.ToString("f1")} Mb/s\n" +
|
|
||||||
Convert.ToInt32(fileInfo.Length / 1024 / 1024).ToString() + " MB\n" +
|
if (fileSize > 0)
|
||||||
$"{videoCodec}\n";
|
text += Convert.ToInt32(fileSize / 1024.0 / 1024.0).ToString() + " MB\n";
|
||||||
|
|
||||||
|
text += $"{videoCodec}\n";
|
||||||
|
|
||||||
mp.commandv("show-text", text, "5000");
|
mp.commandv("show-text", text, "5000");
|
||||||
}
|
|
||||||
|
|
||||||
string FormatTime(double value) => ((int)value).ToString("00");
|
string FormatTime(double value) => ((int)value).ToString("00");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -180,8 +172,9 @@ namespace mpvnet
|
|||||||
public static void execute_mpv_command(string[] args)
|
public static void execute_mpv_command(string[] args)
|
||||||
{
|
{
|
||||||
MainForm.Instance.Invoke(new Action(() => {
|
MainForm.Instance.Invoke(new Action(() => {
|
||||||
string command = Microsoft.VisualBasic.Interaction.InputBox("Enter a mpv command to be executed.");
|
string command = Microsoft.VisualBasic.Interaction.InputBox("Enter a mpv command to be executed.", "Execute Command", RegistryHelp.GetString("HKCU\\Software\\" + Application.ProductName, "RecentExecutedCommand"));
|
||||||
if (string.IsNullOrEmpty(command)) return;
|
if (string.IsNullOrEmpty(command)) return;
|
||||||
|
RegistryHelp.SetObject("HKCU\\Software\\" + Application.ProductName, "RecentExecutedCommand", command);
|
||||||
mp.command_string(command, false);
|
mp.command_string(command, false);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -191,7 +184,7 @@ namespace mpvnet
|
|||||||
MainForm.Instance.Invoke(new Action(() => {
|
MainForm.Instance.Invoke(new Action(() => {
|
||||||
string command = Microsoft.VisualBasic.Interaction.InputBox("Enter URL to be opened.");
|
string command = Microsoft.VisualBasic.Interaction.InputBox("Enter URL to be opened.");
|
||||||
if (string.IsNullOrEmpty(command)) return;
|
if (string.IsNullOrEmpty(command)) return;
|
||||||
mp.LoadURL(command);
|
mp.LoadFiles(command);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,5 +234,35 @@ namespace mpvnet
|
|||||||
mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000");
|
mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void manage_file_associations(string[] args)
|
||||||
|
{
|
||||||
|
using (var td = new TaskDialog<string>())
|
||||||
|
{
|
||||||
|
td.MainInstruction = "Choose an option.";
|
||||||
|
td.MainIcon = MsgIcon.Shield;
|
||||||
|
|
||||||
|
td.AddCommandLink("Register video file extensions", "video");
|
||||||
|
td.AddCommandLink("Register audio file extensions", "audio");
|
||||||
|
td.AddCommandLink("Unregister file extensions", "unreg");
|
||||||
|
|
||||||
|
string result = td.Show();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(result))
|
||||||
|
{
|
||||||
|
using (var proc = new Process())
|
||||||
|
{
|
||||||
|
proc.StartInfo.FileName = Application.ExecutablePath;
|
||||||
|
proc.StartInfo.Arguments = "--reg-file-assoc " + result;
|
||||||
|
proc.StartInfo.Verb = "runas";
|
||||||
|
try {
|
||||||
|
proc.Start();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,7 @@ namespace mpvnet
|
|||||||
Point LastCursorPosChanged;
|
Point LastCursorPosChanged;
|
||||||
int LastCursorChangedTickCount;
|
int LastCursorChangedTickCount;
|
||||||
bool IgnoreDpiChanged = true;
|
bool IgnoreDpiChanged = true;
|
||||||
|
List<string> RecentFiles;
|
||||||
|
|
||||||
public string MpvNetDarkMode { get; set; } = "always";
|
public string MpvNetDarkMode { get; set; } = "always";
|
||||||
public bool MpvFullscreen { get; set; }
|
public bool MpvFullscreen { get; set; }
|
||||||
@@ -50,6 +51,13 @@ namespace mpvnet
|
|||||||
MinimumSize = new Size(FontHeight * 16, FontHeight * 9);
|
MinimumSize = new Size(FontHeight * 16, FontHeight * 9);
|
||||||
Text += " " + Application.ProductVersion;
|
Text += " " + Application.ProductVersion;
|
||||||
|
|
||||||
|
object recent = RegistryHelp.GetObject("HKCU\\Software\\" + Application.ProductName, "Recent");
|
||||||
|
|
||||||
|
if (recent is string[] r)
|
||||||
|
RecentFiles = new List<string>(r);
|
||||||
|
else
|
||||||
|
RecentFiles = new List<string>();
|
||||||
|
|
||||||
foreach (var i in mp.mpvConf)
|
foreach (var i in mp.mpvConf)
|
||||||
ProcessMpvProperty(i.Key, i.Value);
|
ProcessMpvProperty(i.Key, i.Value);
|
||||||
|
|
||||||
@@ -152,6 +160,21 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MenuItem recent = FindMenuItem("Recent");
|
||||||
|
|
||||||
|
if (recent != null)
|
||||||
|
{
|
||||||
|
recent.DropDownItems.Clear();
|
||||||
|
|
||||||
|
foreach (string path in RecentFiles)
|
||||||
|
MenuItem.Add(recent.DropDownItems, path, () => mp.LoadFiles(path));
|
||||||
|
|
||||||
|
recent.DropDownItems.Add(new ToolStripSeparator());
|
||||||
|
MenuItem mi = new MenuItem("Clear List");
|
||||||
|
mi.Action = () => RecentFiles.Clear();
|
||||||
|
recent.DropDownItems.Add(mi);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuItem FindMenuItem(string text) => FindMenuItem(text, ContextMenu.Items);
|
public MenuItem FindMenuItem(string text) => FindMenuItem(text, ContextMenu.Items);
|
||||||
@@ -340,7 +363,14 @@ namespace mpvnet
|
|||||||
|
|
||||||
void ContextMenu_Opened(object sender, EventArgs e) => CursorHelp.Show();
|
void ContextMenu_Opened(object sender, EventArgs e) => CursorHelp.Show();
|
||||||
|
|
||||||
void mp_PlaybackRestart() => BeginInvoke(new Action(() => { Text = Path.GetFileName(mp.get_property_string("path")) + " - mpv.net " + Application.ProductVersion; }));
|
private void Mp_FileLoaded()
|
||||||
|
{
|
||||||
|
string path = mp.get_property_string("path");
|
||||||
|
BeginInvoke(new Action(() => { Text = Path.GetFileName(path) + " - mpv.net " + Application.ProductVersion; }));
|
||||||
|
if (RecentFiles.Contains(path)) RecentFiles.Remove(path);
|
||||||
|
RecentFiles.Insert(0, path);
|
||||||
|
if (RecentFiles.Count > 15) RecentFiles.RemoveAt(15);
|
||||||
|
}
|
||||||
|
|
||||||
void Mp_Idle() => BeginInvoke(new Action(() => { Text = "mpv.net " + Application.ProductVersion; }));
|
void Mp_Idle() => BeginInvoke(new Action(() => { Text = "mpv.net " + Application.ProductVersion; }));
|
||||||
|
|
||||||
@@ -455,7 +485,7 @@ namespace mpvnet
|
|||||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||||
mp.LoadFiles(e.Data.GetData(DataFormats.FileDrop) as String[]);
|
mp.LoadFiles(e.Data.GetData(DataFormats.FileDrop) as String[]);
|
||||||
if (e.Data.GetDataPresent(DataFormats.Text))
|
if (e.Data.GetDataPresent(DataFormats.Text))
|
||||||
mp.LoadURL(e.Data.GetData(DataFormats.Text).ToString());
|
mp.LoadFiles(e.Data.GetData(DataFormats.Text).ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseDown(MouseEventArgs e)
|
protected override void OnMouseDown(MouseEventArgs e)
|
||||||
@@ -501,14 +531,6 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DialogResult ShowMsgBox(string message, MessageBoxIcon icon)
|
|
||||||
{
|
|
||||||
var buttons = MessageBoxButtons.OK;
|
|
||||||
if (icon == MessageBoxIcon.Question) buttons = MessageBoxButtons.OKCancel;
|
|
||||||
var fn = new Func<DialogResult>(() => MessageBox.Show(message, Application.ProductName, buttons, icon));
|
|
||||||
return (DialogResult)Invoke(fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnLoad(EventArgs e)
|
protected override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnLoad(e);
|
base.OnLoad(e);
|
||||||
@@ -521,7 +543,7 @@ namespace mpvnet
|
|||||||
mp.observe_property_int("edition", mpPropChangeEdition);
|
mp.observe_property_int("edition", mpPropChangeEdition);
|
||||||
mp.Shutdown += mp_Shutdown;
|
mp.Shutdown += mp_Shutdown;
|
||||||
mp.VideoSizeChanged += mp_VideoSizeChanged;
|
mp.VideoSizeChanged += mp_VideoSizeChanged;
|
||||||
mp.PlaybackRestart += mp_PlaybackRestart;
|
mp.FileLoaded += Mp_FileLoaded;
|
||||||
mp.Idle += Mp_Idle;
|
mp.Idle += Mp_Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,6 +574,7 @@ namespace mpvnet
|
|||||||
protected override void OnFormClosed(FormClosedEventArgs e)
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnFormClosed(e);
|
base.OnFormClosed(e);
|
||||||
|
RegistryHelp.SetObject("HKCU\\Software\\" + Application.ProductName, "Recent", RecentFiles.ToArray());
|
||||||
mp.commandv("quit");
|
mp.commandv("quit");
|
||||||
mp.AutoResetEvent.WaitOne(3000);
|
mp.AutoResetEvent.WaitOne(3000);
|
||||||
}
|
}
|
||||||
@@ -572,12 +595,12 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
string clipboard = Clipboard.GetText();
|
string clipboard = Clipboard.GetText();
|
||||||
|
|
||||||
if (clipboard.StartsWith("https://www.youtube.com/watch?") && RegistryHelp.GetValue("HKCU\\Software\\" + Application.ProductName, "LastYouTubeURL") != clipboard && Visible)
|
if (clipboard.StartsWith("https://www.youtube.com/watch?") && RegistryHelp.GetString("HKCU\\Software\\" + Application.ProductName, "LastYouTubeURL") != clipboard && Visible)
|
||||||
{
|
{
|
||||||
RegistryHelp.SetValue("HKCU\\Software\\" + Application.ProductName, "LastYouTubeURL", clipboard);
|
RegistryHelp.SetObject("HKCU\\Software\\" + Application.ProductName, "LastYouTubeURL", clipboard);
|
||||||
|
|
||||||
if (Msg.ShowQuestion("Play YouTube URL?", clipboard) == MsgResult.OK)
|
if (Msg.ShowQuestion("Play YouTube URL?", clipboard) == MsgResult.OK)
|
||||||
mp.LoadURL(clipboard);
|
mp.LoadFiles(clipboard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,11 +61,6 @@ public class MenuItem : ToolStripMenuItem
|
|||||||
base.OnClick(e);
|
base.OnClick(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MenuItem Add<T>(ToolStripItemCollection items, string path, Action<T> action, T value)
|
|
||||||
{
|
|
||||||
return Add(items, path, () => action(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MenuItem Add(ToolStripItemCollection items, string path, Action action)
|
public static MenuItem Add(ToolStripItemCollection items, string path, Action action)
|
||||||
{
|
{
|
||||||
string[] a = path.Split(new[] { " > ", " | " }, StringSplitOptions.RemoveEmptyEntries);
|
string[] a = path.Split(new[] { " > ", " | " }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|||||||
@@ -15,12 +15,20 @@ using Microsoft.Win32;
|
|||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
public class Misc
|
public class App
|
||||||
{
|
{
|
||||||
public static readonly string[] FileTypes = "264 265 3gp aac ac3 avc avi avs bmp divx dts dtshd dtshr dtsma eac3 evo flac flv h264 h265 hevc hvc jpg jpeg m2t m2ts m2v m4a m4v mka mkv mlp mov mp2 mp3 mp4 mpa mpeg mpg mpv mts ogg ogm opus pcm png pva raw rmvb thd thd+ac3 true-hd truehd ts vdr vob vpy w64 wav webm wmv y4m".Split(' ');
|
public static string[] VideoTypes { get; } = "mpg avi vob mp4 mkv avs 264 mov wmv flv h264 asf webm mpeg mpv y4m avc hevc 265 h265 m2v m2ts vpy mts webm m4v".Split(" ".ToCharArray());
|
||||||
|
public static string[] AudioTypes { get; } = "mp2 mp3 ac3 wav w64 m4a dts dtsma dtshr dtshd eac3 thd thd+ac3 ogg mka aac opus flac mpa".Split(" ".ToCharArray());
|
||||||
|
|
||||||
public static string GetFilter(IEnumerable<string> values) => "*." +
|
public static bool IsDarkMode {
|
||||||
String.Join(";*.", values) + "|*." + String.Join(";*.", values) + "|All Files|*.*";
|
get {
|
||||||
|
string darkMode = MainForm.Instance.MpvNetDarkMode;
|
||||||
|
object value = Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", 1);
|
||||||
|
if (value is null) value = 1;
|
||||||
|
bool isDarkTheme = (int)value == 0;
|
||||||
|
return (darkMode == "system" && isDarkTheme) || darkMode == "always";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Sys
|
public class Sys
|
||||||
@@ -65,33 +73,31 @@ namespace mpvnet
|
|||||||
static string ExeFilename = Path.GetFileName(Application.ExecutablePath);
|
static string ExeFilename = Path.GetFileName(Application.ExecutablePath);
|
||||||
static string ExeFilenameNoExt = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
|
static string ExeFilenameNoExt = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
|
||||||
static string[] Types;
|
static string[] Types;
|
||||||
public static string[] VideoTypes = "mpg avi vob mp4 mkv avs 264 mov wmv flv h264 asf webm mpeg mpv y4m avc hevc 265 h265 m2v m2ts vpy mts webm m4v".Split(" ".ToCharArray());
|
|
||||||
public static string[] AudioTypes = "mp2 mp3 ac3 wav w64 m4a dts dtsma dtshr dtshd eac3 thd thd+ac3 ogg mka aac opus flac mpa".Split(" ".ToCharArray());
|
|
||||||
|
|
||||||
public static void Register(string[] types)
|
public static void Register(string[] types)
|
||||||
{
|
{
|
||||||
Types = types;
|
Types = types;
|
||||||
|
|
||||||
RegistryHelp.SetValue(@"HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename, null, ExePath);
|
RegistryHelp.SetObject(@"HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename, null, ExePath);
|
||||||
RegistryHelp.SetValue($"HKCR\\Applications\\{ExeFilename}", "FriendlyAppName", "mpv.net media player");
|
RegistryHelp.SetObject($"HKCR\\Applications\\{ExeFilename}", "FriendlyAppName", "mpv.net media player");
|
||||||
RegistryHelp.SetValue($"HKCR\\Applications\\{ExeFilename}\\shell\\open\\command", null, $"\"{ExePath}\" \"%1\"");
|
RegistryHelp.SetObject($"HKCR\\Applications\\{ExeFilename}\\shell\\open\\command", null, $"\"{ExePath}\" \"%1\"");
|
||||||
RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv\Capabilities", "ApplicationDescription", "mpv.net media player");
|
RegistryHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv\Capabilities", "ApplicationDescription", "mpv.net media player");
|
||||||
RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv\Capabilities", "ApplicationName", "mpv.net");
|
RegistryHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv\Capabilities", "ApplicationName", "mpv.net");
|
||||||
RegistryHelp.SetValue($"HKCR\\SystemFileAssociations\\video\\OpenWithList\\{ExeFilename}", null, "");
|
RegistryHelp.SetObject($"HKCR\\SystemFileAssociations\\video\\OpenWithList\\{ExeFilename}", null, "");
|
||||||
RegistryHelp.SetValue($"HKCR\\SystemFileAssociations\\audio\\OpenWithList\\{ExeFilename}", null, "");
|
RegistryHelp.SetObject($"HKCR\\SystemFileAssociations\\audio\\OpenWithList\\{ExeFilename}", null, "");
|
||||||
|
|
||||||
foreach (string ext in Types)
|
foreach (string ext in Types)
|
||||||
{
|
{
|
||||||
RegistryHelp.SetValue($"HKCR\\Applications\\{ExeFilename}\\SupportedTypes", "." + ext, "");
|
RegistryHelp.SetObject($"HKCR\\Applications\\{ExeFilename}\\SupportedTypes", "." + ext, "");
|
||||||
RegistryHelp.SetValue($"HKCR\\" + "." + ext, null, ExeFilenameNoExt + "." + ext);
|
RegistryHelp.SetObject($"HKCR\\" + "." + ext, null, ExeFilenameNoExt + "." + ext);
|
||||||
RegistryHelp.SetValue($"HKCR\\" + "." + ext + "\\OpenWithProgIDs", ExeFilenameNoExt + "." + ext, "");
|
RegistryHelp.SetObject($"HKCR\\" + "." + ext + "\\OpenWithProgIDs", ExeFilenameNoExt + "." + ext, "");
|
||||||
if (VideoTypes.Contains(ext))
|
if (App.VideoTypes.Contains(ext))
|
||||||
RegistryHelp.SetValue($"HKCR\\" + "." + ext, "PerceivedType", "video");
|
RegistryHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "video");
|
||||||
if (AudioTypes.Contains(ext))
|
if (App.AudioTypes.Contains(ext))
|
||||||
RegistryHelp.SetValue($"HKCR\\" + "." + ext, "PerceivedType", "audio");
|
RegistryHelp.SetObject($"HKCR\\" + "." + ext, "PerceivedType", "audio");
|
||||||
RegistryHelp.SetValue($"HKCR\\" + ExeFilenameNoExt + "." + ext + "\\shell\\open", null, "Play with " + Application.ProductName);
|
RegistryHelp.SetObject($"HKCR\\" + ExeFilenameNoExt + "." + ext + "\\shell\\open", null, "Play with " + Application.ProductName);
|
||||||
RegistryHelp.SetValue($"HKCR\\" + ExeFilenameNoExt + "." + ext + "\\shell\\open\\command", null, $"\"{ExePath}\" \"%1\"");
|
RegistryHelp.SetObject($"HKCR\\" + ExeFilenameNoExt + "." + ext + "\\shell\\open\\command", null, $"\"{ExePath}\" \"%1\"");
|
||||||
RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities\FileAssociations", "." + ext, ExeFilenameNoExt + "." + ext);
|
RegistryHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities\FileAssociations", "." + ext, ExeFilenameNoExt + "." + ext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,19 +122,26 @@ namespace mpvnet
|
|||||||
|
|
||||||
public class RegistryHelp
|
public class RegistryHelp
|
||||||
{
|
{
|
||||||
public static void SetValue(string path, string name, string value)
|
public static void SetObject(string path, string name, object value)
|
||||||
{
|
{
|
||||||
using (RegistryKey rk = GetRootKey(path).CreateSubKey(path.Substring(5), RegistryKeyPermissionCheck.ReadWriteSubTree))
|
using (RegistryKey rk = GetRootKey(path).CreateSubKey(path.Substring(5), RegistryKeyPermissionCheck.ReadWriteSubTree))
|
||||||
rk.SetValue(name, value);
|
rk.SetValue(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetValue(string path, string name)
|
public static string GetString(string path, string name)
|
||||||
|
{
|
||||||
|
object val = GetObject(path, name);
|
||||||
|
if (val == null || !(val is string)) return "";
|
||||||
|
return val.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object GetObject(string path, string name)
|
||||||
{
|
{
|
||||||
using (RegistryKey rk = GetRootKey(path).OpenSubKey(path.Substring(5)))
|
using (RegistryKey rk = GetRootKey(path).OpenSubKey(path.Substring(5)))
|
||||||
if (rk != null)
|
if (rk != null)
|
||||||
return rk.GetValue(name, "").ToString();
|
return rk.GetValue(name, "");
|
||||||
else
|
else
|
||||||
return "";
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RemoveKey(string path)
|
public static void RemoveKey(string path)
|
||||||
|
|||||||
@@ -24,12 +24,23 @@ namespace mpvnet
|
|||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
public static extern bool AdjustWindowRect(ref RECT lpRect, uint dwStyle, bool bMenu);
|
public static extern bool AdjustWindowRect(ref RECT lpRect, uint dwStyle, bool bMenu);
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
|
||||||
public static extern IntPtr GetWindowLongPtrW(IntPtr hWnd, int nIndex);
|
|
||||||
|
|
||||||
[DllImport("user32.dll", SetLastError = true)]
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
|
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", EntryPoint = "GetWindowLong")]
|
||||||
|
private static extern IntPtr GetWindowLong32(IntPtr hWnd, int nIndex);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", EntryPoint = "GetWindowLongPtr")]
|
||||||
|
private static extern IntPtr GetWindowLong64(IntPtr hWnd, int nIndex);
|
||||||
|
|
||||||
|
public static IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex)
|
||||||
|
{
|
||||||
|
if (IntPtr.Size == 8)
|
||||||
|
return GetWindowLong64(hWnd, nIndex);
|
||||||
|
else
|
||||||
|
return GetWindowLong32(hWnd, nIndex);
|
||||||
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct RECT
|
public struct RECT
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
public static void AddWindowBorders(IntPtr hwnd, ref Native.RECT rc)
|
public static void AddWindowBorders(IntPtr hwnd, ref Native.RECT rc)
|
||||||
{
|
{
|
||||||
Native.AdjustWindowRect(ref rc, (uint)Native.GetWindowLongPtrW(hwnd, -16 /* GWL_STYLE */), false);
|
Native.AdjustWindowRect(ref rc, (uint)Native.GetWindowLongPtr(hwnd, -16 /* GWL_STYLE */), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
using Sys;
|
||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
static class Program
|
static class Program
|
||||||
@@ -14,15 +16,9 @@ namespace mpvnet
|
|||||||
|
|
||||||
if (args.Length == 3 && args[1] == "--reg-file-assoc")
|
if (args.Length == 3 && args[1] == "--reg-file-assoc")
|
||||||
{
|
{
|
||||||
if (args[2] == "audio") FileAssociation.Register(FileAssociation.AudioTypes);
|
if (args[2] == "audio") FileAssociation.Register(App.AudioTypes);
|
||||||
if (args[2] == "video") FileAssociation.Register(FileAssociation.VideoTypes);
|
if (args[2] == "video") FileAssociation.Register(App.VideoTypes);
|
||||||
if (args[2] == "unregister") FileAssociation.Unregister();
|
if (args[2] == "unreg") FileAssociation.Unregister();
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,5 +26,10 @@ namespace mpvnet
|
|||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new MainForm());
|
Application.Run(new MainForm());
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Msg.ShowException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
|||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("mpv.net")]
|
[assembly: AssemblyTitle("mpv.net")]
|
||||||
[assembly: AssemblyDescription("libmpv based media player")]
|
[assembly: AssemblyDescription("A lightweight media player")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("mpv.net")]
|
[assembly: AssemblyProduct("mpv.net")]
|
||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("3.1.0.0")]
|
[assembly: AssemblyVersion("3.4.0.0")]
|
||||||
[assembly: AssemblyFileVersion("3.1.0.0")]
|
[assembly: AssemblyFileVersion("3.4.0.0")]
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
_ ignore #menu: Open > -
|
_ ignore #menu: Open > -
|
||||||
Alt+a script-message mpv.net load-audio #menu: Open > Load external audio files...
|
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...
|
Alt+s script-message mpv.net load-sub #menu: Open > Load external subtitle files...
|
||||||
|
_ ignore #menu: Open > -
|
||||||
|
_ ignore #menu: Open > Recent
|
||||||
|
|
||||||
_ ignore #menu: -
|
_ ignore #menu: -
|
||||||
Space cycle pause #menu: Play/Pause
|
Space cycle pause #menu: Play/Pause
|
||||||
@@ -144,6 +146,7 @@
|
|||||||
L cycle-values loop-file "inf" "no" #menu: Tools > Toggle infinite file looping
|
L cycle-values loop-file "inf" "no" #menu: Tools > Toggle infinite file looping
|
||||||
Ctrl+h cycle-values hwdec "auto" "no" #menu: Tools > Cycle Hardware Decoding
|
Ctrl+h cycle-values hwdec "auto" "no" #menu: Tools > Cycle Hardware Decoding
|
||||||
_ script-message mpv.net execute-mpv-command #menu: Tools > Execute mpv command...
|
_ script-message mpv.net execute-mpv-command #menu: Tools > Execute mpv command...
|
||||||
|
_ script-message mpv.net manage-file-associations #menu: Tools > Manage File Associations...
|
||||||
|
|
||||||
_ script-message mpv.net shell-execute https://mpv.io/manual/stable/ #menu: Help > Show mpv manual
|
_ script-message mpv.net shell-execute https://mpv.io/manual/stable/ #menu: Help > Show mpv manual
|
||||||
_ 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/mpv-player/mpv/blob/master/etc/input.conf #menu: Help > Show mpv default keys
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
|
|
||||||
namespace Sys
|
namespace Sys
|
||||||
{
|
{
|
||||||
public class Msg
|
public class Msg
|
||||||
@@ -25,6 +23,8 @@ namespace Sys
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowError(string mainInstruction, string content = null)
|
public static void ShowError(string mainInstruction, string content = null)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
using (TaskDialog<string> td = new TaskDialog<string>())
|
using (TaskDialog<string> td = new TaskDialog<string>())
|
||||||
{
|
{
|
||||||
@@ -44,14 +44,20 @@ namespace Sys
|
|||||||
}
|
}
|
||||||
|
|
||||||
td.MainIcon = MsgIcon.Error;
|
td.MainIcon = MsgIcon.Error;
|
||||||
td.Footer = "[copymsg Copy Message]";
|
td.Footer = "[Copy Message](copymsg)";
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Msg.SupportURL))
|
if (!string.IsNullOrEmpty(Msg.SupportURL))
|
||||||
td.Footer += $" [{SupportURL} Contact Support]";
|
td.Footer += $" [Contact Support]({SupportURL})";
|
||||||
|
|
||||||
td.Show();
|
td.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.GetType().Name + "\n\n" + ex.Message + "\n\n" + ex.ToString(),
|
||||||
|
Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void ShowException(Exception e)
|
public static void ShowException(Exception e)
|
||||||
{
|
{
|
||||||
@@ -63,17 +69,17 @@ namespace Sys
|
|||||||
td.Content = e.Message;
|
td.Content = e.Message;
|
||||||
td.MainIcon = MsgIcon.Error;
|
td.MainIcon = MsgIcon.Error;
|
||||||
td.ExpandedInformation = e.ToString();
|
td.ExpandedInformation = e.ToString();
|
||||||
td.Footer = "[copymsg Copy Message]";
|
td.Footer = "[Copy Message](copymsg)";
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Msg.SupportURL))
|
if (!string.IsNullOrEmpty(Msg.SupportURL))
|
||||||
td.Footer += $" [{SupportURL} Contact Support]";
|
td.Footer += $" [Contact Support]({SupportURL})";
|
||||||
|
|
||||||
td.Show();
|
td.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
MessageBox.Show(ex.GetType().Name + "\n\n" + e.Message + "\n\n" + e.ToString(),
|
MessageBox.Show(ex.GetType().Name + "\n\n" + ex.Message + "\n\n" + ex.ToString(),
|
||||||
Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,6 +115,8 @@ namespace Sys
|
|||||||
MsgIcon icon,
|
MsgIcon icon,
|
||||||
MsgButtons buttons,
|
MsgButtons buttons,
|
||||||
MsgResult defaultButton = MsgResult.None)
|
MsgResult defaultButton = MsgResult.None)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
using (TaskDialog<MsgResult> td = new TaskDialog<MsgResult>())
|
using (TaskDialog<MsgResult> td = new TaskDialog<MsgResult>())
|
||||||
{
|
{
|
||||||
@@ -138,6 +146,12 @@ namespace Sys
|
|||||||
return td.Show();
|
return td.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (MsgResult)MessageBox.Show(ex.GetType().Name + "\n\n" + ex.Message + "\n\n" + ex.ToString(),
|
||||||
|
Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TaskDialog<T> : TaskDialogNative, IDisposable
|
public class TaskDialog<T> : TaskDialogNative, IDisposable
|
||||||
@@ -244,12 +258,12 @@ namespace Sys
|
|||||||
|
|
||||||
public string Content {
|
public string Content {
|
||||||
get => Config.pszContent;
|
get => Config.pszContent;
|
||||||
set => Config.pszContent = ExpandWikiMarkup(value);
|
set => Config.pszContent = ExpandMarkdownMarkup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ExpandedInformation {
|
public string ExpandedInformation {
|
||||||
get => Config.pszExpandedInformation;
|
get => Config.pszExpandedInformation;
|
||||||
set => Config.pszExpandedInformation = ExpandWikiMarkup(value);
|
set => Config.pszExpandedInformation = ExpandMarkdownMarkup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string VerificationText {
|
public string VerificationText {
|
||||||
@@ -264,7 +278,7 @@ namespace Sys
|
|||||||
|
|
||||||
public string Footer {
|
public string Footer {
|
||||||
get => Config.pszFooter;
|
get => Config.pszFooter;
|
||||||
set => Config.pszFooter = ExpandWikiMarkup(value);
|
set => Config.pszFooter = ExpandMarkdownMarkup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MsgIcon MainIcon {
|
public MsgIcon MainIcon {
|
||||||
@@ -329,16 +343,16 @@ namespace Sys
|
|||||||
Buttons.Add(new TaskDialogNative.TASKDIALOG_BUTTON(n, text));
|
Buttons.Add(new TaskDialogNative.TASKDIALOG_BUTTON(n, text));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ExpandWikiMarkup(string value)
|
public string ExpandMarkdownMarkup(string value)
|
||||||
{
|
{
|
||||||
if (value.Contains("["))
|
if (value.Contains("["))
|
||||||
{
|
{
|
||||||
Regex regex = new Regex("\\[(.*?) (.+?)\\]");
|
Regex regex = new Regex(@"\[(.+)\]\((.+)\)");
|
||||||
|
|
||||||
if (regex.Match(value).Success)
|
if (regex.Match(value).Success)
|
||||||
{
|
{
|
||||||
Config.dwFlags |= TaskDialogNative.TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS;
|
Config.dwFlags |= TaskDialogNative.TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS;
|
||||||
value = regex.Replace(value, "<a href=\"$1\">$2</a>");
|
value = regex.Replace(value, "<a href=\"$2\">$1</a>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
@@ -398,10 +412,9 @@ namespace Sys
|
|||||||
break;
|
break;
|
||||||
case 3: //TDN_HYPERLINK_CLICKED
|
case 3: //TDN_HYPERLINK_CLICKED
|
||||||
string stringUni = Marshal.PtrToStringUni(lParam);
|
string stringUni = Marshal.PtrToStringUni(lParam);
|
||||||
|
|
||||||
if (stringUni.StartsWith("mailto") || stringUni.StartsWith("http"))
|
if (stringUni.StartsWith("mailto") || stringUni.StartsWith("http"))
|
||||||
Process.Start(stringUni);
|
Process.Start(stringUni);
|
||||||
if (Operators.CompareString(stringUni, "copymsg", false) == 0)
|
if (stringUni == "copymsg")
|
||||||
{
|
{
|
||||||
Thread thread = new Thread((ThreadStart)(() => {
|
Thread thread = new Thread((ThreadStart)(() => {
|
||||||
Clipboard.SetText(MainInstruction + "\r\n\r\n" + Content + "\r\n\r\n" + ExpandedInformation);
|
Clipboard.SetText(MainInstruction + "\r\n\r\n" + Content + "\r\n\r\n" + ExpandedInformation);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="About mpv.net" Height="230" Width="420" FontSize="16" ShowInTaskbar="False"
|
Title="About mpv.net" Height="230" Width="420" FontSize="16" ShowInTaskbar="False"
|
||||||
WindowStartupLocation="CenterOwner" ResizeMode="NoResize" PreviewKeyDown="Window_PreviewKeyDown">
|
WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
|
||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<TextBlock FontSize="48" HorizontalAlignment="Center" Margin="0,0,0,10">mpv.net</TextBlock>
|
<TextBlock FontSize="48" HorizontalAlignment="Center" Margin="0,0,0,10">mpv.net</TextBlock>
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ namespace mpvnet
|
|||||||
Foreground = WPF.WPF.ThemeBrush;
|
Foreground = WPF.WPF.ThemeBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
|
protected override void OnPreviewKeyDown(KeyEventArgs e) => Close();
|
||||||
{
|
protected override void OnMouseDown(MouseButtonEventArgs e) => Close();
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
using System;
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
@@ -19,11 +21,20 @@ namespace mpvnet
|
|||||||
var yourCostumFilter = new Predicate<object>(item => Filter((CommandItem)item));
|
var yourCostumFilter = new Predicate<object>(item => Filter((CommandItem)item));
|
||||||
CollectionView.Filter = yourCostumFilter;
|
CollectionView.Filter = yourCostumFilter;
|
||||||
ListView.ItemsSource = CollectionView;
|
ListView.ItemsSource = CollectionView;
|
||||||
|
|
||||||
|
if (App.IsDarkMode)
|
||||||
|
{
|
||||||
|
ListView.Foreground = Brushes.White;
|
||||||
|
ListView.Background = Brushes.Black;
|
||||||
|
FilterTextBox.Foreground = Brushes.White;
|
||||||
|
FilterTextBox.Background = Brushes.Black;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Filter(CommandItem item)
|
bool Filter(CommandItem item)
|
||||||
{
|
{
|
||||||
if (item.Command == "") return false;
|
if (item.Command == "" || item.Path == "")
|
||||||
|
return false;
|
||||||
string filter = FilterTextBox.Text.ToLower();
|
string filter = FilterTextBox.Text.ToLower();
|
||||||
if (filter == "") return true;
|
if (filter == "") return true;
|
||||||
if (item.Command.ToLower().Contains(filter) ||
|
if (item.Command.ToLower().Contains(filter) ||
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
<TextBlock x:Name="OpenSettingsTextBlock" Margin="0,30,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static WPF:WPF.ThemeBrush}" MouseUp="OpenSettingsTextBlock_MouseUp">Open config folder</TextBlock>
|
<TextBlock x:Name="OpenSettingsTextBlock" Margin="0,30,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static WPF:WPF.ThemeBrush}" MouseUp="OpenSettingsTextBlock_MouseUp">Open config folder</TextBlock>
|
||||||
<TextBlock x:Name="ShowManualTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static WPF:WPF.ThemeBrush}" MouseUp="ShowManualTextBlock_MouseUp">Show mpv manual</TextBlock>
|
<TextBlock x:Name="ShowManualTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static WPF:WPF.ThemeBrush}" MouseUp="ShowManualTextBlock_MouseUp">Show mpv manual</TextBlock>
|
||||||
<TextBlock x:Name="SupportTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static WPF:WPF.ThemeBrush}" MouseUp="SupportTextBlock_MouseUp">Show support forum</TextBlock>
|
<TextBlock x:Name="SupportTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static WPF:WPF.ThemeBrush}" MouseUp="SupportTextBlock_MouseUp">Show support forum</TextBlock>
|
||||||
<TextBlock x:Name="ApplyTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static WPF:WPF.ThemeBrush}" MouseUp="ApplyTextBlock_MouseUp">Write config to disk</TextBlock>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -3,14 +3,13 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
using DynamicGUI;
|
using DynamicGUI;
|
||||||
using Microsoft.Win32;
|
using Sys;
|
||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
@@ -29,8 +28,14 @@ namespace mpvnet
|
|||||||
SearchControl.SearchTextBox.TextChanged += SearchTextBox_TextChanged;
|
SearchControl.SearchTextBox.TextChanged += SearchTextBox_TextChanged;
|
||||||
LoadSettings(MpvSettingsDefinitions, MpvConf);
|
LoadSettings(MpvSettingsDefinitions, MpvConf);
|
||||||
LoadSettings(MpvNetSettingsDefinitions, MpvNetConf);
|
LoadSettings(MpvNetSettingsDefinitions, MpvNetConf);
|
||||||
SearchControl.Text = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\mpv.net", "conf editor search", "");
|
SearchControl.Text = RegistryHelp.GetString(@"HKCU\Software\mpv.net", "config editor search");
|
||||||
SetDarkTheme();
|
|
||||||
|
if (App.IsDarkMode)
|
||||||
|
{
|
||||||
|
Foreground = Brushes.White;
|
||||||
|
Foreground2 = Brushes.Silver;
|
||||||
|
Background = Brushes.Black;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Brush Foreground2 {
|
public Brush Foreground2 {
|
||||||
@@ -41,22 +46,6 @@ namespace mpvnet
|
|||||||
public static readonly DependencyProperty Foreground2Property =
|
public static readonly DependencyProperty Foreground2Property =
|
||||||
DependencyProperty.Register("Foreground2", typeof(Brush), typeof(ConfWindow), new PropertyMetadata(Brushes.DarkSlateGray));
|
DependencyProperty.Register("Foreground2", typeof(Brush), typeof(ConfWindow), new PropertyMetadata(Brushes.DarkSlateGray));
|
||||||
|
|
||||||
void SetDarkTheme()
|
|
||||||
{
|
|
||||||
string darkMode = MpvNetSettingsDefinitions.Where(item => item.Name == "dark-mode").First().Value;
|
|
||||||
|
|
||||||
object value = Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", 1);
|
|
||||||
if (value is null) value = 1;
|
|
||||||
bool isDarkTheme = (int)value == 0;
|
|
||||||
|
|
||||||
if (!((darkMode == "system" && isDarkTheme) || darkMode == "always"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
Foreground = Brushes.White;
|
|
||||||
Foreground2 = Brushes.Silver;
|
|
||||||
Background = Brushes.Black;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadSettings(List<SettingBase> settingsDefinitions,
|
private void LoadSettings(List<SettingBase> settingsDefinitions,
|
||||||
Dictionary<string, string> confSettings)
|
Dictionary<string, string> confSettings)
|
||||||
{
|
{
|
||||||
@@ -143,7 +132,7 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
base.OnClosed(e);
|
base.OnClosed(e);
|
||||||
WriteToDisk();
|
WriteToDisk();
|
||||||
Registry.SetValue(@"HKEY_CURRENT_USER\Software\mpv.net", "conf editor search", SearchControl.Text);
|
RegistryHelp.SetObject(@"HKCU\Software\mpv.net", "config editor search", SearchControl.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteToDisk()
|
void WriteToDisk()
|
||||||
@@ -164,8 +153,7 @@ namespace mpvnet
|
|||||||
WriteToDisk(mp.MpvConfPath, MpvConf, MpvSettingsDefinitions);
|
WriteToDisk(mp.MpvConfPath, MpvConf, MpvSettingsDefinitions);
|
||||||
WriteToDisk(mp.MpvNetConfPath, MpvNetConf, MpvNetSettingsDefinitions);
|
WriteToDisk(mp.MpvNetConfPath, MpvNetConf, MpvNetSettingsDefinitions);
|
||||||
|
|
||||||
MessageBox.Show("Changes will be available on next mpv.net startup.",
|
Msg.Show("Changes will be available on next mpv.net startup.");
|
||||||
Title, MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteToDisk(string filePath,
|
void WriteToDisk(string filePath,
|
||||||
@@ -251,9 +239,11 @@ namespace mpvnet
|
|||||||
Process.Start("https://github.com/stax76/mpv.net#Support");
|
Process.Start("https://github.com/stax76/mpv.net#Support");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplyTextBlock_MouseUp(object sender, MouseButtonEventArgs e)
|
protected override void OnKeyDown(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
WriteToDisk();
|
base.OnKeyDown(e);
|
||||||
|
if (e.Key == Key.Escape)
|
||||||
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,8 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using Sys;
|
||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
@@ -25,6 +27,12 @@ namespace mpvnet
|
|||||||
var yourCostumFilter = new Predicate<object>(item => Filter((CommandItem)item));
|
var yourCostumFilter = new Predicate<object>(item => Filter((CommandItem)item));
|
||||||
CollectionView.Filter = yourCostumFilter;
|
CollectionView.Filter = yourCostumFilter;
|
||||||
DataGrid.ItemsSource = CollectionView;
|
DataGrid.ItemsSource = CollectionView;
|
||||||
|
|
||||||
|
if (App.IsDarkMode)
|
||||||
|
{
|
||||||
|
Foreground = Brushes.White;
|
||||||
|
Background = Brushes.Black;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
@@ -32,7 +40,7 @@ namespace mpvnet
|
|||||||
CollectionView.Refresh();
|
CollectionView.Refresh();
|
||||||
|
|
||||||
if (SearchControl.SearchTextBox.Text == "?")
|
if (SearchControl.SearchTextBox.Text == "?")
|
||||||
MessageBox.Show("Filtering works by searching in the Input, Menu and Command but it's possible to reduce the filter scope to either of Input, Menu or Command by prefixing as follows:\n\ni <input search>\ni: <input search>\n\nm <menu search>\nm: <menu search>\n\nc <command search>\nc: <command search>\n\nIf only one character is entered the search will be performed only in the input.", "Filtering", MessageBoxButton.OK, MessageBoxImage.Information);
|
Msg.Show("Filtering works by searching in the Input, Menu and Command but it's possible to reduce the filter scope to either of Input, Menu or Command by prefixing as follows:\n\ni <input search>\ni: <input search>\n\nm <menu search>\nm: <menu search>\n\nc <command search>\nc: <command search>\n\nIf only one character is entered the search will be performed only in the input.", "Filtering");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Filter(CommandItem item)
|
bool Filter(CommandItem item)
|
||||||
@@ -77,7 +85,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
foreach (CommandItem i in CommandItem.Items)
|
foreach (CommandItem i in CommandItem.Items)
|
||||||
if (items.ContainsKey(i.Input) && i.Input != "")
|
if (items.ContainsKey(i.Input) && i.Input != "")
|
||||||
MessageBox.Show($"Duplicate found:\n\n{i.Input}: {i.Path}\n\n{items[i.Input].Input}: {items[i.Input].Path}\n\nPlease note that you can chain multiple commands in the same line by using a semicolon as separator.", "Duplicate Found", MessageBoxButton.OK, MessageBoxImage.Warning);
|
Msg.Show($"Duplicate found:\n\n{i.Input}: {i.Path}\n\n{items[i.Input].Input}: {items[i.Input].Path}\n\nPlease note that you can chain multiple commands in the same line by using a semicolon as separator.", "Duplicate Found");
|
||||||
else
|
else
|
||||||
items[i.Input] = i;
|
items[i.Input] = i;
|
||||||
}
|
}
|
||||||
@@ -110,8 +118,7 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
if (InitialInputConfContent == GetInputConfContent()) return;
|
if (InitialInputConfContent == GetInputConfContent()) return;
|
||||||
File.WriteAllText(mp.InputConfPath, GetInputConfContent());
|
File.WriteAllText(mp.InputConfPath, GetInputConfContent());
|
||||||
MessageBox.Show("Changes will be available on next mpv.net startup.",
|
Msg.Show("Changes will be available on next mpv.net startup.");
|
||||||
Title, MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||||
@@ -119,8 +126,15 @@ namespace mpvnet
|
|||||||
DataGrid grid = (DataGrid)sender;
|
DataGrid grid = (DataGrid)sender;
|
||||||
|
|
||||||
if (e.Command == DataGrid.DeleteCommand)
|
if (e.Command == DataGrid.DeleteCommand)
|
||||||
if (MessageBox.Show($"Confirm to delete: {(grid.SelectedItem as CommandItem).Input} ({(grid.SelectedItem as CommandItem).Path})", "Confirm Delete", MessageBoxButton.OKCancel, MessageBoxImage.Question) != MessageBoxResult.OK)
|
if (Msg.ShowQuestion($"Confirm to delete: {(grid.SelectedItem as CommandItem).Input} ({(grid.SelectedItem as CommandItem).Path})") != MsgResult.OK)
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnKeyDown(KeyEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnKeyDown(e);
|
||||||
|
if (e.Key == Key.Escape)
|
||||||
|
Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ namespace mpvnet
|
|||||||
using (TaskDialog<string> td = new TaskDialog<string>())
|
using (TaskDialog<string> td = new TaskDialog<string>())
|
||||||
{
|
{
|
||||||
td.MainInstruction = "Choose a settings folder.";
|
td.MainInstruction = "Choose a settings folder.";
|
||||||
td.Content = "[https://mpv.io/manual/master/#files-on-windows MPV documentation about files on Windows.]";
|
td.Content = "[MPV documentation about files on Windows.](https://mpv.io/manual/master/#files-on-windows)";
|
||||||
td.AddCommandLink("appdata", appdataFolder, appdataFolder);
|
td.AddCommandLink("appdata", appdataFolder, appdataFolder);
|
||||||
td.AddCommandLink("portable", portableFolder, portableFolder);
|
td.AddCommandLink("portable", portableFolder, portableFolder);
|
||||||
td.AllowCancel = false;
|
td.AllowCancel = false;
|
||||||
@@ -278,7 +278,7 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
List<string> names = mpvnet.Command.Commands.Select((item) => item.Name).ToList();
|
List<string> names = mpvnet.Command.Commands.Select((item) => item.Name).ToList();
|
||||||
names.Sort();
|
names.Sort();
|
||||||
Msg.ShowError($"No command '{args[1]}' found.", $"Available commands are:\n\n{string.Join("\n", names)}\n\nHow to bind these commands can be seen in the [https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt default input bindings and menu definition].");
|
Msg.ShowError($"No command '{args[1]}' found.", $"Available commands are:\n\n{string.Join("\n", names)}\n\nHow to bind these commands can be seen in the [default input bindings and menu definition](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt).");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ClientMessage?.Invoke(args);
|
ClientMessage?.Invoke(args);
|
||||||
@@ -522,8 +522,6 @@ namespace mpvnet
|
|||||||
foreach (string i in args)
|
foreach (string i in args)
|
||||||
if (!i.StartsWith("--") && File.Exists(i))
|
if (!i.StartsWith("--") && File.Exists(i))
|
||||||
mp.commandv("loadfile", i, "append");
|
mp.commandv("loadfile", i, "append");
|
||||||
else if (!i.StartsWith("--") && i.StartsWith("http"))
|
|
||||||
mp.LoadURL(i);
|
|
||||||
|
|
||||||
mp.set_property_string("playlist-pos", "0");
|
mp.set_property_string("playlist-pos", "0");
|
||||||
|
|
||||||
@@ -543,16 +541,7 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LoadURL(string url)
|
public static void LoadFiles(params string[] files)
|
||||||
{
|
|
||||||
int count = mp.get_property_int("playlist-count");
|
|
||||||
mp.commandv("loadfile", url, "append");
|
|
||||||
mp.set_property_int("playlist-pos", count);
|
|
||||||
for (int i = 0; i < count; i++)
|
|
||||||
mp.commandv("playlist-remove", "0");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LoadFiles(string[] files)
|
|
||||||
{
|
{
|
||||||
int count = mp.get_property_int("playlist-count");
|
int count = mp.get_property_int("playlist-count");
|
||||||
|
|
||||||
@@ -571,14 +560,13 @@ namespace mpvnet
|
|||||||
|
|
||||||
static void LoadFolder()
|
static void LoadFolder()
|
||||||
{
|
{
|
||||||
if (WasFolderLoaded)
|
if (WasFolderLoaded) return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (get_property_int("playlist-count") == 1)
|
if (get_property_int("playlist-count") == 1)
|
||||||
{
|
{
|
||||||
string[] types = "264 265 3gp aac ac3 avc avi avs bmp divx dts dtshd dtshr dtsma eac3 evo flac flv h264 h265 hevc hvc jpg jpeg m2t m2ts m2v m4a m4v mka mkv mlp mov mp2 mp3 mp4 mpa mpeg mpg mpv mts ogg ogm opus pcm png pva raw rmvb thd thd+ac3 true-hd truehd ts vdr vob vpy w64 wav webm wmv y4m".Split(' ');
|
|
||||||
string path = get_property_string("path");
|
string path = get_property_string("path");
|
||||||
if (!Directory.Exists(Path.GetDirectoryName(path))) return;
|
if (!Directory.Exists(Path.GetDirectoryName(path))) return;
|
||||||
|
string[] types = "264 265 3gp aac ac3 avc avi avs bmp divx dts dtshd dtshr dtsma eac3 evo flac flv h264 h265 hevc hvc jpg jpeg m2t m2ts m2v m4a m4v mka mkv mlp mov mp2 mp3 mp4 mpa mpeg mpg mpv mts ogg ogm opus pcm png pva raw rmvb thd thd+ac3 true-hd truehd ts vdr vob vpy w64 wav webm wmv y4m".Split(' ');
|
||||||
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
|
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
|
||||||
files = files.Where((file) => types.Contains(Path.GetExtension(file).TrimStart(".".ToCharArray()).ToLower())).ToList();
|
files = files.Where((file) => types.Contains(Path.GetExtension(file).TrimStart(".".ToCharArray()).ToLower())).ToList();
|
||||||
files.Sort(new StringLogicalComparer());
|
files.Sort(new StringLogicalComparer());
|
||||||
|
|||||||
BIN
mpv.net/mpv.ico
|
Before Width: | Height: | Size: 264 KiB |
@@ -35,52 +35,13 @@
|
|||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject>mpvnet.Program</StartupObject>
|
<StartupObject>mpvnet.Program</StartupObject>
|
||||||
</PropertyGroup>
|
</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>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
</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>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
</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>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
</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>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
@@ -90,11 +51,51 @@
|
|||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>mpv.ico</ApplicationIcon>
|
<ApplicationIcon>mpvnet.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<OutputPath>bin\x86\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="IKVM.Reflection, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58, processorArchitecture=MSIL">
|
<Reference Include="IKVM.Reflection, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
@@ -218,7 +219,6 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="..\README.md">
|
<None Include="..\README.md">
|
||||||
<Link>README.md</Link>
|
<Link>README.md</Link>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
</None>
|
||||||
<None Include="app.manifest" />
|
<None Include="app.manifest" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
@@ -235,6 +235,7 @@
|
|||||||
<Link>LICENSE.txt</Link>
|
<Link>LICENSE.txt</Link>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="mpvnet.ico" />
|
||||||
<Content Include="Resources\mpvConf.txt" />
|
<Content Include="Resources\mpvConf.txt" />
|
||||||
<Content Include="Resources\mpvConfToml.txt" />
|
<Content Include="Resources\mpvConfToml.txt" />
|
||||||
<Content Include="Resources\mpvNetConfToml.txt" />
|
<Content Include="Resources\mpvNetConfToml.txt" />
|
||||||
@@ -243,7 +244,6 @@
|
|||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="mpv.ico" />
|
|
||||||
<Content Include="Resources\inputConfHeader.txt" />
|
<Content Include="Resources\inputConfHeader.txt" />
|
||||||
<Content Include="screenshot.jpg" />
|
<Content Include="screenshot.jpg" />
|
||||||
<Content Include="Resources\inputConf.txt" />
|
<Content Include="Resources\inputConf.txt" />
|
||||||
|
|||||||
BIN
mpv.net/mpvnet.ico
Normal file
|
After Width: | Height: | Size: 22 KiB |
@@ -1,7 +0,0 @@
|
|||||||
$scriptDir = Split-Path -Path $PSCommandPath -Parent
|
|
||||||
$exePath = $scriptDir + "\mpv.net\bin\mpvnet.exe"
|
|
||||||
$version = [Diagnostics.FileVersionInfo]::GetVersionInfo($exePath).FileVersion
|
|
||||||
$desktopDir = [Environment]::GetFolderPath("Desktop")
|
|
||||||
$targetDir = $desktopDir + "\mpv.net-" + $version
|
|
||||||
Copy-Item $scriptDir\mpv.net\bin $targetDir -Recurse -Exclude System.Management.Automation.xml -Force
|
|
||||||
& "C:\Program Files\7-Zip\7z.exe" a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"
|
|
||||||
28
setup.iss
@@ -1,19 +1,33 @@
|
|||||||
#define MyAppName "mpv.net"
|
#define MyAppName "mpv.net"
|
||||||
#define MyAppVersion GetFileVersion("mpv.net\bin\mpvnet.exe")
|
|
||||||
#define MyAppExeName "mpvnet.exe"
|
#define MyAppExeName "mpvnet.exe"
|
||||||
#define MyAppSourceDir "mpv.net\bin"
|
|
||||||
|
#ifndef arch
|
||||||
|
#define arch "x64"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if arch == "x64"
|
||||||
|
#define MyAppSourceDir "mpv.net\bin\x64"
|
||||||
|
#define MyAppVersion GetFileVersion("mpv.net\bin\x64\mpvnet.exe")
|
||||||
|
#else
|
||||||
|
#define MyAppSourceDir "mpv.net\bin\x86"
|
||||||
|
#define MyAppVersion GetFileVersion("mpv.net\bin\x86\mpvnet.exe")
|
||||||
|
#endif
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppId={{9AA2B100-BEF3-44D0-B819-D8FC3C4D557D}}
|
AppId={{9AA2B100-BEF3-44D0-B819-D8FC3C4D557D}}
|
||||||
AppName={#MyAppName}
|
AppName={#MyAppName}
|
||||||
AppVersion={#MyAppVersion}
|
AppVersion={#MyAppVersion}
|
||||||
AppPublisher=stax76
|
AppPublisher=Frank Skare (stax76)
|
||||||
|
#if arch == "x64"
|
||||||
ArchitecturesInstallIn64BitMode=x64
|
ArchitecturesInstallIn64BitMode=x64
|
||||||
|
#endif
|
||||||
Compression=lzma2
|
Compression=lzma2
|
||||||
DefaultDirName={pf}\{#MyAppName}
|
DefaultDirName={commonpf}\{#MyAppName}
|
||||||
OutputBaseFilename=mpvnet-{#MyAppVersion}
|
OutputBaseFilename=mpvnet-setup-{#arch}-{#MyAppVersion}
|
||||||
OutputDir=C:\Users\frank\Desktop
|
OutputDir={#GetEnv('USERPROFILE')}\Desktop
|
||||||
DefaultGroupName={#MyAppName}
|
DefaultGroupName={#MyAppName}
|
||||||
|
SetupIconFile=mpv.net\mpvnet.ico
|
||||||
|
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||||
@@ -27,4 +41,4 @@ Filename: "{app}\{#MyAppExeName}"; Description: "Associate video file extensions
|
|||||||
Filename: "{app}\{#MyAppExeName}"; Description: "Associate audio file extensions?"; Flags: postinstall unchecked runascurrentuser runhidden nowait; Parameters: "--reg-file-assoc audio"
|
Filename: "{app}\{#MyAppExeName}"; Description: "Associate audio file extensions?"; Flags: postinstall unchecked runascurrentuser runhidden nowait; Parameters: "--reg-file-assoc audio"
|
||||||
|
|
||||||
[UninstallRun]
|
[UninstallRun]
|
||||||
Filename: "{app}\{#MyAppExeName}"; Flags: runascurrentuser runhidden; Parameters: "--reg-file-assoc unregister"
|
Filename: "{app}\{#MyAppExeName}"; Flags: runascurrentuser runhidden; Parameters: "--reg-file-assoc unreg"
|
||||||
52
setup.ps1
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
function CheckExitCode {
|
||||||
|
if ($LastExitCode -gt 0)
|
||||||
|
{
|
||||||
|
Write-Host "`nExit code $LastExitCode was returned.`n" -ForegroundColor Red
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
|
||||||
|
|
||||||
|
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x64
|
||||||
|
|
||||||
|
CheckExitCode
|
||||||
|
|
||||||
|
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x86
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
$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
|
||||||
|
|
||||||
|
$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
|
||||||