Compare commits

..

5 Commits

Author SHA1 Message Date
stax76
9a6bf5a481 v6.0.3.0 update changelog 2022-07-03 10:35:39 +02:00
stax76
40565e8b3d fix possible race condition 2022-07-02 15:10:22 +02:00
stax76
fb294c441d 6.0.2.0 2022-07-02 10:19:19 +02:00
stax76
03b775370b window title fix 2022-07-02 09:35:15 +02:00
stax76
1015f87533 changelog fix 2022-06-30 15:19:42 +02:00
6 changed files with 72 additions and 28 deletions

View File

@@ -1,5 +1,15 @@
# 6.0.1.0 # 6.0.3.0 (2022-07-03)
- Fix the rare occasion of duplicated playlist entries produced by the auto-load-folder feature.
# 6.0.2.0 (2022-07-02)
- Fix main window shown collapsed when the player was started with full screen.
# 6.0.1.0 (2022-06-30)
- New tutorial: [Extending mpv and mpv.net via Lua scripting](https://github.com/stax76/mpv.net/wiki/Extending-mpv-and-mpv.net-via-Lua-scripting) - New tutorial: [Extending mpv and mpv.net via Lua scripting](https://github.com/stax76/mpv.net/wiki/Extending-mpv-and-mpv.net-via-Lua-scripting)
- New options `autofit-image` and `autofit-audio`, like autofit, but used for image and audio files. - New options `autofit-image` and `autofit-audio`, like autofit, but used for image and audio files.

View File

@@ -1194,6 +1194,9 @@ namespace mpvnet
{ {
string file = files[i]; string file = files[i];
if (file.Contains("|"))
file = file.Substring(0, file.IndexOf("|"));
if (file.Ext() == "avs") if (file.Ext() == "avs")
LoadAviSynth(); LoadAviSynth();
@@ -1273,41 +1276,47 @@ namespace mpvnet
} }
} }
static object LoadFolderLockObject = new object();
public void LoadFolder() public void LoadFolder()
{ {
if (!App.AutoLoadFolder || Control.ModifierKeys.HasFlag(Keys.Shift)) if (!App.AutoLoadFolder || Control.ModifierKeys.HasFlag(Keys.Shift))
return; return;
Thread.Sleep(1000); Thread.Sleep(1000);
string path = GetPropertyString("path");
if (!File.Exists(path) || GetPropertyInt("playlist-count") != 1) lock (LoadFolderLockObject)
return; {
string path = GetPropertyString("path");
string dir = Environment.CurrentDirectory; if (!File.Exists(path) || GetPropertyInt("playlist-count") != 1)
return;
if (path.Contains(":/") && !path.Contains("://")) string dir = Environment.CurrentDirectory;
path = path.Replace("/", "\\");
if (path.Contains("\\")) if (path.Contains(":/") && !path.Contains("://"))
dir = System.IO.Path.GetDirectoryName(path); path = path.Replace("/", "\\");
List<string> files = Directory.GetFiles(dir).ToList(); if (path.Contains("\\"))
dir = System.IO.Path.GetDirectoryName(path);
files = files.Where(file => List<string> files = Directory.GetFiles(dir).ToList();
VideoTypes.Contains(file.Ext()) ||
AudioTypes.Contains(file.Ext()) ||
ImageTypes.Contains(file.Ext())).ToList();
files.Sort(new StringLogicalComparer()); files = files.Where(file =>
int index = files.IndexOf(path); VideoTypes.Contains(file.Ext()) ||
files.Remove(path); AudioTypes.Contains(file.Ext()) ||
ImageTypes.Contains(file.Ext())).ToList();
foreach (string i in files) files.Sort(new StringLogicalComparer());
CommandV("loadfile", i, "append"); int index = files.IndexOf(path);
files.Remove(path);
if (index > 0) foreach (string i in files)
CommandV("playlist-move", "0", (index + 1).ToString()); CommandV("loadfile", i, "append");
if (index > 0)
CommandV("playlist-move", "0", (index + 1).ToString());
}
} }
bool WasAviSynthLoaded; bool WasAviSynthLoaded;

View File

@@ -23,7 +23,6 @@ namespace mpvnet
public Size WindowSize; public Size WindowSize;
public string ConfigEditorSearch = "Video:"; public string ConfigEditorSearch = "Video:";
public string Mute = "no"; public string Mute = "no";
public string UpdateCheckVersion = "";
} }
class SettingsManager class SettingsManager

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 // 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("6.0.1.0")] [assembly: AssemblyVersion("6.0.3.0")]
[assembly: AssemblyFileVersion("6.0.1.0")] [assembly: AssemblyFileVersion("6.0.3.0")]

View File

@@ -50,7 +50,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(288F, 288F); this.AutoScaleDimensions = new System.Drawing.SizeF(288F, 288F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.Black; this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(348, 0); this.ClientSize = new System.Drawing.Size(857, 444);
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);

View File

@@ -48,7 +48,7 @@ namespace mpvnet
Core.FileLoaded += Core_FileLoaded; Core.FileLoaded += Core_FileLoaded;
Core.Pause += Core_Pause; Core.Pause += Core_Pause;
Core.PlaylistPosChanged += (value) => SetTitle(); Core.PlaylistPosChanged += Core_PlaylistPosChanged;
Core.ScaleWindow += Core_ScaleWindow; Core.ScaleWindow += Core_ScaleWindow;
Core.Seek += () => UpdateProgressBar(); Core.Seek += () => UpdateProgressBar();
Core.ShowMenu += Core_ShowMenu; Core.ShowMenu += Core_ShowMenu;
@@ -118,6 +118,12 @@ namespace mpvnet
} }
} }
private void Core_PlaylistPosChanged(int pos)
{
if (pos == -1)
SetTitle();
}
void Init() void Init()
{ {
Core.Init(Handle); Core.Init(Handle);
@@ -614,7 +620,12 @@ namespace mpvnet
if (WasMaximized) if (WasMaximized)
WindowState = FormWindowState.Maximized; WindowState = FormWindowState.Maximized;
else else
{
WindowState = FormWindowState.Normal; WindowState = FormWindowState.Normal;
if (!Core.WasInitialSizeSet)
SetFormPosAndSize();
}
if (Core.Border) if (Core.Border)
FormBorderStyle = FormBorderStyle.Sizable; FormBorderStyle = FormBorderStyle.Sizable;
@@ -720,7 +731,7 @@ namespace mpvnet
void Core_FileLoaded() void Core_FileLoaded()
{ {
BeginInvoke(new Action(() => { BeginInvoke(new Action(() => {
Text = Core.Expand(Title); SetTitleInternal();
int interval = (int)(Core.Duration.TotalMilliseconds / 100); int interval = (int)(Core.Duration.TotalMilliseconds / 100);
@@ -759,7 +770,22 @@ namespace mpvnet
} }
} }
void SetTitle() => BeginInvoke(new Action(() => Text = Core.Expand(Title))); void SetTitle() => BeginInvoke(new Action(() => SetTitleInternal()));
void SetTitleInternal()
{
string title = Title;
if (title == "${filename}" && Core.Path.ContainsEx("://"))
title = "${media-title}";
string text = Core.Expand(title);
if (text == "(unavailable)")
text = "mpv.net";
Text = text;
}
public void Voodoo() public void Voodoo()
{ {