Compare commits

..

25 Commits

Author SHA1 Message Date
Frank Skare
660345d18a update script change 2019-11-17 14:49:42 +01:00
Frank Skare
3844db6e79 5.4.4.0 2019-11-17 14:40:08 +01:00
Frank Skare
5374e20757 update changelog 2019-11-15 16:44:20 +01:00
Frank Skare
bc6167c4ee new libmpv added to changelog 2019-11-15 16:41:37 +01:00
stax76
7979f77284 Merge pull request #117 from Restia666Ashdoll/patch-2
Update Changelog.md
2019-11-14 14:22:57 +01:00
Restia666Ashdoll
71b90ed5cb Update Changelog.md 2019-11-13 21:29:08 +00:00
Frank Skare
9d2e236b3e update csproj 2019-11-13 18:33:20 +01:00
Frank Skare
d42657a3f0 release script added 2019-11-13 18:23:55 +01:00
Frank Skare
e4818fae18 update script added to csproj 2019-11-13 15:01:08 +01:00
Frank Skare
7b39bfcbc4 forecolors in the dark theme are slightly darker now 2019-11-13 14:56:36 +01:00
Frank Skare
fd6f3c94dd manual update 2019-11-13 13:55:50 +01:00
Frank Skare
dd10c07fb5 manual update 2019-11-13 13:41:14 +01:00
Frank Skare
3bbfdcffdd manual update 2019-11-13 13:36:21 +01:00
Frank Skare
6b7c4e1724 readme and manual update 2019-11-13 13:28:06 +01:00
Frank Skare
d3ad1091ec manual update 2019-11-12 22:03:05 +01:00
Frank Skare
65177c448b update manual 2019-11-12 21:57:07 +01:00
Frank Skare
1cdecb3810 manual update 2019-11-12 21:52:38 +01:00
Frank Skare
20ea755a93 update check and update routine 2019-11-12 21:50:38 +01:00
stax76
3b7bc95869 Merge pull request #115 from Restia666Ashdoll/patch-1
Wrong Chocolatey install method
2019-11-10 23:25:34 +01:00
Frank Skare
5380daad53 Merge branch 'master' of https://github.com/stax76/mpv.net 2019-11-10 23:22:23 +01:00
Frank Skare
a5f4d848d4 changelog and update check 2019-11-10 23:22:20 +01:00
Restia666Ashdoll
cf0f9bfa01 Update README.md 2019-11-10 22:20:09 +00:00
stax76
68461e05da Merge pull request #114 from Restia666Ashdoll/patch-2
Scoop and Chocolatey installation method in README.md
2019-11-10 23:13:59 +01:00
Restia666Ashdoll
397b988851 Update README.md 2019-11-11 03:29:14 +05:30
Frank Skare
eddb95e791 often the OSC was shown when fullscreen was entered 2019-11-02 11:39:15 +01:00
26 changed files with 631 additions and 389 deletions

View File

@@ -1,4 +1,27 @@
### 5.4.4.0
- new: forecolors in the dark theme are slightly darker now
- new: readme/website and manual were improved
- new: source code includes now the release script to build the archives and setup files
- new: the history feature now uses the full path
- new: install via Scoop and Chocolatey added to readme/website (Restia666Ashdoll)
- new: update check, it must be enabled first in the conf editor under General
- new: update feature, requires PowerShell 5 and curl,
an up to date Windows 10 system has both included.
Main menu (input.conf) must be reset or updated manually ([defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt))
- update: libmpv shinchiro 2019-11-10
- fix: often the OSC was shown when fullscreen was entered
or on app startup, this is now suppressed
- fix: the file association routine uses no longer 'Play with mpv.net' for the
default open verb caption because it doesn't support multi selection,
it shows now only Open, the manual explains how to get multi selection
in File Explorer, read about it [here](https://github.com/stax76/mpv.net/blob/master/Manual.md#open-with)
- fix: x86 builds had an older version included because
of a misconfiguration in the solution file
### 5.4.3.0
- new: the color themes can now be customized ([manual](https://github.com/stax76/mpv.net/blob/master/Manual.md#color-theme))
@@ -219,7 +242,7 @@
- fix for middle mouse button not working
- fix of logo overlay using a huge amount of memory (thx for the [ghacks article](https://www.ghacks.net/2019/07/05/a-look-at-mpv-net-a-mpv-frontend-with-everything-integration/))
- fix config dialog showing a message about app restart without reason
- when multiple files are selected in Windows File Explorer and enter is
- when multiple files are selected in File Explorer and enter is
pressed, the files are opened as selected, the order is random though
because Explorer starts multiple mpv.net processes concurrently
- libmpv was updated to shinchiro 2019-06-30
@@ -234,7 +257,7 @@
- opening a URL manually no longer uses a input box but uses the clipboard directly
- the manifest was missing the company attribute which caused
mpv.net not appearing in the 'Open with' menu of the Windows File Explorer,
mpv.net not appearing in the 'Open with' menu of the File Explorer,
thanks to 44vince44 for pointing this out!!!
- new Python and C# script examples were added to the wiki and the scripting and
extension documentation was improved

View File

@@ -1,7 +1,7 @@
MIT License
Copyright 2002-2017 Frank Skare (stax76)
Copyright (c) 2002-2017 Frank Skare (stax76)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and ssociated documentation

263
Manual.md
View File

@@ -7,6 +7,15 @@
* [Requirements](#requirements)
* [Installation](#installation)
+ [File Associations](#file-associations)
* [External Tools](#external-tools)
+ [Play with mpv](#play-with-mpv)
+ [External Application Button](#external-application-button)
+ [Open with++](#open-with)
+ [MediaInfo.NET](#mediainfonet)
* [Command Line Interface](#command-line-interface)
* [Terminal](#terminal)
* [Color Theme](#color-theme)
* [Hidden and secret features](#hidden-and-secret-features)
* [Context Menu](#context-menu)
+ [Open > Open Files](#open--open-files)
+ [Open > Open URL](#open--open-url)
@@ -78,72 +87,158 @@
+ [Tools > Show History](#tools--show-history)
+ [Tools > Set/clear A-B loop points](#tools--set-clear-a-b-loop-points)
+ [Tools > Toggle infinite file looping](#tools--toggle-infinite-file-looping)
+ [Tools > Cycle Hardware Decoding](#tools--cycle-hardware-decoding)
+ [Tools > Execute mpv command](#tools--execute-mpv-command)
+ [Tools > Manage File Associations](#tools--manage-file-associations)
+ [Tools > Toggle Hardware Decoding](#tools--toggle-hardware-decoding)
+ [Tools > Show REPL](#tools--show-repl)
+ [Tools > OS Setup](#tools--os-setup)
+ [Help > Show mpv manual](#help--show-mpv-manual)
+ [Help > Show mpv default keys](#help--show-mpv-default-keys)
+ [Help > Show mpv.net default keys](#help--show-mpvnet-default-keys)
+ [Help > Show mpv.net manual](#help--show-mpvnet-manual)
+ [Help > Check for Updates](#help--check-for-updates)
+ [Help > About mpv.net](#help--about-mpvnet)
+ [Exit](#exit)
+ [Exit Watch Later](#exit-watch-later)
* [External Tools](#external-tools)
+ [Play with mpv](#play-with-mpv)
+ [External Application Button](#external-application-button)
+ [Open with++](#open-with)
+ [MediaInfo.NET](#mediainfonet)
* [Command Line Interface](#command-line-interface)
* [Color Theme](#color-theme)
* [Hidden and secret features](#hidden-and-secret-features)
## About mpv.net
mpv.net is a modern media player for Windows. mpv is similar to VLC not based on DirectShow like MPC, mpv.net is based on libmpv which in return is based on ffmpeg.
mpv.net is a modern desktop media player for Windows. mpv is similar to VLC not based on DirectShow like MPC, mpv.net is based on libmpv which in return is based on ffmpeg.
libmpv provides the majority of the features of the mpv media player, a fork of mplayer. mpv focuses on the usage of the command line interface, mpv.net retains the ability to be used from the command line and adds a modern GUI on top of it.
mpv.net is meant to be a small single person project, it's designed to be mpv compatible, can use the same settings as mpv and offers almost all mpv features because they are all contained in libmpv, this means the official [mpv manual](https://mpv.io/manual/master/) fully applies to mpv.net.
mpv.net is designed to be mpv compatible, almost all mpv features are available because they are all contained in libmpv, this means the official [mpv manual](https://mpv.io/manual/master/) applies to mpv.net.
### Target Audience
The target audience of mpv.net are programmers, nerds and software enthusiasts that need something more advanced than typical media players.
Furthermore mpv.net is well suited for people who are interested to learn mpv.
The target audience of mpv and mpv.net are programmers, nerds and software enthusiasts that need a desktop player that is more advanced than a normal desktop player. mpv.net is very similar to mpv so it's well suited to learn mpv.
## Requirements
mpv.net is based on the .NET Framework and requires Windows 7 as minimum version of the Windows operating system. As of the writing of this manual the minimum required .NET Framework version is 4.8.
For optimal results a modern graphics card is recommended.
mpv.net requires minimum .NET Framework 4.8 and Windows 7. For optimal results a modern graphics card is recommended.
## Installation
mpv.net is available as setup and as portable download in the 7zip and zip archive format, to unpack the portable download 7zip can be used, it is available at www.7-zip.org.
mpv.net is available as setup and as portable download in the 7zip and Zip archive format, to unpack the portable download 7zip can be used, it is available at www.7-zip.org.
If you are new to mpv.net the portable download is recommended, for regular mpv.net users the setup is typically more easy to use.
The x64 editions require more memory and have the advantage of decoders being typically first and better optimized for x64.
The x64 editions require more memory and have the advantage of being typically first and better optimized for x64.
x86 should though still be well supported and work but it's not as well tested than x64.
x86 (32-bit) is not recommended but should still be well supported and work but it's not as well tested as x64.
Stable releases are compiled from the source and can be downloaded from the releases tab:
<https://github.com/stax76/mpv.net/releases>
Scoop can be used to install and update it:
```
scoop bucket add extras
scoop install mpv.net
```
Alternatively, Chocolatey can also be used:
`choco install mpvnet.install`
### File Associations
File Associations can be created using the setup or with the context menu under 'Tools > OS Setup'.
Windows 10 prevents apps to register as the default app, to define the default video or audio player app in Windows 10 go to the Windows settings under 'Settings > Apps > Default apps' or shell execute 'ms-settings:defaultapps'.
After the file associations were registered go to the Windows settings under 'Settings > Apps > Default apps' or shell execute `ms-settings:defaultapps` and choose mpv.net as default app for Video and optionally for Audio and Images.
It's also possible to change the default application using the 'Open with' feature of the context menu in Windows File Explorer.
It's also possible to change the default application using the 'Open with' feature of the context menu in File Explorer.
[Open with++](#open-with) can be used to extend the File Explorer context menu to get menu items for 'Play with mpv.net' and 'Add to mpv.net playlist'.
## External Tools
### Play with mpv
In order to play videos from sites such as YouTube the Chrome Extension [Play with mpv](https://chrome.google.com/webstore/detail/play-with-mpv/hahklcmnfgffdlchjigehabfbiigleji) can be used.
Due to Chrome Extensions not being able to start a app, another app that communicates with the extension is required, this app can be downloaded [here](http://www.mediafire.com/file/lezj8lwqt5zf75v/play-with-mpvnet-server.7z/file). The extension works only when the app is running, to have the app always running a link can be created in the auto start folder located at:
`C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`
This will start the app on system start and have it running in the background. When the file association registration of mpv.net was executed then the app should find the location of mpv.net, alternativly the mpv.net folder can be added to the Path environment variable.
### External Application Button
Alternatively the Chrome extension [External Application Button](https://github.com/stax76/mpv.net/issues/106) can be used.
### Open with++
Open with++ allows to customize the File Explorer context menu to add menu items 'Play with mpv.net' and 'Add to mpv.net playlist'.
https://github.com/stax76/OpenWithPlusPlus
https://github.com/stax76/OpenWithPlusPlus#mpvnet
https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist
### MediaInfo.NET
MediaInfo.NET is a media info GUI.
https://github.com/stax76/MediaInfo.NET
To start a external application mpv has the run input command (it does not use the shell).
If the path has spaces then it must be enclosed in quotes and then double backslashes must be used for escaping or alternatively forward slashes.
`_ run D:\Software\MediaInfoNET.exe "${path}" #menu: Tools > Open file with MediaInfo.NET`
`_ run "D:\\Soft ware\\MediaInfoNET.exe" "${path}" #menu: Tools > Open file with MediaInfo.NET`
`_ run "D:/Soft ware/MediaInfoNET.exe" "${path}" #menu: Tools > Open file with MediaInfo.NET`
## Command Line Interface
mpvnet implements a command line interface to set mpv commands.
Supported are all mpv properties which are documented at:
<https://mpv.io/manual/master>
Example:
`mpvnet --mute=yes <file|URL>`
## Terminal
When mpv.net is started from a PowerShell terminal it will attach to the terminal and print status and debug messages.
Certain error and debug messages are only visible on the terminal, JavaScript and Lua scripts must be debugged with the terminal as there is no support for a debugger.
## Color Theme
mpv.net supports custom color themes, the definition of the built-in themes can be found at:
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/theme.txt>
Custom themes can be saved at:
`<conf folder>\theme.conf`
The theme.conf file may contain an unlimited amount of themes.
In the config editor under UI there are the settings dark-theme and light-theme to define the themes used in dark and in light mode.
## Hidden and secret features
Selecting multiple files in File Explorer and pressing enter will open the files in mpv.net. Explorer restricts this to maximum 15 files and the order will be random.
Whenever the control key is pressed when files or URLs are opened, the playlist is not cleared but the files or URLs are appended to the playlist. This works in all mpv.net features that open files or URLs.
Pressing the shift key while opening a single file will suppress loading all files in the folder.
## Context Menu
The most important part of the user interface in mpv.net is the context menu, the menu can be customized as it's defined in the same file where the key bindings are defined.
The most important part of the user interface in mpv.net is the context menu, the menu can be customized as it's defined in the same file where the key and mouse bindings are defined (input.conf).
### Open > Open Files
The Open Files menu entry is one way to open files in mpv.net, it supports multi selection.
Another way to open files is the command line, it is used by the Windows File Explorer if file associations exist.
Another way to open files is the command line, it is used by the File Explorer if file associations exist.
When mpv.net is started from a terminal such as PowerShell, mpv.net attaches to the terminal and outputs status and debug messages.
@@ -725,13 +820,13 @@ mpv.conf file containing mpv settings
mpvnet.conf file containing mpv.net settings
input.conf containing mpv key bindings
input.conf containing mpv key and mouse bindings
User scripts and user extensions
### Tools > Command Palette
Shows the command palette window which allows to find mpv.net commands, it shows the command's location in the context menu and the key shortcut.
Shows the command palette window which allows to quickly find and execute commands and key shortcuts.
### Tools > Show History
@@ -755,7 +850,7 @@ cycle-values loop-file "inf" "no"
[loop-file command](https://mpv.io/manual/master/#options-loop)
### Tools > Cycle Hardware Decoding
### Tools > Toggle Hardware Decoding
Cycles the hwdec property to enable/disable hardware decoding using the following command:
@@ -765,11 +860,13 @@ Cycles the hwdec property to enable/disable hardware decoding using the followin
[hwdec property](https://mpv.io/manual/master/#options-hwdec)
### Tools > Execute mpv command
### Tools > Show REPL
Allows to execute mpv commands.
Shows a on screen REPL.
### Tools > Manage File Associations
https://github.com/rossy/mpv-repl
### Tools > OS Setup
Allows to manage file associations.
@@ -777,25 +874,23 @@ Allows to manage file associations.
Shows the [mpv manual](https://mpv.io/manual/stable/).
### Help > Show mpv default keys
### Help > Show mpv.net web site
Shows the [mpv default keys](https://github.com/mpv-player/mpv/blob/master/etc/input.conf)
### Help > Show mpv.net default keys
Shows the [mpv.net default keys](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt)
Help > Show mpv.net web site
Shows the [mpv.net web site](https://mpv-net.github.io/mpv.net-web-site/)
Shows the [mpv.net web site](https://mpv-net.github.io/mpv.net-web-site/).
### Help > Show mpv.net manual
Shows the [mpv.net manual](https://github.com/stax76/mpv.net/blob/master/Manual.md)
Shows the [mpv.net manual](https://github.com/stax76/mpv.net/blob/master/Manual.md).
### Help > Check for Updates
Checks for updates and allows to execute the update routine.
The update routine requires PowerShell 5 and curl, an up to date Windows 10 system has both included.
### Help > About mpv.net
Shows the mpv.net about dialog.
Shows the mpv.net about dialog which shows a copyright notice, the versions of mpv.net and libmpv and a license notice (MIT).
### Exit
@@ -812,79 +907,3 @@ Exits mpv.net and remembers the position in the file using the following command
`quit-watch-later`
[quit-watch-later command](https://mpv.io/manual/master/#command-interface-quit-watch-later)
## External Tools
### Play with mpv
In order to play videos from sites such as YouTube the Chrome Extension [Play with mpv](https://chrome.google.com/webstore/detail/play-with-mpv/hahklcmnfgffdlchjigehabfbiigleji) can be used.
Due to Chrome Extensions not being able to start a app, another app that communicates with the extension is required, this app can be downloaded [here](http://www.mediafire.com/file/lezj8lwqt5zf75v/play-with-mpvnet-server.7z/file). The extension works only when the app is running, to have the app always running a link can be created in the auto start folder located at:
`C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`
This will start the app on system start and have it running in the background. When the file association registration of mpv.net was executed then the app should find the location of mpv.net, alternativly the mpv.net folder can be added to the PATH environment variable.
### External Application Button
Alternatively the Chrome extension [External Application Button](https://github.com/stax76/mpv.net/issues/106) can be used.
### Open with++
Open with++ allows to customize the File Explorer context menu for instance to add a 'Add to mpv.net playlist' menu item.
https://github.com/stax76/OpenWithPlusPlus
https://github.com/stax76/OpenWithPlusPlus#mpvnet
https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist
### MediaInfo.NET
MediaInfo.NET is a media info GUI.
https://github.com/stax76/MediaInfo.NET
To start a external application mpv has the run input command (it does not use the shell).
If the path has spaces then it must be enclosed in quotes and then double backslashes must be used for escaping or alternatively forward slashes.
`_ run D:\Software\MediaInfoNET.exe "${path}" #menu: Tools > Open file with MediaInfo.NET`
`_ run "D:\\Soft ware\\MediaInfoNET.exe" "${path}" #menu: Tools > Open file with MediaInfo.NET`
`_ run "D:/Soft ware/MediaInfoNET.exe" "${path}" #menu: Tools > Open file with MediaInfo.NET`
## Command Line Interface
mpvnet implements a command line interface to set mpv commands.
Supported are all mpv properties which are documented at:
<https://mpv.io/manual/master>
Example:
`mpvnet --mute=yes <file|URL>`
## Color Theme
mpv.net supports custom color themes, the definition of the built-in themes can be found at:
<https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/theme.txt>
Custom themes can be saved at:
`<conf folder>\theme.conf`
The theme.conf file may contain an unlimited amount of themes.
In the config editor under UI there are the settings dark-theme and light-theme to define the themes used in dark and in light mode.
## Hidden and secret features
Selecting multiple files in File Explorer and pressing enter will open the files in mpv.net. Explorer restricts this to maximum 15 files and the order will be random.
Whenever the control key is pressed when files or URLs are opened, the playlist is not cleared but the files or URLs are appended to the playlist. This works in all mpv.net features that open files or URLs.
Pressing the shift key while opening a single file will suppress loading all files in the folder.

View File

@@ -6,9 +6,9 @@
mpv.net is a modern media player for Windows that works just like [mpv](https://mpv.io).
#### Based on libmpv
#### Graphical User Interface
mpv.net is based on libmpv which offers a straightforward C API that was designed from the ground up to make mpv usable as a library and facilitate easy integration into other applications. mpv is like vlc not based on DirectShow or Media Foundation.
Modern GUI that supports customizable color themes.
#### Command Line Interface
@@ -30,11 +30,16 @@ libmpv leverages the FFmpeg hwaccel APIs to support DXVA2 video decoding acceler
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)!
#### Based on libmpv
mpv.net is based on libmpv which offers a straightforward C API that was designed from the ground up to make mpv usable as a library and facilitate easy integration into other applications. mpv is like vlc not based on DirectShow or Media Foundation.
Table of contents
-----------------
- [Features](#features)
- [Screenshots](#screenshots)
- [Installation](#installation)
- [Manual](#manual)
- [Context Menu](#context-menu)
- [Settings](#settings)
@@ -44,7 +49,6 @@ Table of contents
- [Support](#support)
- [Links](#links)
- [Changelog](#changelog)
- [Download](#download)
### Features
@@ -54,13 +58,13 @@ Table of contents
- Customizable context menu defined in the same file as the key bindings ([Screenshot](#context-menu-screenshot), [Defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt))
- Searchable config dialog ([Screenshot](#config-editor-screenshot), [Defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt))
- Searchable input (key/mouse) binding editor ([Screenshot](#input-editor-screenshot), [Defaults](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt))
- Configuration files that are easy to read and edit
- Searchable command palette to quickly launch commands and look for keys ([Screenshot](#command-palette-screenshot))
- Modern WPF based graphical user interface with dark mode ([Screenshot](#config-editor-screenshot))
- Extension API for .NET languages
- Configuration files that are easy to read and edit ([Manual](https://mpv.io/manual/master/#configuration-files))
- Searchable command palette to quickly find commands and keys ([Screenshot](#command-palette-screenshot))
- Modern graphical user interface with customizable color themes ([Screenshot](#config-editor-screenshot))
- [Extension API for .NET languages (C#, VB.NET and F#)](https://github.com/stax76/mpv.net/wiki/Extensions)
- Scripting API for Python, C#, Lua, JavaScript and PowerShell ([Wiki](https://github.com/stax76/mpv.net/wiki/Scripting))
- Language agnostic JSON IPC to control the player with a external programs
- On Screen Controler (OSC, play control buttons)
- On Screen Controler (OSC, play control buttons) ([Screenshot](#main-window-screenshot))
- [Command Line Interface](https://mpv.io/manual/master/#options)
- If started from a PowerShell terminal mpv.net will attach to the terminal and print status and debug output ([Screenshot](#terminal-and-repl-screenshot))
- [OSD REPL](https://github.com/rossy/mpv-repl)
@@ -81,7 +85,8 @@ Table of contents
- File history feature to log time and filename
- A-B loop feature
- Watch later feature to save the position
- Files can be enqueued from Explorer using the shell extension [Open with++](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist) and the --queue switch
- Files can be enqueued from File Explorer ([Manual](Manual.md#open-with))
- Update check and update routine ([Manual](Manual.md#help--check-for-updates))
- [Manual](#manual)
### Screenshots
@@ -127,6 +132,25 @@ Media search feature powered by [Everything](https://www.voidtools.com) to find
![Media Search](https://raw.githubusercontent.com/stax76/mpv.net/master/img/MediaSearch.png)
### Installation
mpv.net requires minimum .NET Framework 4.8 and Windows 7. For optimal results a modern graphics card is recommended.
Stable releases are compiled from the source and can be downloaded from the releases tab:
<https://github.com/stax76/mpv.net/releases>
Scoop can be used to install and update it:
```
scoop bucket add extras
scoop install mpv.net
```
Alternatively, Chocolatey can also be used:
`choco install mpvnet.install`
### Manual
[Manual](Manual.md)
@@ -257,7 +281,3 @@ If you want to support the development of mpv.net or express your appreciation y
### Changelog
[Changelog](Changelog.md)
### Download
<https://github.com/stax76/mpv.net/releases>

66
Release.ps1 Normal file
View File

@@ -0,0 +1,66 @@
$ErrorActionPreference = 'Stop'
$desktopDir = [Environment]::GetFolderPath('Desktop')
$exePath = (Get-Location).Path + '\mpv.net\bin\x64\mpvnet.exe'
$version = [Reflection.Assembly]::LoadFile($exePath).GetName().Version
$msbuild = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe'
$iscc = 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe'
$7z = 'C:\Program Files\7-Zip\7z.exe'
if ($version.Revision -ne 0)
{
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x64
if ($LastExitCode) { throw $LastExitCode }
$targetDir = "$desktopDir\mpv.net-portable-x64-$version-beta"
Copy-Item .\mpv.net\bin\x64 $targetDir -Recurse -Exclude System.Management.Automation.xml
& $7z a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"
if ($LastExitCode) { throw $LastExitCode }
$targetDirectories = 'C:\Users\frank\OneDrive\StaxRip\TestBuilds\',
'C:\Users\frank\Dropbox\public\StaxRip\Builds\'
foreach ($dir in $targetDirectories)
{
if (Test-Path $dir)
{
Copy-Item ($targetDir + '.7z') ($dir + (Split-Path $targetDir -Leaf) + '.7z')
Invoke-Item $dir
}
}
}
else
{
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x64
if ($LastExitCode) { throw $LastExitCode }
& $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x86
if ($LastExitCode) { throw $LastExitCode }
& $iscc /Darch=x64 setup.iss
if ($LastExitCode) { throw $LastExitCode }
& $iscc /Darch=x86 setup.iss
if ($LastExitCode) { throw $LastExitCode }
$targetDir = $desktopDir + "\mpv.net-portable-x64-$version"
Copy-Item .\mpv.net\bin\x64 $targetDir -Recurse -Exclude System.Management.Automation.xml
& $7z a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"
if ($LastExitCode) { throw $LastExitCode }
& $7z a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*"
if ($LastExitCode) { throw $LastExitCode }
$targetDir = $desktopDir + "\mpv.net-portable-x86-$version"
Copy-Item .\mpv.net\bin\x86 $targetDir -Recurse -Exclude System.Management.Automation.xml
& $7z a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*"
if ($LastExitCode) { throw $LastExitCode }
& $7z a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*"
if ($LastExitCode) { throw $LastExitCode }
}
Write-Host 'successfully finished' -ForegroundColor Green

View File

@@ -19,24 +19,24 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{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|x86.ActiveCfg = Debug|x64
{1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.Build.0 = Debug|x64
{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}.Release|x64.ActiveCfg = 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.Build.0 = Release|x86
{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|x86.ActiveCfg = Debug|x64
{55C88710-539D-4402-84C8-31694841C731}.Debug|x86.Build.0 = Debug|x64
{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}.Release|x64.ActiveCfg = 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.Build.0 = Release|x86
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x64.ActiveCfg = Debug|x64
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x64.Build.0 = Debug|x64
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.ActiveCfg = Debug|x64
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.Build.0 = Debug|x64
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.ActiveCfg = Debug|x86
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.Build.0 = Debug|x86
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Release|x64.ActiveCfg = Release|x64
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Release|x64.Build.0 = Release|x64
{94255EF2-C823-4D82-9017-0E993CC0F5A1}.Release|x86.ActiveCfg = Release|x86

View File

@@ -29,6 +29,7 @@ namespace mpvnet
public static bool RememberVolume { get; set; } = true;
public static bool AutoLoadFolder { get; set; } = true;
public static bool Queue { get; set; }
public static bool UpdateCheck { get; set; }
public static int StartThreshold { get; set; } = 1500;
public static int RecentCount { get; set; } = 15;
@@ -47,17 +48,22 @@ namespace mpvnet
var dummy2 = mp.Conf;
foreach (var i in Conf)
ProcessProperty(i.Key, i.Value);
ProcessProperty(i.Key, i.Value, true);
if (App.DebugMode)
{
try
{
string filePath = mp.ConfigFolder + "mpvnet-debug.log";
if (File.Exists(filePath)) File.Delete(filePath);
if (File.Exists(filePath))
File.Delete(filePath);
Trace.Listeners.Add(new TextWriterTraceListener(filePath));
Trace.AutoFlush = true;
//if (App.DebugMode) Trace.WriteLine("");
//if (App.DebugMode)
// Trace.WriteLine("");
}
catch (Exception e)
{
@@ -83,8 +89,8 @@ namespace mpvnet
{
if (RememberVolume)
{
mp.set_property_int("volume", RegHelp.GetInt(App.RegPath, "Volume", 70));
mp.set_property_string("mute", RegHelp.GetString(App.RegPath, "Mute", "no"));
mp.set_property_int("volume", RegistryHelp.GetInt(App.RegPath, "Volume", 70));
mp.set_property_string("mute", RegistryHelp.GetString(App.RegPath, "Mute", "no"));
}
}
@@ -92,8 +98,8 @@ namespace mpvnet
{
if (RememberVolume)
{
RegHelp.SetObject(App.RegPath, "Volume", mp.get_property_int("volume"));
RegHelp.SetObject(App.RegPath, "Mute", mp.get_property_string("mute"));
RegistryHelp.SetValue(App.RegPath, "Volume", mp.get_property_int("volume"));
RegistryHelp.SetValue(App.RegPath, "Mute", mp.get_property_string("mute"));
}
}
@@ -114,26 +120,30 @@ namespace mpvnet
}
}
public static bool ProcessProperty(string name, string value)
public static bool ProcessProperty(string name, string value, bool writeError = false)
{
switch (name)
{
case "remember-position": RememberPosition = value == "yes"; return true;
case "maximized": Maximized = value == "yes"; return true;
case "debug-mode": DebugMode = value == "yes"; return true;
case "remember-volume": RememberVolume = value == "yes"; return true;
case "queue": Queue = value == "yes"; return true;
case "auto-load-folder": AutoLoadFolder = value == "yes"; return true;
case "update-check": UpdateCheck = value == "yes"; return true;
case "start-size": RememberHeight = value == "previous"; return true;
case "process-instance": ProcessInstance = value; return true;
case "dark-mode": DarkMode = value; return true;
case "debug-mode": DebugMode = value == "yes"; return true;
case "remember-volume": RememberVolume = value == "yes"; return true;
case "start-threshold": StartThreshold = value.Int(); return true;
case "minimum-aspect-ratio": MinimumAspectRatio = value.Float(); return true;
case "auto-load-folder": AutoLoadFolder = value == "yes"; return true;
case "recent-count": RecentCount = value.Int(); return true;
case "queue": Queue = value == "yes"; return true;
case "minimum-aspect-ratio": MinimumAspectRatio = value.Float(); return true;
case "dark-theme": DarkTheme = value.Trim('\'', '"'); return true;
case "light-theme": LightTheme = value.Trim('\'', '"'); return true;
default:
if (writeError)
ConsoleHelp.WriteError($"unknown mpvnet.conf property: {name}");
return false;
}
return false;
}
}
}

View File

@@ -1,4 +1,5 @@
using System;

using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -17,6 +18,7 @@ namespace mpvnet
switch (id)
{
case "open-files": OpenFiles(args); break;
case "update-check": UpdateCheck.CheckOnline(true); break;
case "open-url": OpenURL(); break;
case "open-optical-media": Open_DVD_Or_BD_Folder(); break;
case "manage-file-associations": // deprecated 2019
@@ -201,9 +203,9 @@ namespace mpvnet
public static void ExecuteMpvCommand() // deprecated 2019
{
InvokeOnMainThread(new Action(() => {
string command = VB.Interaction.InputBox("Enter a mpv command to be executed.", "Execute Command", RegHelp.GetString(App.RegPath, "RecentExecutedCommand"));
string command = VB.Interaction.InputBox("Enter a mpv command to be executed.", "Execute Command", RegistryHelp.GetString(App.RegPath, "RecentExecutedCommand"));
if (string.IsNullOrEmpty(command)) return;
RegHelp.SetObject(App.RegPath, "RecentExecutedCommand", command);
RegistryHelp.SetValue(App.RegPath, "RecentExecutedCommand", command);
mp.command(command, false);
}));
}

View File

@@ -1,11 +1,14 @@
using System;

using System;
using System.Diagnostics;
class ConsoleHelp
{
public static void WriteError(object obj)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(obj?.ToString());
Console.WriteLine(obj);
Console.ResetColor();
Trace.WriteLine(obj);
}
}

View File

@@ -28,20 +28,6 @@ namespace mpvnet
return (int)value == 0;
}
}
public static bool IsDirectoryWritable(string dirPath)
{
try
{
using (FileStream fs = File.Create(Path.Combine(dirPath,
Path.GetRandomFileName()), 1, FileOptions.DeleteOnClose))
{ }
return true;
}
catch
{ }
return false;
}
}
public class StringLogicalComparer : IComparer, IComparer<string>
@@ -66,108 +52,51 @@ namespace mpvnet
{
Types = types;
RegHelp.SetObject(@"HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename, null, ExePath);
RegHelp.SetObject(@"HKCR\Applications\" + ExeFilename, "FriendlyAppName", "mpv.net media player");
RegHelp.SetObject($@"HKCR\Applications\{ExeFilename}\shell\open\command", null, $"\"{ExePath}\" \"%1\"");
RegHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationDescription", "mpv.net media player");
RegHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationName", "mpv.net");
RegHelp.SetObject(@"HKCR\SystemFileAssociations\video\OpenWithList\" + ExeFilename, null, "");
RegHelp.SetObject(@"HKCR\SystemFileAssociations\audio\OpenWithList\" + ExeFilename, null, "");
RegHelp.SetObject(@"HKLM\SOFTWARE\RegisteredApplications", "mpv.net", @"SOFTWARE\Clients\Media\mpv.net\Capabilities");
RegistryHelp.SetValue(@"HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename, null, ExePath);
RegistryHelp.SetValue(@"HKCR\Applications\" + ExeFilename, "FriendlyAppName", "mpv.net media player");
RegistryHelp.SetValue($@"HKCR\Applications\{ExeFilename}\shell\open\command", null, $"\"{ExePath}\" \"%1\"");
RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationDescription", "mpv.net media player");
RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationName", "mpv.net");
RegistryHelp.SetValue(@"HKCR\SystemFileAssociations\video\OpenWithList\" + ExeFilename, null, "");
RegistryHelp.SetValue(@"HKCR\SystemFileAssociations\audio\OpenWithList\" + ExeFilename, null, "");
RegistryHelp.SetValue(@"HKLM\SOFTWARE\RegisteredApplications", "mpv.net", @"SOFTWARE\Clients\Media\mpv.net\Capabilities");
foreach (string ext in Types)
{
RegHelp.SetObject($@"HKCR\Applications\{ExeFilename}\SupportedTypes", "." + ext, "");
RegHelp.SetObject($@"HKCR\" + "." + ext, null, ExeFilenameNoExt + "." + ext);
RegHelp.SetObject($@"HKCR\" + "." + ext + @"\OpenWithProgIDs", ExeFilenameNoExt + "." + ext, "");
RegistryHelp.SetValue($@"HKCR\Applications\{ExeFilename}\SupportedTypes", "." + ext, "");
RegistryHelp.SetValue($@"HKCR\" + "." + ext, null, ExeFilenameNoExt + "." + ext);
RegistryHelp.SetValue($@"HKCR\" + "." + ext + @"\OpenWithProgIDs", ExeFilenameNoExt + "." + ext, "");
if (App.VideoTypes.Contains(ext))
RegHelp.SetObject(@"HKCR\" + "." + ext, "PerceivedType", "video");
RegistryHelp.SetValue(@"HKCR\" + "." + ext, "PerceivedType", "video");
if (App.AudioTypes.Contains(ext))
RegHelp.SetObject(@"HKCR\" + "." + ext, "PerceivedType", "audio");
RegistryHelp.SetValue(@"HKCR\" + "." + ext, "PerceivedType", "audio");
if (App.ImageTypes.Contains(ext))
RegHelp.SetObject(@"HKCR\" + "." + ext, "PerceivedType", "image");
RegistryHelp.SetValue(@"HKCR\" + "." + ext, "PerceivedType", "image");
RegHelp.SetObject($@"HKCR\" + ExeFilenameNoExt + "." + ext + @"\shell\open", null, "Play with " + Application.ProductName);
RegHelp.SetObject($@"HKCR\" + ExeFilenameNoExt + "." + ext + @"\shell\open\command", null, $"\"{ExePath}\" \"%1\"");
RegHelp.SetObject(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities\FileAssociations", "." + ext, ExeFilenameNoExt + "." + ext);
RegistryHelp.SetValue($@"HKCR\" + ExeFilenameNoExt + "." + ext + @"\shell\open\command", null, $"\"{ExePath}\" \"%1\"");
RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities\FileAssociations", "." + ext, ExeFilenameNoExt + "." + ext);
}
}
public static void Unregister()
{
RegHelp.RemoveKey($@"HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename);
RegHelp.RemoveKey($@"HKCR\Applications\" + ExeFilename);
RegHelp.RemoveKey($@"HKLM\SOFTWARE\Clients\Media\mpv.net");
RegHelp.RemoveKey($@"HKCR\SystemFileAssociations\video\OpenWithList\" + ExeFilename);
RegHelp.RemoveKey($@"HKCR\SystemFileAssociations\audio\OpenWithList\" + ExeFilename);
RegHelp.RemoveValue(@"HKLM\SOFTWARE\RegisteredApplications", "mpv.net");
RegistryHelp.RemoveKey($@"HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename);
RegistryHelp.RemoveKey($@"HKCR\Applications\" + ExeFilename);
RegistryHelp.RemoveKey($@"HKLM\SOFTWARE\Clients\Media\mpv.net");
RegistryHelp.RemoveKey($@"HKCR\SystemFileAssociations\video\OpenWithList\" + ExeFilename);
RegistryHelp.RemoveKey($@"HKCR\SystemFileAssociations\audio\OpenWithList\" + ExeFilename);
RegistryHelp.RemoveValue(@"HKLM\SOFTWARE\RegisteredApplications", "mpv.net");
foreach (string id in Registry.ClassesRoot.GetSubKeyNames())
{
if (id.StartsWith(ExeFilenameNoExt + "."))
Registry.ClassesRoot.DeleteSubKeyTree(id);
RegHelp.RemoveValue($@"HKCR\Software\Classes\{id}\OpenWithProgIDs", ExeFilenameNoExt + id);
RegHelp.RemoveValue($@"HKLM\Software\Classes\{id}\OpenWithProgIDs", ExeFilenameNoExt + id);
}
}
}
public class RegHelp
{
public static void SetObject(string path, string name, object value)
{
using (RegistryKey regKey = GetRootKey(path).CreateSubKey(path.Substring(5), RegistryKeyPermissionCheck.ReadWriteSubTree))
regKey.SetValue(name, value);
}
public static string GetString(string path, string name, string defaultValue = "")
{
object value = GetObject(path, name, defaultValue);
return !(value is string) ? defaultValue : value.ToString();
}
public static int GetInt(string path, string name, int defaultValue = 0)
{
object value = GetObject(path, name, defaultValue);
return !(value is int) ? defaultValue : (int)value;
}
public static object GetObject(string path, string name, object defaultValue = null)
{
using (RegistryKey regKey = GetRootKey(path).OpenSubKey(path.Substring(5)))
return regKey == null ? null : regKey.GetValue(name, defaultValue);
}
public static void RemoveKey(string path)
{
try
{
GetRootKey(path).DeleteSubKeyTree(path.Substring(5), false);
} catch { }
}
public static void RemoveValue(string path, string name)
{
try
{
using (RegistryKey regKey = GetRootKey(path).OpenSubKey(path.Substring(5), true))
if (regKey != null)
regKey.DeleteValue(name, false);
} catch {}
}
static RegistryKey GetRootKey(string path)
{
switch (path.Substring(0, 4))
{
case "HKLM": return Registry.LocalMachine;
case "HKCU": return Registry.CurrentUser;
case "HKCR": return Registry.ClassesRoot;
default: throw new Exception();
RegistryHelp.RemoveValue($@"HKCR\Software\Classes\{id}\OpenWithProgIDs", ExeFilenameNoExt + id);
RegistryHelp.RemoveValue($@"HKLM\Software\Classes\{id}\OpenWithProgIDs", ExeFilenameNoExt + id);
}
}
}
@@ -264,6 +193,7 @@ namespace mpvnet
}
}
// last change 2019
public static void MigrateCommands(CommandItem item)
{
switch (item.Command)
@@ -316,32 +246,6 @@ namespace mpvnet
public class Folder
{
public static string Startup { get; } = Application.StartupPath + "\\";
}
public class PathHelp
{
public static string GetBaseName(string value)
{
if (string.IsNullOrEmpty(value))
return "";
int index = value.IndexOf("/");
if (index > -1)
value = value.Substring(index + 1);
index = value.IndexOf("\\");
if (index > -1)
value = value.Substring(index + 1);
index = value.LastIndexOf(".");
if (index > -1)
value = value.Substring(0, index);
return value;
}
public static string Startup { get; } = Application.StartupPath + @"\";
}
}

View File

@@ -1,4 +1,5 @@
using System;

using System;
using System.Windows.Forms;
using System.Linq;
using System.Collections.Generic;

View File

@@ -0,0 +1,70 @@

using System;
using Microsoft.Win32;
using System.Windows.Forms;
public class RegistryHelp
{
public static string ApplicationKey { get; } = @"HKCU\Software\" + Application.ProductName;
public static void SetValue(string path, string name, object value)
{
using (RegistryKey regKey = GetRootKey(path).CreateSubKey(path.Substring(5), RegistryKeyPermissionCheck.ReadWriteSubTree))
regKey.SetValue(name, value);
}
public static string GetString(string path, string name, string defaultValue = "")
{
object value = GetValue(path, name, defaultValue);
return !(value is string) ? defaultValue : value.ToString();
}
public static int GetInt(string path, string name, int defaultValue = 0)
{
object value = GetValue(path, name, defaultValue);
return !(value is int) ? defaultValue : (int)value;
}
public static bool GetBool(string path, string name, bool defaultValue = false)
{
object val = GetValue(path, name, defaultValue);
return val is bool ? (bool)val : defaultValue;
}
public static object GetValue(string path, string name, object defaultValue = null)
{
using (RegistryKey regKey = GetRootKey(path).OpenSubKey(path.Substring(5)))
return regKey == null ? null : regKey.GetValue(name, defaultValue);
}
public static void RemoveKey(string path)
{
try
{
GetRootKey(path).DeleteSubKeyTree(path.Substring(5), false);
}
catch { }
}
public static void RemoveValue(string path, string name)
{
try
{
using (RegistryKey regKey = GetRootKey(path).OpenSubKey(path.Substring(5), true))
if (regKey != null)
regKey.DeleteValue(name, false);
}
catch { }
}
static RegistryKey GetRootKey(string path)
{
switch (path.Substring(0, 4))
{
case "HKLM": return Registry.LocalMachine;
case "HKCU": return Registry.CurrentUser;
case "HKCR": return Registry.ClassesRoot;
default: throw new Exception();
}
}
}

View File

@@ -0,0 +1,74 @@

using System;
using System.Diagnostics;
using System.Net.Http;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace mpvnet
{
class UpdateCheck
{
public static void DailyCheck()
{
if (App.UpdateCheck && RegistryHelp.GetInt(RegistryHelp.ApplicationKey, "UpdateCheckLast")
!= DateTime.Now.DayOfYear)
CheckOnline();
}
public static async void CheckOnline(bool showUpToDateMessage = false)
{
try
{
using (HttpClient client = new HttpClient())
{
RegistryHelp.SetValue(RegistryHelp.ApplicationKey, "UpdateCheckLast", DateTime.Now.DayOfYear);
client.DefaultRequestHeaders.Add("User-Agent", "mpv.net");
var response = await client.GetAsync("https://api.github.com/repos/stax76/mpv.net/releases/latest");
response.EnsureSuccessStatusCode();
string content = await response.Content.ReadAsStringAsync();
Match match = Regex.Match(content, @"""mpv\.net-portable-x64-([\d\.]+)\.7z""");
Version onlineVersion = Version.Parse(match.Groups[1].Value);
Version currentVersion = Assembly.GetEntryAssembly().GetName().Version;
if (onlineVersion == currentVersion)
{
if (showUpToDateMessage)
Msg.Show($"{Application.ProductName} is up to date.");
return;
}
if (RegistryHelp.GetString(RegistryHelp.ApplicationKey, "UpdateCheckVersion")
!= onlineVersion.ToString() && Msg.ShowQuestion(
$"New version {onlineVersion} is available, update now?") == MsgResult.OK)
{
string arch = IntPtr.Size == 8 ? "64" : "86";
string url = $"https://github.com/stax76/mpv.net/releases/download/{onlineVersion}/mpv.net-portable-x{arch}-{onlineVersion}.7z";
using (Process proc = new Process())
{
proc.StartInfo.FileName = "PowerShell";
proc.StartInfo.Arguments = $"-NoLogo -NoExit -File \"{Folder.Startup + "Update.ps1"}\" \"{url}\" \"{Application.StartupPath}\"";
if (Folder.Startup.Contains("Program Files"))
proc.StartInfo.Verb = "runas";
proc.Start();
}
mp.command("quit");
}
RegistryHelp.SetValue(RegistryHelp.ApplicationKey, "UpdateCheckVersion", onlineVersion.ToString());
}
}
catch (Exception ex)
{
if (showUpToDateMessage)
Msg.ShowException(ex);
}
}
}
}

View File

@@ -1,4 +1,5 @@
using System;

using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Collections.Generic;

View File

@@ -6,11 +6,11 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("mpv.net")]
[assembly: AssemblyDescription("media player")]
[assembly: AssemblyDescription("mpv based media player")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Frank Skare (stax76)")]
[assembly: AssemblyProduct("mpv.net")]
[assembly: AssemblyCopyright("Copyright 2017-2019 Frank Skare (stax76)")]
[assembly: AssemblyCopyright("Copyright (c) 2017-2019 Frank Skare (stax76)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.3.0")]
[assembly: AssemblyFileVersion("5.4.3.0")]
[assembly: AssemblyVersion("5.4.4.0")]
[assembly: AssemblyFileVersion("5.4.4.0")]

View File

@@ -502,6 +502,15 @@ file = "mpv"
filter = "Input"
help = "Number of key presses to generate per second on autorepeat."
[[settings]]
name = "update-check"
file = "mpvnet"
default = "no"
filter = "General"
help = "Daily check for new version. (requires PowerShell 5 and curl. mpv.net specific setting)"
options = [{ name = "yes" },
{ name = "no" }]
[[settings]]
name = "process-instance"
file = "mpvnet"

View File

@@ -14,7 +14,7 @@
# space character to make it easier to do a text search, so if you want to know
# if 'o' has already a binding you can make a text search on ' o '.
# mpv input commands: https://github.com/stax76/mpv.net/wiki/mpv-input-commands
# mpv input commands: https://mpv.io/manual/master/#list-of-input-commands
# mpv input keys: https://github.com/stax76/mpv.net/wiki/mpv-input-keys
@@ -157,21 +157,14 @@
Ctrl+h cycle-values hwdec "auto" "no" #menu: Tools > Toggle Hardware Decoding
_ script-message mpv.net show-setup-dialog #menu: Tools > OS Setup...
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/blob/master/Manual.md #menu: Help > mpv.net Manual
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net #menu: Help > mpv.net GitHub
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/wiki #menu: Help > mpv.net Wiki
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net#support #menu: Help > mpv.net Support
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/releases #menu: Help > mpv.net Download
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt #menu: Help > mpv.net Default Key Bindings
_ ignore #menu: Help > -
_ script-message mpv.net shell-execute https://mpv.io/manual/stable/ #menu: Help > mpv Manual
_ script-message mpv.net shell-execute https://github.com/mpv-player/mpv/wiki #menu: Help > mpv Wiki
_ script-message mpv.net shell-execute https://github.com/mpv-player/mpv/wiki/User-Scripts #menu: Help > mpv User Scripts
_ script-message mpv.net shell-execute https://mpv.io/bug-reports/ #menu: Help > mpv Bugs and Requests
_ script-message mpv.net shell-execute https://mpv.io/installation/ #menu: Help > mpv Download
_ script-message mpv.net shell-execute https://github.com/mpv-player/mpv/blob/master/etc/input.conf #menu: Help > mpv Default Key Bindings
_ ignore #menu: Help > -
_ script-message mpv.net show-about #menu: Help > About mpv.net
_ script-message mpv.net shell-execute https://mpv.io #menu: Help > Website mpv
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net #menu: Help > Website mpv.net
_ ignore #menu: Help > -
_ script-message mpv.net shell-execute https://mpv.io/manual/stable/ #menu: Help > Manual mpv
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net/blob/master/Manual.md #menu: Help > Manual mpv.net
_ ignore #menu: Help > -
_ script-message mpv.net update-check #menu: Help > Check for Updates
_ script-message mpv.net show-about #menu: Help > About mpv.net
_ ignore #menu: -
Esc quit #menu: Exit

View File

@@ -2,11 +2,11 @@
[dark]
heading = #1E90FF
foreground = #FFFFFF
foreground2 = #C0C0C0
foreground = #DDDDDD
foreground2 = #AAAAAA
background = #323232
menu-foreground = #FFFFFF
menu-foreground = #DDDDDD
menu-background = #323232
menu-highlight = #505050
menu-border = #FFFFFF

23
mpv.net/Update.ps1 Normal file
View File

@@ -0,0 +1,23 @@
$ErrorActionPreference = 'Stop'
$targetDir = (Split-Path $args[1]) + "\new version"
$targetFile = $targetDir + '.7z'
Write-Host 'Download new version' -ForegroundColor Green
curl.exe $args[0] --location --output $targetFile
if ($LastExitCode) { throw $LastExitCode }
Write-Host 'Unpack new version' -ForegroundColor Green
& ($args[1] + '\7z\7za.exe') x -y $targetFile -o"$targetDir"
if ($LastExitCode) { throw $LastExitCode }
Write-Host 'Delete downloaded file' -ForegroundColor Green
Remove-Item $targetFile -Force -Recurse
Write-Host 'Delete current version' -ForegroundColor Green
Remove-Item $args[1] -Force -Recurse
Write-Host 'Rename directory' -ForegroundColor Green
Rename-Item $targetDir (Split-Path $args[1] -Leaf)
Write-Host 'Update is complete' -ForegroundColor Green

View File

@@ -30,7 +30,7 @@ namespace mpvnet
LoadConf(App.ConfPath);
LoadSettings();
InitialContent = GetCompareString();
SearchControl.Text = RegHelp.GetString(App.RegPath, "ConfigEditorSearch");
SearchControl.Text = RegistryHelp.GetString(App.RegPath, "ConfigEditorSearch");
}
private void LoadSettings()
@@ -68,7 +68,7 @@ namespace mpvnet
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
RegHelp.SetObject(App.RegPath, "ConfigEditorSearch", SearchControl.Text);
RegistryHelp.SetValue(App.RegPath, "ConfigEditorSearch", SearchControl.Text);
if (InitialContent == GetCompareString())
return;

View File

@@ -22,10 +22,10 @@
<Grid>
<StackPanel Margin="10">
<Button Name="RegisterVideo" Click="RegisterVideo_Click">Register video file extensions (requires elevated privileges)</Button>
<Button Name="RegisterAudio" Click="RegisterAudio_Click">Register audio file extensions (requires elevated privileges)</Button>
<Button Name="RegisterImage" Click="RegisterImage_Click">Register image file extensions (requires elevated privileges)</Button>
<Button Name="UnregisterFileAssociations" Click="UnregisterFileAssociations_Click">Unregister file extensions (requires elevated privileges)</Button>
<Button Name="RegisterVideo" Click="RegisterVideo_Click">Register video file extensions (requires admin rights)</Button>
<Button Name="RegisterAudio" Click="RegisterAudio_Click">Register audio file extensions (requires admin rights)</Button>
<Button Name="RegisterImage" Click="RegisterImage_Click">Register image file extensions (requires admin rights)</Button>
<Button Name="UnregisterFileAssociations" Click="UnregisterFileAssociations_Click">Unregister file extensions (requires admin rights)</Button>
<Button Name="AddToPathEnvVar" Click="AddToPathEnvVar_Click">Add mpv.net to Path environment variable</Button>
<Button Name="RemoveFromPathEnvVar" Click="RemoveFromPathEnvVar_Click">Remove mpv.net from Path environment variable</Button>
</StackPanel>

View File

@@ -15,7 +15,7 @@ namespace mpvnet
{
try
{
using (var proc = new Process())
using (Process proc = new Process())
{
proc.StartInfo.FileName = WinForms.Application.ExecutablePath;
proc.StartInfo.Arguments = "--reg-file-assoc " + value;

View File

@@ -10,6 +10,7 @@ using System.ComponentModel;
using System.Globalization;
using System.Diagnostics;
using System.Threading.Tasks;
using UI;
namespace mpvnet
@@ -23,7 +24,8 @@ namespace mpvnet
int LastCursorChangedTickCount;
int TaskbarButtonCreatedMessage;
bool WasShown;
Taskbar Taskbar;
DateTime LastCycleFullscreen;
Taskbar Taskbar;
List<string> RecentFiles;
public MainForm()
@@ -32,7 +34,7 @@ namespace mpvnet
try
{
object recent = RegHelp.GetObject(App.RegPath, "Recent");
object recent = RegistryHelp.GetValue(App.RegPath, "Recent");
if (recent is string[] r)
RecentFiles = new List<string>(r);
@@ -89,8 +91,8 @@ namespace mpvnet
Left = target.X + (target.Width - Width) / 2;
Top = target.Y + (target.Height - Height) / 2;
int posX = RegHelp.GetInt(App.RegPath, "PosX");
int posY = RegHelp.GetInt(App.RegPath, "PosY");
int posX = RegistryHelp.GetInt(App.RegPath, "PosX");
int posY = RegistryHelp.GetInt(App.RegPath, "PosY");
if (posX != 0 && posY != 0 && App.RememberPosition)
{
@@ -344,6 +346,7 @@ namespace mpvnet
public void CycleFullscreen(bool enabled)
{
LastCycleFullscreen = DateTime.Now;
mp.Fullscreen = enabled;
if (enabled)
@@ -469,67 +472,80 @@ namespace mpvnet
break;
case 0x0200: // WM_MOUSEMOVE
{
Point pos = PointToClient(Cursor.Position);
mp.command($"mouse {pos.X} {pos.Y}");
if (CursorHelp.IsPosDifferent(LastCursorPosChanged)) CursorHelp.Show();
if ((DateTime.Now - LastCycleFullscreen).TotalMilliseconds > 500)
{
Point pos = PointToClient(Cursor.Position);
mp.command($"mouse {pos.X} {pos.Y}");
}
if (CursorHelp.IsPosDifferent(LastCursorPosChanged))
CursorHelp.Show();
}
break;
case 0x2a3: // WM_MOUSELEAVE
mp.command("mouse 1 1"); // osc won't always auto hide
// osc won't always auto hide
mp.command("mouse 1 1");
break;
case 0x203: // Native.WM.LBUTTONDBLCLK
case 0x203: // WM_LBUTTONDBLCLK
{
Point pos = PointToClient(Cursor.Position);
mp.command($"mouse {pos.X} {pos.Y} 0 double");
}
break;
case 0x02E0: // WM_DPICHANGED
if (!WasShown)
break;
var r2 = Marshal.PtrToStructure<Native.RECT>(m.LParam);
Native.SetWindowPos(Handle, IntPtr.Zero, r2.Left, r2.Top, r2.Width, r2.Height, 0);
{
if (!WasShown)
break;
Native.RECT rect = Marshal.PtrToStructure<Native.RECT>(m.LParam);
Native.SetWindowPos(Handle, IntPtr.Zero, rect.Left, rect.Top, rect.Width, rect.Height, 0);
}
break;
case 0x0214: // WM_SIZING
var rc = Marshal.PtrToStructure<Native.RECT>(m.LParam);
var r = rc;
NativeHelp.SubtractWindowBorders(Handle, ref r);
int c_w = r.Right - r.Left, c_h = r.Bottom - r.Top;
Size s = mp.VideoSize;
{
var rc = Marshal.PtrToStructure<Native.RECT>(m.LParam);
var r = rc;
NativeHelp.SubtractWindowBorders(Handle, ref r);
int c_w = r.Right - r.Left, c_h = r.Bottom - r.Top;
Size s = mp.VideoSize;
if (s == Size.Empty)
s = new Size(16, 9);
if (s == Size.Empty)
s = new Size(16, 9);
float aspect = s.Width / (float)s.Height;
int d_w = Convert.ToInt32(c_h * aspect - c_w);
int d_h = Convert.ToInt32(c_w / aspect - c_h);
int[] d_corners = { d_w, d_h, -d_w, -d_h };
int[] corners = { rc.Left, rc.Top, rc.Right, rc.Bottom };
int corner = NativeHelp.GetResizeBorder(m.WParam.ToInt32());
float aspect = s.Width / (float)s.Height;
int d_w = Convert.ToInt32(c_h * aspect - c_w);
int d_h = Convert.ToInt32(c_w / aspect - c_h);
int[] d_corners = { d_w, d_h, -d_w, -d_h };
int[] corners = { rc.Left, rc.Top, rc.Right, rc.Bottom };
int corner = NativeHelp.GetResizeBorder(m.WParam.ToInt32());
if (corner >= 0)
corners[corner] -= d_corners[corner];
if (corner >= 0)
corners[corner] -= d_corners[corner];
Marshal.StructureToPtr<Native.RECT>(new Native.RECT(corners[0], corners[1], corners[2], corners[3]), m.LParam, false);
m.Result = new IntPtr(1);
Marshal.StructureToPtr<Native.RECT>(new Native.RECT(corners[0], corners[1], corners[2], corners[3]), m.LParam, false);
m.Result = new IntPtr(1);
}
return;
case 0x004A: // WM_COPYDATA
var copyData = (Native.COPYDATASTRUCT)m.GetLParam(typeof(Native.COPYDATASTRUCT));
string[] files = copyData.lpData.Split('\n');
string mode = files[0];
files = files.Skip(1).ToArray();
switch (mode)
{
case "single":
mp.Load(files, true, Control.ModifierKeys.HasFlag(Keys.Control));
break;
case "queue":
foreach (string file in files)
mp.commandv("loadfile", file, "append");
break;
}
var copyData = (Native.COPYDATASTRUCT)m.GetLParam(typeof(Native.COPYDATASTRUCT));
string[] files = copyData.lpData.Split('\n');
string mode = files[0];
files = files.Skip(1).ToArray();
Activate();
switch (mode)
{
case "single":
mp.Load(files, true, Control.ModifierKeys.HasFlag(Keys.Control));
break;
case "queue":
foreach (string file in files)
mp.commandv("loadfile", file, "append");
break;
}
Activate();
}
return;
}
@@ -616,6 +632,7 @@ namespace mpvnet
if (mp.GPUAPI != "vulkan")
mp.VideoSizeAutoResetEvent.WaitOne(App.StartThreshold);
LastCycleFullscreen = DateTime.Now;
SetFormPosAndSize();
}
@@ -637,9 +654,10 @@ namespace mpvnet
WPF.WPF.Init();
System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y);
WasShown = true;
UpdateCheck.DailyCheck();
mp.LoadScripts();
Task.Run(() => App.Extension = new Extension());
WasShown = true;
}
protected override void OnResize(EventArgs e)
@@ -656,11 +674,11 @@ namespace mpvnet
if (WindowState == FormWindowState.Normal)
{
RegHelp.SetObject(App.RegPath, "PosX", Left + Width / 2);
RegHelp.SetObject(App.RegPath, "PosY", Top + Height / 2);
RegistryHelp.SetValue(App.RegPath, "PosX", Left + Width / 2);
RegistryHelp.SetValue(App.RegPath, "PosY", Top + Height / 2);
}
RegHelp.SetObject(App.RegPath, "Recent", RecentFiles.ToArray());
RegistryHelp.SetValue(App.RegPath, "Recent", RecentFiles.ToArray());
if (mp.IsQuitNeeded)
mp.commandv("quit");

View File

@@ -39,7 +39,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
@@ -52,6 +52,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@@ -59,7 +60,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
@@ -72,6 +73,7 @@
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="IKVM.Reflection, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58, processorArchitecture=MSIL">
@@ -108,6 +110,7 @@
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0\lib\net4\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
@@ -116,7 +119,14 @@
<ItemGroup>
<Compile Include="Misc\App.cs" />
<Compile Include="Misc\Extension.cs" />
<Content Include="..\License.txt">
<Link>License.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\theme.txt" />
<None Include="Update.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Page Include="WPF\SearchTextBoxUserControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -142,6 +152,8 @@
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Include="Misc\Help.cs" />
<Compile Include="Misc\UpdateCheck.cs" />
<Compile Include="Misc\RegistryHelp.cs" />
<Compile Include="Misc\Theme.cs" />
<Compile Include="WPF\SearchTextBoxUserControl.xaml.cs">
<DependentUpon>SearchTextBoxUserControl.xaml</DependentUpon>
@@ -215,15 +227,12 @@
</EmbeddedResource>
<None Include="..\Changelog.md">
<Link>Changelog.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Manual.md">
<Link>Manual.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\README.md">
<Link>README.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="app.manifest" />
<None Include="packages.config" />
@@ -236,10 +245,6 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Content Include="..\LICENSE.txt">
<Link>LICENSE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="mpvnet.ico" />
<Content Include="Resources\mpvConf.txt" />
<Content Include="Resources\confToml.txt" />

View File

@@ -1,4 +1,5 @@
using System;

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
@@ -92,7 +93,6 @@ namespace mpvnet
public static void Init()
{
LoadLibrary("mpv-1.dll");
Handle = mpv_create();
Task.Run(() => EventLoop());
@@ -151,23 +151,21 @@ namespace mpvnet
get {
if (_ConfigFolder == null)
{
string portableFolder = Folder.Startup + "portable_config\\";
string portableFolder = Folder.Startup + @"portable_config\";
_ConfigFolder = portableFolder;
if (!Directory.Exists(_ConfigFolder))
_ConfigFolder = RegHelp.GetString(App.RegPath, "ConfigFolder");
_ConfigFolder = RegistryHelp.GetString(App.RegPath, "ConfigFolder");
if (!Directory.Exists(_ConfigFolder))
{
string appdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv.net\\";
string appdataFolderMpv = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\";
string appdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\mpv.net\";
using (TaskDialog<string> td = new TaskDialog<string>())
{
td.MainInstruction = "Choose a settings folder.";
td.AddCommandLink(@"AppData\Roaming\mpv.net", appdataFolder, appdataFolder);
td.AddCommandLink(@"AppData\Roaming\mpv", appdataFolderMpv, appdataFolderMpv);
td.AddCommandLink("<startup>\\portable_config", portableFolder, portableFolder);
td.AddCommandLink(@"<startup>\portable_config", portableFolder, portableFolder);
td.AddCommandLink("Choose custom folder", "custom");
_ConfigFolder = td.Show();
}
@@ -185,7 +183,7 @@ namespace mpvnet
d.Description = "Choose a folder.";
if (d.ShowDialog() == WinForms.DialogResult.OK)
_ConfigFolder = d.SelectedPath + "\\";
_ConfigFolder = d.SelectedPath + @"\";
else
_ConfigFolder = appdataFolder;
}
@@ -202,7 +200,7 @@ namespace mpvnet
Directory.CreateDirectory(_ConfigFolder);
if (!_ConfigFolder.Contains("portable_config"))
RegHelp.SetObject(App.RegPath, "ConfigFolder", _ConfigFolder);
RegistryHelp.SetValue(App.RegPath, "ConfigFolder", _ConfigFolder);
if (!File.Exists(_ConfigFolder + "input.conf"))
File.WriteAllText(_ConfigFolder + "input.conf", Properties.Resources.inputConf);
@@ -794,9 +792,9 @@ namespace mpvnet
int totalMinutes = Convert.ToInt32((DateTime.Now - LastHistoryStartDateTime).TotalMinutes);
if (PathHelp.GetBaseName(LastHistoryPath) != "" && totalMinutes > 1)
if (LastHistoryPath != null && totalMinutes > 1)
File.AppendAllText(ConfigFolder + "history.txt", DateTime.Now.ToString().Substring(0, 16) +
" " + totalMinutes.ToString().PadLeft(3) + " " + PathHelp.GetBaseName(LastHistoryPath) + "\r\n");
" " + totalMinutes.ToString().PadLeft(3) + " " + LastHistoryPath + "\r\n");
LastHistoryPath = path;
LastHistoryStartDateTime = DateTime.Now;

View File

@@ -1,3 +1,4 @@
#define MyAppName "mpv.net"
#define MyAppExeName "mpvnet.exe"
@@ -18,9 +19,11 @@ AppId={{9AA2B100-BEF3-44D0-B819-D8FC3C4D557D}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher=Frank Skare (stax76)
#if arch == "x64"
ArchitecturesInstallIn64BitMode=x64
#endif
Compression=lzma2
DefaultDirName={commonpf}\{#MyAppName}
OutputBaseFilename=mpv.net-setup-{#arch}-{#MyAppVersion}
@@ -34,7 +37,7 @@ Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[Files]
Source: "{#MyAppSourceDir}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppSourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "System.Management.Automation.xml"
Source: "{#MyAppSourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "Associate video file extensions?"; Flags: postinstall unchecked runascurrentuser runhidden nowait; Parameters: "--reg-file-assoc video"