Compare commits

...

2 Commits
4.2 ... 4.3

Author SHA1 Message Date
Frank Skare
87e3d9ca3e - 2019-06-17 21:35:14 +02:00
Frank Skare
29a0eae3d5 - 2019-06-16 12:46:04 +02:00
7 changed files with 36 additions and 27 deletions

View File

@@ -1,9 +1,13 @@
### 4.2 Letting Go
### 4.3
- there was new bug in file association feature
### 4.2
- the help and layout in the config editor was improved
- clipboard monitoring for URLs can be disabled in the settings
- the context menu has a new feature: Open > Add files to playlist,
it appends files to the playlist [(Default binding)](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L34)
it appends files to the playlist [(Default binding)](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L33)
- a setting was added to force using a single mpv.net process instance
### 4.1

View File

@@ -212,14 +212,18 @@ namespace mpvnet
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 rk = GetRootKey(path).OpenSubKey(path.Substring(5), true))
if (!(rk is null))
rk.DeleteValue(name, false);
} catch {}
}
static RegistryKey GetRootKey(string path)

View File

@@ -13,8 +13,6 @@ namespace mpvnet
[STAThread]
static void Main()
{
Mutex mutex = new Mutex(true, "mpvnetProcessInstance", out bool isFirst);
try
{
string[] args = Environment.GetCommandLineArgs().Skip(1).ToArray();
@@ -27,6 +25,7 @@ namespace mpvnet
return;
}
Mutex mutex = new Mutex(true, "mpvnetProcessInstance", out bool isFirst);
App.Init();
if ((App.ProcessInstance == "single" || App.ProcessInstance == "queue") && !isFirst)
@@ -56,15 +55,12 @@ namespace mpvnet
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
mutex.Dispose();
}
catch (Exception ex)
{
Msg.ShowException(ex);
}
finally
{
mutex.Dispose();
}
}
}
}

View File

@@ -27,6 +27,9 @@ namespace mpvnet
[DllImport("user32.dll", SetLastError = true)]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
[DllImport("user32.dll")]
public static extern bool EnableWindow(IntPtr hWnd, bool bEnable);
[DllImport("user32.dll", EntryPoint = "GetWindowLong")]
private static extern IntPtr GetWindowLong32(IntPtr hWnd, int nIndex);

View File

@@ -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("4.2.0.0")]
[assembly: AssemblyFileVersion("4.2.0.0")]
[assembly: AssemblyVersion("4.3.0.0")]
[assembly: AssemblyFileVersion("4.3.0.0")]

View File

@@ -343,6 +343,11 @@ namespace mpvnet
if (mp.WindowHandle != IntPtr.Zero)
Native.SendMessage(mp.WindowHandle, m.Msg, m.WParam, m.LParam);
break;
case 0x0200: // WM_MOUSEMOVE
Point pos = PointToClient(Cursor.Position);
mp.command_string($"mouse {pos.X} {pos.Y}");
if (CursorHelp.IsPosDifferent(LastCursorPosChanged)) CursorHelp.Show();
break;
case 0x319: // WM_APPCOMMAND
if (mp.WindowHandle != IntPtr.Zero)
Native.PostMessage(mp.WindowHandle, m.Msg, m.WParam, m.LParam);
@@ -389,7 +394,6 @@ namespace mpvnet
break;
case "queue":
foreach (string file in files)
if (File.Exists(file))
mp.commandv("loadfile", file, "append");
break;
}
@@ -436,15 +440,6 @@ namespace mpvnet
mp.commandv("quit");
}
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
mp.command_string($"mouse {e.X} {e.Y}");
if (CursorHelp.IsPosDifferent(LastCursorPosChanged))
CursorHelp.Show();
}
bool IsMouseInOSC() => PointToClient(Control.MousePosition).Y > ClientSize.Height * 0.9;
void Timer_Tick(object sender, EventArgs e)

View File

@@ -193,7 +193,10 @@ namespace mpvnet
mpv_event evt = (mpv_event)Marshal.PtrToStructure(ptr, typeof(mpv_event));
if (WindowHandle == IntPtr.Zero)
{
WindowHandle = FindWindowEx(MainForm.Hwnd, IntPtr.Zero, "mpv", null);
//Native.EnableWindow(WindowHandle, true);
}
//Debug.WriteLine(evt.event_id.ToString());
@@ -563,9 +566,12 @@ namespace mpvnet
HideLogo();
List<string> fileList = files.ToList();
foreach (string file in files) {
foreach (string file in files)
{
string ext = Path.GetExtension(file).TrimStart('.').ToLower();
if (App.SubtitleTypes.Contains(ext)) {
if (App.SubtitleTypes.Contains(ext))
{
mp.commandv("sub-add", file);
fileList.Remove(file);
}
@@ -573,6 +579,7 @@ namespace mpvnet
if (fileList.Count == 0) return;
files = fileList.ToArray();
int count = mp.get_property_int("playlist-count");
foreach (string file in files)