Compare commits

..

3 Commits
0.2.3 ... 0.2.5

Author SHA1 Message Date
Frank Skare
714eb7c9fa 0.2.5 2019-02-27 21:18:12 +01:00
Frank Skare
0f68c0cd3e 0.2.4 2018-12-20 00:08:21 +01:00
Frank Skare
ea8de8bd5a 0.2.3 2018-12-19 23:42:32 +01:00
7 changed files with 101 additions and 62 deletions

View File

@@ -46,7 +46,13 @@ class Script
### Changes ### Changes
### 0.2.3 ### 0.2.5
- mpv lib updated to 2019-02-24
- UI glitch fixed the appeared when started in fullscreen mode
- fixed default video output mode which caused video playback to fail
### 0.2.4
- changed minimum runtime to .NET 4.7.2 - changed minimum runtime to .NET 4.7.2
- fixed mpv.net not working with new mpv lib - fixed mpv.net not working with new mpv lib

View File

@@ -42,7 +42,7 @@
// MainForm // MainForm
// //
this.AllowDrop = true; this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(20F, 48F); this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black; this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(1553, 1000); this.ClientSize = new System.Drawing.Size(1553, 1000);
@@ -52,6 +52,8 @@
this.Name = "MainForm"; this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "mpv.net"; this.Text = "mpv.net";
this.Activated += new System.EventHandler(this.MainForm_Activated);
this.Load += new System.EventHandler(this.MainForm_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
} }

View File

@@ -24,28 +24,24 @@ namespace mpvnet
public MainForm() public MainForm()
{ {
InitializeComponent();
try try
{ {
Application.ThreadException += Application_ThreadException; Application.ThreadException += Application_ThreadException;
InitializeComponent();
SetFormPosSize(); SetFormPosSize();
Instance = this; Instance = this;
Hwnd = Handle; Hwnd = Handle;
mpv.Init(); ChangeFullscreen((mpv.mpvConv.ContainsKey("fullscreen") && mpv.mpvConv["fullscreen"] == "yes") || (mpv.mpvConv.ContainsKey("fs") && mpv.mpvConv["fs"] == "yes"));
mpv.ObserveBoolProp("fullscreen", MpvChangeFullscreen);
mpv.AfterShutdown += Mpv_AfterShutdown;
mpv.VideoSizeChanged += Mpv_VideoSizeChanged;
mpv.PlaybackRestart += mpv_PlaybackRestart;
ToolStripManager.Renderer = new ToolStripRendererEx(ToolStripRenderModeEx.SystemDefault); ToolStripManager.Renderer = new ToolStripRendererEx(ToolStripRenderModeEx.SystemDefault);
CMS = new ContextMenuStripEx(components); CMS = new ContextMenuStripEx(components);
CMS.Opened += CMS_Opened; CMS.Opened += CMS_Opened;
ContextMenuStrip = CMS; ContextMenuStrip = CMS;
BuildMenu(); BuildMenu();
} }
catch (Exception e) catch (Exception ex)
{ {
HandleException(e); HandleException(ex);
} }
} }
@@ -298,5 +294,19 @@ namespace mpvnet
CursorHelp.Hide(); CursorHelp.Hide();
} }
} }
private void MainForm_Load(object sender, EventArgs ea)
{
mpv.Init();
mpv.ObserveBoolProp("fullscreen", MpvChangeFullscreen);
mpv.AfterShutdown += Mpv_AfterShutdown;
mpv.VideoSizeChanged += Mpv_VideoSizeChanged;
mpv.PlaybackRestart += mpv_PlaybackRestart;
}
private void MainForm_Activated(object sender, EventArgs ea)
{
}
} }
} }

View File

@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("mpv.net")] [assembly: AssemblyProduct("mpv.net")]
[assembly: AssemblyCopyright("Copyright © 2017 stax76")] [assembly: AssemblyCopyright("Copyright © 2019 stax76")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [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 // 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("0.2.3.0")] [assembly: AssemblyVersion("0.2.5.0")]
[assembly: AssemblyFileVersion("0.2.3.0")] [assembly: AssemblyFileVersion("0.2.5.0")]

View File

@@ -1,58 +1,59 @@
#this file defines the shortcut keys and the context menu
#key command key caption menu path/caption #key command key caption menu path/caption
o script-message mpv.net open-files #menu: O; Open Files o script-message mpv.net open-files #menu: O; Open Files
Space cycle pause #menu: Space ; Play/Pause Space cycle pause #menu: Space ; Play/Pause
s stop #menu: S ; Stop s stop #menu: S ; Stop
F11 playlist-prev #menu: F11 ; Navigate | Previous F11 playlist-prev #menu: F11 ; Navigate | Previous
F12 playlist-next #menu: F12 ; Navigate | Next F12 playlist-next #menu: F12 ; Navigate | Next
Ctrl++ add video-zoom 0.1 #menu: Ctrl++ ; Pan && Scan | Increase Size Ctrl++ add video-zoom 0.1 #menu: Ctrl++ ; Pan && Scan | Increase Size
Ctrl+- add video-zoom -0.1 #menu: Ctrl+- ; Pan && Scan | Decrease Size Ctrl+- add video-zoom -0.1 #menu: Ctrl+- ; Pan && Scan | Decrease Size
Enter cycle fullscreen #menu: Enter ; Cycle Fullscreen Enter cycle pause #menu: Enter ; Cycle Fullscreen
KP7 cycle audio #menu: Numpad 7 ; Cycle Audio KP7 cycle audio #menu: Numpad 7 ; Cycle Audio
KP8 cycle sub #menu: Numpad 8 ; Cycle Subtitle KP8 cycle sub #menu: Numpad 8 ; Cycle Subtitle
+ add volume 5 #menu: + ; Volume | Up + add volume 10 #menu: + ; Volume | Up
- add volume -5 #menu: - ; Volume | Down - add volume -10 #menu: - ; Volume | Down
Axis_Up add volume 5 # wheel up Axis_Up add volume 10 #wheel up
Axis_Down add volume -5 # wheel down Axis_Down add volume -10 #wheel down
_ ignore #menu: _ ; Volume | - _ ignore #menu: _ ; Volume | -
m cycle mute #menu: M ; Volume | Mute m cycle mute #menu: M ; Volume | Mute
KP6 add audio-delay 0.100 #menu: Numpad 6 ; Audio | Delay +0.1 KP6 add audio-delay 0.100 #menu: Numpad 6 ; Audio | Delay +0.1
KP9 add audio-delay -0.100 #menu: Numpad 9 ; Audio | Delay -0.1 KP9 add audio-delay -0.100 #menu: Numpad 9 ; Audio | Delay -0.1
Right no-osd seek 10 #menu: Right ; Seek | 10 sec forward Right no-osd seek 10 #menu: Right ; Seek | 7 sec forward
Left no-osd seek -10 #menu: Left ; Seek | 10 sec backward Left no-osd seek -10 #menu: Left ; Seek | 7 sec backward
_ ignore #menu: _ ; Seek | - _ ignore #menu: _ ; Seek | -
Up no-osd seek 40 #menu: Up ; Seek | 1 min forward Up no-osd seek 40 #menu: Up ; Seek | 1 min forward
Down no-osd seek -40 #menu: Down ; Seek | 1 min backward Down no-osd seek -40 #menu: Down ; Seek | 1 min backward
_ ignore #menu: _ ; Seek | - _ ignore #menu: _ ; Seek | -
Ctrl+Right no-osd seek 300 #menu: Ctrl+Right ; Seek | 5 min forward Ctrl+Right no-osd seek 300 #menu: Ctrl+Right ; Seek | 5 min forward
Ctrl+Left no-osd seek -300 #menu: Ctrl+Left ; Seek | 5 min backward Ctrl+Left no-osd seek -300 #menu: Ctrl+Left ; Seek | 5 min backward
KP0 script-message rate-file 0 #menu: Numpad 0 ; Addons | Rating | 0stars KP0 script-message rate-file 0 #menu: Numpad 0 ; Addons | Rating | 0stars
KP1 script-message rate-file 1 #menu: Numpad 1 ; Addons | Rating | 1stars KP1 script-message rate-file 1 #menu: Numpad 1 ; Addons | Rating | 1stars
KP2 script-message rate-file 2 #menu: Numpad 2 ; Addons | Rating | 2stars KP2 script-message rate-file 2 #menu: Numpad 2 ; Addons | Rating | 2stars
KP3 script-message rate-file 3 #menu: Numpad 3 ; Addons | Rating | 3stars KP3 script-message rate-file 3 #menu: Numpad 3 ; Addons | Rating | 3stars
KP4 script-message rate-file 4 #menu: Numpad 4 ; Addons | Rating | 4stars KP4 script-message rate-file 4 #menu: Numpad 4 ; Addons | Rating | 4stars
KP5 script-message rate-file 5 #menu: Numpad 5 ; Addons | Rating | 5stars KP5 script-message rate-file 5 #menu: Numpad 5 ; Addons | Rating | 5stars
_ script-message mpv.net set-setting hwdec yes #menu: _ ; Settings | Hardware Decoding | Enable Hardware Decoding _ script-message mpv.net set-setting hwdec yes #menu: _ ; Settings | Hardware Decoding | Enable Hardware Decoding
_ script-message mpv.net set-setting hwdec no #menu: _ ; Settings | Hardware Decoding | Disable Hardware Decoding _ script-message mpv.net set-setting hwdec no #menu: _ ; Settings | Hardware Decoding | Disable Hardware Decoding
p script-message mpv.net show-prefs #menu: P ; Settings | Show Preferences p script-message mpv.net show-prefs #menu: P ; Settings | Show Preferences
k script-message mpv.net show-keys #menu: K ; Settings | Show Keys k script-message mpv.net show-keys #menu: K ; Settings | Show Keys
i script-message mpv.net show-info #menu: I ; Tools | Info i script-message mpv.net show-info #menu: I ; Tools | Info
c script-message mpv.net open-config-folder #menu: _ ; Tools | Config Folder c script-message mpv.net open-config-folder #menu: _ ; Tools | Config Folder
h script-message mpv.net history #menu: H ; Tools | History h script-message mpv.net history #menu: H ; Tools | History
l ab-loop #menu: L ; Tools | AB Loop l ab-loop #menu: L ; Tools | AB Loop
_ script-message mpv.net shell-execute https://mpv.io/manual/stable/ #menu: _ ; Tools | mpv Manual _ script-message mpv.net shell-execute https://mpv.io/manual/stable/ #menu: _ ; Tools | mpv Manual
_ script-message mpv.net shell-execute https://github.com/mpv-player/mpv/blob/master/etc/input.conf #menu: _ ; Tools | mpv Default Keys _ script-message mpv.net shell-execute https://github.com/mpv-player/mpv/blob/master/etc/input.conf #menu: _ ; Tools | mpv Default Keys
Esc quit #menu: Escape ; Exit Esc quit #menu: Escape ; Exit
Q quit-watch-later #menu: Shift+Q; Exit Watch Later Q quit-watch-later #menu: Shift+Q; Exit Watch Later

View File

@@ -35,6 +35,29 @@ namespace mpvnet
public static string mpvConfPath = Folder.AppDataRoaming + "mpv\\mpv.conf"; public static string mpvConfPath = Folder.AppDataRoaming + "mpv\\mpv.conf";
public static StringPairList BindingList = new StringPairList(); public static StringPairList BindingList = new StringPairList();
private static Dictionary<string, string> _mpvConv;
public static Dictionary<string, string> mpvConv {
get {
if (_mpvConv == null)
{
_mpvConv = new Dictionary<string, string>();
if (File.Exists(mpvConfPath))
{
foreach (var i in File.ReadAllLines(mpvConfPath))
{
if (i.Contains("=") && ! i.StartsWith("#"))
{
_mpvConv[i.Left("=").Trim()] = i.Right("=").Trim();
}
}
}
}
return _mpvConv;
}
}
public static void Init() public static void Init()
{ {
LoadLibrary("mpv-1.dll"); LoadLibrary("mpv-1.dll");
@@ -42,14 +65,11 @@ namespace mpvnet
SetIntProp("input-ar-delay", 500); SetIntProp("input-ar-delay", 500);
SetIntProp("input-ar-rate", 20); SetIntProp("input-ar-rate", 20);
SetIntProp("volume", 50); SetIntProp("volume", 50);
SetStringProp("hwdec", "auto"); SetStringProp("hwdec", "yes");
SetStringProp("input-default-bindings", "yes"); SetStringProp("input-default-bindings", "yes");
SetStringProp("opengl-backend", "angle");
SetStringProp("osd-playing-msg", "'${filename}'"); SetStringProp("osd-playing-msg", "'${filename}'");
SetStringProp("profile", "opengl-hq");
SetStringProp("screenshot-directory", "~~desktop/"); SetStringProp("screenshot-directory", "~~desktop/");
SetStringProp("vo", "opengl"); SetStringProp("keep-open", "yes");
SetStringProp("keep-open", "always");
SetStringProp("keep-open-pause", "no"); SetStringProp("keep-open-pause", "no");
SetStringProp("osc", "yes"); SetStringProp("osc", "yes");
SetStringProp("config", "yes"); SetStringProp("config", "yes");

View File

@@ -1,7 +1,7 @@
using namespace System.Diagnostics using namespace System.Diagnostics
$exePath = "C:\Users\frank\Desktop\Projekte\mpvnet\mpvnet\bin\Debug\mpvnet.exe" $exePath = "C:\Users\frank\Desktop\Projekte\mpvnet\mpvnet\bin\Debug\mpvnet.exe"
$version = [FileVersionInfo]::GetVersionInfo($exePath).FileVersion $version = [FileVersionInfo]::GetVersionInfo($exePath).FileVersion
$targetDir = "C:\Users\Frank\Desktop\mpv-net-" + $version $targetDir = "C:\Users\Frank\Desktop\mpv.net-" + $version
Copy-Item C:\Users\frank\Desktop\Projekte\mpvnet\mpvnet\bin\Debug $targetDir -recurse Copy-Item C:\Users\frank\Desktop\Projekte\mpvnet\mpvnet\bin\Debug $targetDir -recurse
$addonDir = $targetDir + "\Addons" $addonDir = $targetDir + "\Addons"
remove-item $addonDir -Recurse -Include *vbnet.pdb, *mpvnet.exe, *mpvnet.exe.config, *mpvnet.pdb, *vbnet.dll remove-item $addonDir -Recurse -Include *vbnet.pdb, *mpvnet.exe, *mpvnet.exe.config, *mpvnet.pdb, *vbnet.dll