0.2.2
This commit is contained in:
@@ -1,20 +1,4 @@
|
|||||||
' mpv.net
|
Imports System.ComponentModel.Composition
|
||||||
' Copyright(C) 2017 stax76
|
|
||||||
'
|
|
||||||
' This program Is free software: you can redistribute it And/Or modify
|
|
||||||
' it under the terms of the GNU General Public License as published by
|
|
||||||
' the Free Software Foundation, either version 3 of the License, Or
|
|
||||||
' (at your option) any later version.
|
|
||||||
'
|
|
||||||
' This program Is distributed in the hope that it will be useful,
|
|
||||||
' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
' MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE.See the
|
|
||||||
' GNU General Public License for more details.
|
|
||||||
'
|
|
||||||
' You should have received a copy of the GNU General Public License
|
|
||||||
' along with this program. If Not, see http://www.gnu.org/licenses/.
|
|
||||||
|
|
||||||
Imports System.ComponentModel.Composition
|
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
|
||||||
Imports vbnet
|
Imports vbnet
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -43,3 +43,14 @@ class Script
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
### 0.2.2
|
||||||
|
|
||||||
|
- history feature added
|
||||||
|
- mpv lib updated
|
||||||
|
|
||||||
|
### 0.2.1
|
||||||
|
|
||||||
|
- right-click in fullscreen in the right-left corner closes the app
|
||||||
@@ -82,6 +82,14 @@ namespace mpvnet
|
|||||||
ProcessHelp.Start(OS.GetTextEditor(), '"' + filepath + '"');
|
ProcessHelp.Start(OS.GetTextEditor(), '"' + filepath + '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void history(string[] args)
|
||||||
|
{
|
||||||
|
var fp = Folder.AppDataRoaming + "mpv\\history.txt";
|
||||||
|
|
||||||
|
if (MsgQuestion($"Create history.txt file in config folder?{BR2}mpv.net will write the date, time and filename of opened file to it.") == DialogResult.OK)
|
||||||
|
File.WriteAllText(fp, "");
|
||||||
|
}
|
||||||
|
|
||||||
public static void show_info(string[] args)
|
public static void show_info(string[] args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -94,7 +102,7 @@ namespace mpvnet
|
|||||||
var h = mi.GetInfo(StreamKind.Video, "Height");
|
var h = mi.GetInfo(StreamKind.Video, "Height");
|
||||||
var pos = TimeSpan.FromSeconds(mpv.GetIntProp("time-pos"));
|
var pos = TimeSpan.FromSeconds(mpv.GetIntProp("time-pos"));
|
||||||
var dur = TimeSpan.FromSeconds(mpv.GetIntProp("duration"));
|
var dur = TimeSpan.FromSeconds(mpv.GetIntProp("duration"));
|
||||||
var br = Convert.ToInt32(mi.GetInfo(StreamKind.Video, "BitRate")) / 1000;
|
var br = Convert.ToInt32(mi.GetInfo(StreamKind.Video, "BitRate")) / 1000.0 / 1000.0;
|
||||||
var vf = mpv.GetStringProp("video-format").ToUpper();
|
var vf = mpv.GetStringProp("video-format").ToUpper();
|
||||||
var fn = fi.Name;
|
var fn = fi.Name;
|
||||||
|
|
||||||
@@ -107,7 +115,7 @@ namespace mpvnet
|
|||||||
FormatTime(dur.TotalMinutes) + ":" +
|
FormatTime(dur.TotalMinutes) + ":" +
|
||||||
FormatTime(dur.Seconds) + "\n" +
|
FormatTime(dur.Seconds) + "\n" +
|
||||||
((int)(fi.Length / 1024 / 1024)).ToString() +
|
((int)(fi.Length / 1024 / 1024)).ToString() +
|
||||||
$" MB - {w} x {h}\n{vf} - {br} Kbps" + "\n" + fn;
|
$" MB - {w} x {h}\n{vf} - {br.ToString("f1")} Mb/s" + "\n" + fn;
|
||||||
|
|
||||||
mpv.Command("show-text", info, "5000");
|
mpv.Command("show-text", info, "5000");
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace mpvnet
|
|||||||
mpv.ObserveBoolProp("fullscreen", MpvChangeFullscreen);
|
mpv.ObserveBoolProp("fullscreen", MpvChangeFullscreen);
|
||||||
mpv.AfterShutdown += Mpv_AfterShutdown;
|
mpv.AfterShutdown += Mpv_AfterShutdown;
|
||||||
mpv.VideoSizeChanged += Mpv_VideoSizeChanged;
|
mpv.VideoSizeChanged += Mpv_VideoSizeChanged;
|
||||||
mpv.PlaybackRestart += Mpv_PlaybackRestart;
|
mpv.PlaybackRestart += mpv_PlaybackRestart;
|
||||||
|
|
||||||
ToolStripManager.Renderer = new ToolStripRendererEx(ToolStripRenderModeEx.SystemDefault);
|
ToolStripManager.Renderer = new ToolStripRendererEx(ToolStripRenderModeEx.SystemDefault);
|
||||||
CMS = new ContextMenuStripEx(components);
|
CMS = new ContextMenuStripEx(components);
|
||||||
@@ -100,9 +100,14 @@ namespace mpvnet
|
|||||||
CursorHelp.Show();
|
CursorHelp.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Mpv_PlaybackRestart()
|
private void mpv_PlaybackRestart()
|
||||||
{
|
{
|
||||||
BeginInvoke(new Action(() => Text = mpv.GetStringProp("filename") + " - mpv.net " + Application.ProductVersion));
|
var fn = mpv.GetStringProp("filename");
|
||||||
|
BeginInvoke(new Action(() => { Text = fn + " - mpv.net " + Application.ProductVersion; }));
|
||||||
|
var fp = Folder.AppDataRoaming + "mpv\\history.txt";
|
||||||
|
|
||||||
|
if (File.Exists(fp))
|
||||||
|
File.AppendAllText(fp, DateTime.Now.ToString() + " " + Path.GetFileNameWithoutExtension(fn) + BR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CM_Popup(object sender, EventArgs e)
|
private void CM_Popup(object sender, EventArgs e)
|
||||||
|
|||||||
@@ -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.1.0")]
|
[assembly: AssemblyVersion("0.2.2.0")]
|
||||||
[assembly: AssemblyFileVersion("0.2.1.0")]
|
[assembly: AssemblyFileVersion("0.2.2.0")]
|
||||||
|
|||||||
@@ -47,4 +47,5 @@ k script-message mpv.net show-keys #menu: K ; 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
|
||||||
Esc quit #menu: Escape ; Exit
|
Esc quit #menu: Escape ; Exit
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
### 0.2.1
|
|
||||||
|
|
||||||
- right-click in fullscreen in the right-left corner closes the app
|
|
||||||
@@ -12,6 +12,7 @@ using static mpvnet.Native;
|
|||||||
|
|
||||||
using vbnet;
|
using vbnet;
|
||||||
using static vbnet.UI.MainModule;
|
using static vbnet.UI.MainModule;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
@@ -66,7 +67,7 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
IntPtr ptr = mpv_wait_event(MpvHandle, -1);
|
IntPtr ptr = mpv_wait_event(MpvHandle, -1);
|
||||||
mpv_event evt = (mpv_event)Marshal.PtrToStructure(ptr, typeof(mpv_event));
|
mpv_event evt = (mpv_event)Marshal.PtrToStructure(ptr, typeof(mpv_event));
|
||||||
//Debug.WriteLine(evt.event_id);
|
Debug.WriteLine(evt.event_id);
|
||||||
|
|
||||||
if (MpvWindowHandle == IntPtr.Zero)
|
if (MpvWindowHandle == IntPtr.Zero)
|
||||||
MpvWindowHandle = FindWindowEx(MainForm.Hwnd, IntPtr.Zero, "mpv", null);
|
MpvWindowHandle = FindWindowEx(MainForm.Hwnd, IntPtr.Zero, "mpv", null);
|
||||||
|
|||||||
@@ -104,7 +104,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Addon.cs" />
|
<Compile Include="Addon.cs" />
|
||||||
<None Include="docs\changelog.md" />
|
|
||||||
<Compile Include="Extensions.cs" />
|
<Compile Include="Extensions.cs" />
|
||||||
<Compile Include="StringExtensions.cs" />
|
<Compile Include="StringExtensions.cs" />
|
||||||
<Compile Include="libmpv.cs" />
|
<Compile Include="libmpv.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user