Skip to content

Commit

Permalink
release v7.0.0.1 Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
stax76 committed Dec 11, 2023
1 parent a61a050 commit 8e45cdb
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 136 deletions.
16 changes: 8 additions & 8 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

# v7.0.0.0 Beta (2023-??-??)
# v7.0.0.1 Beta (2023-12-11)

- [.NET 6 is a new requirement](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
(Windows 7 is still supported)
- The command palette was removed because of a compatibility problem with
the .NET 6 platform. There are user scripts as replacement:
[command_palette](https://github.com/stax76/mpv-scripts#command_palette) or
[search_menu](https://github.com/stax76/mpv-scripts#search_menu).
Unfortunately the user scripts don't support IME mode which is a problem for Asian users.
- The blue mpv.net logo was removed for better mpv compatibility.
the .NET 6 platform. There are user scripts with similar functionality:
- [command_palette](https://github.com/stax76/mpv-scripts#command_palette)
- [search_menu](https://github.com/stax76/mpv-scripts#search_menu)
- [uosc](https://github.com/tomasklaen/uosc)
- The blue mpv.net logo was removed for better OSC compatibility.
- Fix message box exceding working area size.
- C# and PowerShell scripting was removed because of a compatibility problem
with the .NET 6 platform. .NET extensions are supported with a new host
Expand All @@ -28,9 +28,9 @@
- Context menu and message boxes are available in the languages Chinese and German.
Interested joining our translation team?: https://app.transifex.com/stax76/teams/
- Support for encoding mode and thumbfast.
- For script authors the following info is available in user-data:
- For script authors, the following info is available in user-data:
user-data/frontend/name=mpv.net
user-data/frontend/version=7.0.0.0
user-data/frontend/version=version name
user-data/frontend/process-path=the process path
- MediaInfo 23.11
- libmpv zhongfly 2023-11-03.
Expand Down
5 changes: 3 additions & 2 deletions src/MpvNet.Windows/MpvNet.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<TargetFramework>net6.0-windows</TargetFramework>
<RootNamespace>MpvNet.Windows</RootNamespace>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<PublishSingleFile>true</PublishSingleFile>
<AssemblyName>mpvnet</AssemblyName>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>mpv-icon.ico</ApplicationIcon>
<Product>mpv.net</Product>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<FileVersion>7.0.0.0</FileVersion>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<FileVersion>7.0.0.1</FileVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/MpvNet.Windows/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void Main()
{
App.AutoLoadFolder = false;
Player.Init(IntPtr.Zero);
Player.ProcessCommandLine(false);
Player.ProcessCommandLineFiles();
Player.SetPropertyString("idle", "no");
Player.EventLoop();
Player.Destroy();
Expand Down
21 changes: 0 additions & 21 deletions src/MpvNet.Windows/Release.ps1

This file was deleted.

4 changes: 0 additions & 4 deletions src/MpvNet.Windows/WPF/InputWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,11 @@ void Window_Closed(object sender, EventArgs e)
return;

if (App.InputConf.HasMenu)
{
App.InputConf.CreateBackup();
File.WriteAllText(App.InputConf.Path, App.InputConf.Content = newContent);
}
else
{
newContent = InputHelp.ConvertToString(InputHelp.GetReducedBindings(Bindings));
newContent = newContent.Replace("#menu: ", "# ");
App.InputConf.CreateBackup();
File.WriteAllText(App.InputConf.Path, App.InputConf.Content = newContent);
}

Expand Down
2 changes: 1 addition & 1 deletion src/MpvNet.Windows/WinForms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void Init()

Player.ObservePropertyDouble("window-scale", PropChangeWindowScale);

Player.ProcessCommandLine(false);
Player.ProcessCommandLineFiles();
}

void PropChangeWindowScale(double scale)
Expand Down
11 changes: 0 additions & 11 deletions src/MpvNet/InputConf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,4 @@ public string GetContent()
return InputHelp.ConvertToString(defaults);
}
}

public void CreateBackup()
{
if (!File.Exists(Path))
return;

string targetPath = System.IO.Path.GetTempPath().AddSep() +
"mpv.net input.conf backup " + Guid.NewGuid() + ".conf";

File.Copy(Path, targetPath);
}
}
164 changes: 76 additions & 88 deletions src/MpvNet/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void Init(IntPtr formHandle)
if (!string.IsNullOrEmpty(UsedInputConfContent))
SetPropertyString("input-conf", @"memory://" + UsedInputConfContent);

ProcessCommandLine(true);
ProcessCommandLineArgs();

if (App.CommandLineArguments.ContainsKey("config-dir"))
{
Expand Down Expand Up @@ -407,114 +407,102 @@ void ProcessBluRayLogMessage(string msg)

public void SetBluRayTitle(int id) => LoadFiles(new[] { @"bd://" + id }, false, false);

public void ProcessCommandLine(bool preInit)
public void ProcessCommandLineArgs()
{
bool shuffle = false;
var args = Environment.GetCommandLineArgs().Skip(1);

foreach (string i in args)
foreach (string i in Environment.GetCommandLineArgs().Skip(1))
{
string arg = i;

if (arg.StartsWith("-") && arg.Length > 1)
{
if (!preInit)
{
if (arg == "--profile=help")
{
Console.WriteLine(GetProfiles());
continue;
}
else if (arg == "--vd=help" || arg == "--ad=help")
{
Console.WriteLine(GetDecoders());
continue;
}
else if (arg == "--audio-device=help")
{
Console.WriteLine(GetPropertyOsdString("audio-device-list"));
continue;
}
else if (arg == "--version")
{
Console.WriteLine(AppClass.About);
continue;
}
else if (arg == "--input-keylist")
{
Console.WriteLine(GetPropertyString("input-key-list").Replace(",", BR));
continue;
}
else if (arg.StartsWith("--command="))
{
Command(arg[10..]);
continue;
}
}
if (!arg.StartsWith("--"))
continue;

if (!arg.StartsWith("--"))
arg = "-" + arg;
if (arg == "--profile=help")
{
Console.WriteLine(GetProfiles());
continue;
}
else if (arg == "--vd=help" || arg == "--ad=help")
{
Console.WriteLine(GetDecoders());
continue;
}
else if (arg == "--audio-device=help")
{
Console.WriteLine(GetPropertyOsdString("audio-device-list"));
continue;
}
else if (arg == "--version")
{
Console.WriteLine(AppClass.About);
continue;
}
else if (arg == "--input-keylist")
{
Console.WriteLine(GetPropertyString("input-key-list").Replace(",", BR));
continue;
}
else if (arg.StartsWith("--command="))
{
Command(arg[10..]);
continue;
}

if (!arg.Contains('='))
if (!arg.Contains('='))
{
if (arg.Contains("--no-"))
{
if (arg.Contains("--no-"))
{
arg = arg.Replace("--no-", "--");
arg += "=no";
}
else
arg += "=yes";
arg = arg.Replace("--no-", "--");
arg += "=no";
}
else
arg += "=yes";
}

string left = arg[2..arg.IndexOf("=")];
string right = arg[(left.Length + 3)..];

if (string.IsNullOrEmpty(left))
continue;
string left = arg[2..arg.IndexOf("=")];
string right = arg[(left.Length + 3)..];

switch (left)
{
case "script": left = "scripts"; break;
case "audio-file": left = "audio-files"; break;
case "sub-file": left = "sub-files"; break;
case "external-file": left = "external-files"; break;
}
if (string.IsNullOrEmpty(left))
continue;

if (left == "shuffle" && right == "yes")
shuffle = true;
switch (left)
{
case "script": left = "scripts"; break;
case "audio-file": left = "audio-files"; break;
case "sub-file": left = "sub-files"; break;
case "external-file": left = "external-files"; break;
}

App.CommandLineArguments[left] = right;
App.CommandLineArguments[left] = right;

ProcessProperty(left, right);
ProcessProperty(left, right);

if (!App.ProcessProperty(left, right))
SetPropertyString(left, right);
}
if (!App.ProcessProperty(left, right))
SetPropertyString(left, right);
}
}

if (!preInit)
{
List<string> files = new List<string>();
public void ProcessCommandLineFiles()
{
List<string> files = new List<string>();

foreach (string arg in args)
if (!arg.StartsWith("--") && (arg == "-" || arg.Contains("://") ||
arg.Contains(":\\") || arg.StartsWith("\\\\") || File.Exists(arg)))
foreach (string arg in Environment.GetCommandLineArgs().Skip(1))
if (!arg.StartsWith("--") && (arg == "-" || arg.Contains("://") ||
arg.Contains(":\\") || arg.StartsWith("\\\\") || File.Exists(arg)))

files.Add(arg);
files.Add(arg);

LoadFiles(files.ToArray(), !App.Queue, false || App.Queue);
LoadFiles(files.ToArray(), !App.Queue, false || App.Queue);

if (shuffle)
{
Command("playlist-shuffle");
SetPropertyInt("playlist-pos", 0);
}
if (App.CommandLine.Contains("--shuffle"))
{
Command("playlist-shuffle");
SetPropertyInt("playlist-pos", 0);
}

if (files.Count == 0 || files[0].Contains("://"))
{
VideoSizeChanged?.Invoke(VideoSize);
VideoSizeAutoResetEvent.Set();
}
if (files.Count == 0 || files[0].Contains("://"))
{
VideoSizeChanged?.Invoke(VideoSize);
VideoSizeAutoResetEvent.Set();
}
}

Expand Down

0 comments on commit 8e45cdb

Please sign in to comment.