Compare commits
18 Commits
v7.1.1.5-b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef45baecbd | ||
|
|
30e75b2100 | ||
|
|
563472b489 | ||
|
|
724a9adab8 | ||
|
|
9686c28f6a | ||
|
|
03d0aeb879 | ||
|
|
96afc62165 | ||
|
|
fd3ea9afe9 | ||
|
|
853d38a427 | ||
|
|
76a2f64fa6 | ||
|
|
6c0e116918 | ||
|
|
c1abf90559 | ||
|
|
eb085a6534 | ||
|
|
78b85d59aa | ||
|
|
0f900e01fa | ||
|
|
f754d4d865 | ||
|
|
474c4e888d | ||
|
|
8f8ca453da |
@@ -137,3 +137,11 @@ Searchable config editor as alternative to edit the conf file manually.
|
||||
#### Terminal
|
||||
|
||||

|
||||
|
||||
|
||||
Other projects from me
|
||||
----------------------
|
||||
|
||||
A list of my other projects can be found here:
|
||||
|
||||
https://stax76.github.io/software-list
|
||||
@@ -1,4 +1,12 @@
|
||||
|
||||
- The Japanese translation was updated. Thanks to the translators!
|
||||
|
||||
# v7.1.2.0 (2026-01-09)
|
||||
|
||||
- libmpv updated to v0.41 2026-01-09.
|
||||
- Some adjustments to recent mpv changes.
|
||||
- The Japanese and Turkish translations were updated. Thanks to the translators!
|
||||
|
||||
# v7.1.1.5 Beta (2025-11-20)
|
||||
|
||||
- Same as in mpv the `?` and `t-4` keys can be used to show the active
|
||||
|
||||
@@ -53,7 +53,7 @@ Installation
|
||||
#### Requirements
|
||||
|
||||
1. Windows 10 or higher.
|
||||
2. [.NET Desktop Runtime 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
|
||||
2. [.NET Desktop Runtime 10.0](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
|
||||
|
||||
Internet streaming requires:
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ msgstr "フォントサイズを拡大"
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:148
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:149
|
||||
msgid "More"
|
||||
msgstr "詳細"
|
||||
msgstr "その他"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:103
|
||||
msgid "Toggle overriding SSA/ASS styles with normal styles"
|
||||
@@ -583,7 +583,7 @@ msgstr "再生履歴"
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:140
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:245
|
||||
msgid "Watch Later"
|
||||
msgstr "後で再生"
|
||||
msgstr "再生位置を保存"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:142
|
||||
msgid "Console"
|
||||
@@ -818,7 +818,7 @@ msgstr "ハードウェアデコードの切り替え"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:188
|
||||
msgid "Exit Watch Later"
|
||||
msgstr "後で再生を解除"
|
||||
msgstr "再生位置を保存して終了"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:190
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet.Windows\WinForms\MainForm.cs:477
|
||||
|
||||
@@ -53,11 +53,11 @@ msgstr "Mpv.net hakkında"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:144
|
||||
msgid "Active Bindings In Text Editor"
|
||||
msgstr "Metin Düzenleyicide Aktif Kısayol Atamaları"
|
||||
msgstr "Metin Düzenleyicide Aktif Kısayol Atamalarını Göster"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:145
|
||||
msgid "Active Bindings On-Screen"
|
||||
msgstr "Ekrandaki Aktif Kısayol Atamaları"
|
||||
msgstr "Ekranda Aktif Kısayol Atamalarını Göster"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:16
|
||||
msgid "Add external audio files..."
|
||||
@@ -139,7 +139,6 @@ msgid "Clear List"
|
||||
msgstr "Listeyi Temizle"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:143
|
||||
#, fuzzy
|
||||
msgid "Commands"
|
||||
msgstr "Komutları Göster"
|
||||
|
||||
@@ -161,7 +160,6 @@ msgid "Config"
|
||||
msgstr "Yapılandırma"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:142
|
||||
#, fuzzy
|
||||
msgid "Console"
|
||||
msgstr "Konsolu Göster"
|
||||
|
||||
@@ -171,9 +169,8 @@ msgid "Custom"
|
||||
msgstr "Özel"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:148
|
||||
#, fuzzy
|
||||
msgid "Decoders"
|
||||
msgstr "Decoderi Göster"
|
||||
msgstr "Kod Çözücüleri Göster"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:70
|
||||
msgid "Decrease Brightness"
|
||||
@@ -214,7 +211,6 @@ msgid "Delay -0.1"
|
||||
msgstr "Gecikme -0.1"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:149
|
||||
#, fuzzy
|
||||
msgid "Demuxers"
|
||||
msgstr "Demuxeri Göster"
|
||||
|
||||
@@ -242,7 +238,6 @@ msgstr "Mpv.conf dosyasını düzenle"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:136
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:241
|
||||
#, fuzzy
|
||||
msgid "Editions"
|
||||
msgstr "Sürümler"
|
||||
|
||||
@@ -391,7 +386,6 @@ msgid "Jump To Previous Frame"
|
||||
msgstr "Önceki Kare"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:146
|
||||
#, fuzzy
|
||||
msgid "Keys"
|
||||
msgstr "Kısayol Tuşlarını Göster"
|
||||
|
||||
@@ -417,12 +411,10 @@ msgid "Mark position for revert-seek"
|
||||
msgstr "Geri arama için konumu işaretle"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:124
|
||||
#, fuzzy
|
||||
msgid "Media Info Message Box"
|
||||
msgstr "Medya Bilgisi Mesaj Kutusunu Göster"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:123
|
||||
#, fuzzy
|
||||
msgid "Media Info On-Screen"
|
||||
msgstr "Medya Bilgilerini Ekranda Göster"
|
||||
|
||||
@@ -528,9 +520,8 @@ msgstr "Sonraki Ses Parçası"
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:248
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:249
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:250
|
||||
#, fuzzy
|
||||
msgid "On-Screen Menu"
|
||||
msgstr "Ekran Menüsü"
|
||||
msgstr "Ekran Üzeri Menüsü"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:175
|
||||
msgid "Open Config Folder"
|
||||
@@ -575,7 +566,7 @@ msgstr "Oynat/Duraklat"
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:25
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:26
|
||||
msgid "Playback"
|
||||
msgstr "Kayıttan yürüt"
|
||||
msgstr "Kayıttan Yürüt"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:120
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:127
|
||||
@@ -600,7 +591,6 @@ msgid "Profile"
|
||||
msgstr "Profil"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:125
|
||||
#, fuzzy
|
||||
msgid "Progress"
|
||||
msgstr "İlerlemeyi Göster"
|
||||
|
||||
@@ -610,7 +600,6 @@ msgid "Properties"
|
||||
msgstr "Özellikler"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:147
|
||||
#, fuzzy
|
||||
msgid "Protocols"
|
||||
msgstr "Protokoller"
|
||||
|
||||
@@ -654,7 +643,6 @@ msgid "Secondary Subtitle"
|
||||
msgstr "İkincil Altyazı"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:236
|
||||
#, fuzzy
|
||||
msgid "Secondary Subtitles"
|
||||
msgstr "İkincil Altyazı"
|
||||
|
||||
@@ -761,7 +749,6 @@ msgid "Subtitle Tracks"
|
||||
msgstr "Altyazı Parçaları"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:235
|
||||
#, fuzzy
|
||||
msgid "Subtitles"
|
||||
msgstr "Altyazı"
|
||||
|
||||
@@ -771,7 +758,7 @@ msgstr "Ekran Görüntüsü Al"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:80
|
||||
msgid "Take Screenshot without subtitles"
|
||||
msgstr "Ekran görüntüsünü altyazısız al"
|
||||
msgstr "Ekran Görüntüsünü Altyazısız Al"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet.Windows\GuiCommand.cs:207
|
||||
msgid "The clipboard does not contain a valid URL or file."
|
||||
@@ -945,9 +932,8 @@ msgstr "İzleme Geçmişi"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:140
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:245
|
||||
#, fuzzy
|
||||
msgid "Watch Later"
|
||||
msgstr "Daha Sonra İzle'den Çık"
|
||||
msgstr "Daha Sonra İzle"
|
||||
|
||||
#: D:\Projects\CS\mpv.net\src\MpvNet\InputHelp.cs:192
|
||||
msgid "Website mpv"
|
||||
@@ -1013,7 +999,6 @@ msgstr "Mpv.net Path ortam değişkeninden başarıyla kaldırıldı."
|
||||
msgid "theme"
|
||||
msgstr "tema"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Select Menu"
|
||||
#~ msgstr "Menü Seç"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
|
||||
namespace MpvNet.Windows;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Windows.Forms;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows;
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
using MpvNet.Windows.WinForms;
|
||||
using MpvNet.Windows.WPF.Views;
|
||||
using MpvNet.Windows.WPF;
|
||||
@@ -303,20 +303,20 @@ public class GuiCommand
|
||||
|
||||
if (File.Exists(path) && osd)
|
||||
{
|
||||
if (FileTypes.IsAudio(path.Ext()))
|
||||
if (FileTypes.IsAudio(path.Ext))
|
||||
{
|
||||
text = Player.GetPropertyOsdString("filtered-metadata");
|
||||
Player.CommandV("show-text", text, "5000");
|
||||
return;
|
||||
}
|
||||
else if (FileTypes.IsImage(path.Ext()))
|
||||
else if (FileTypes.IsImage(path.Ext))
|
||||
{
|
||||
fileSize = new FileInfo(path).Length;
|
||||
|
||||
text = "Width: " + Player.GetPropertyInt("width") + "\n" +
|
||||
"Height: " + Player.GetPropertyInt("height") + "\n" +
|
||||
"Size: " + Convert.ToInt32(fileSize / 1024.0) + " KB\n" +
|
||||
"Type: " + path.Ext().ToUpper();
|
||||
"Type: " + path.Ext.ToUpper();
|
||||
|
||||
Player.CommandV("show-text", text, "5000");
|
||||
return;
|
||||
@@ -332,7 +332,7 @@ public class GuiCommand
|
||||
int width = Player.GetPropertyInt("video-params/w");
|
||||
int height = Player.GetPropertyInt("video-params/h");
|
||||
TimeSpan len = TimeSpan.FromSeconds(Player.GetPropertyDouble("duration"));
|
||||
text = path.FileName() + "\n";
|
||||
text = path.FileName + "\n";
|
||||
text += FormatTime(len.TotalMinutes) + ":" + FormatTime(len.Seconds) + "\n";
|
||||
if (fileSize > 0)
|
||||
text += Convert.ToInt32(fileSize / 1024.0 / 1024.0) + " MB\n";
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ApplicationIcon>mpv-icon.ico</ApplicationIcon>
|
||||
<FileVersion>7.1.1.5</FileVersion>
|
||||
<AssemblyVersion>7.1.1.5</AssemblyVersion>
|
||||
<InformationalVersion>7.1.1.5</InformationalVersion>
|
||||
<FileVersion>7.1.2.0</FileVersion>
|
||||
<AssemblyVersion>7.1.2.0</AssemblyVersion>
|
||||
<InformationalVersion>7.1.2.0</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -60,7 +60,8 @@ file = mpv
|
||||
directory = Video
|
||||
help = Video output drivers to be used.\n\nFor more information visit:
|
||||
url = https://mpv.io/manual/master/#video-output-drivers-vo
|
||||
default = gpu
|
||||
default = info
|
||||
option = info Choose the best mode automatically.
|
||||
option = gpu General purpose, customizable, GPU-accelerated video output driver. It supports extended scaling methods, dithering, color management, custom shaders, HDR, and more.
|
||||
option = gpu-next Experimental video renderer based on libplacebo. This supports almost the same set of features as --vo=gpu.
|
||||
option = direct3d Video output driver that uses the Direct3D interface.
|
||||
@@ -88,9 +89,9 @@ option = nvdec-copy copies video back to system RAM
|
||||
name = gpu-api
|
||||
file = mpv
|
||||
directory = Video/Render Options
|
||||
help = Controls which type of graphics APIs will be accepted. On Windows this defaults to d3d11 and should not be changed without a good reason.
|
||||
help = Controls which type of graphics APIs will be accepted.
|
||||
default = auto
|
||||
option = auto Use any available API
|
||||
option = auto Use any available API. Note that the default GPU API used for this value is subject to change, and must not be relied upon. If a certain GPU API needs to be used, it must be explicitly specified
|
||||
option = d3d11 Allow only gpu-context=d3d11
|
||||
option = opengl Allow only OpenGL (requires OpenGL 2.1+ or GLES 2.0+)
|
||||
option = vulkan Allow only Vulkan
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
|
||||
namespace MpvNet.Windows.UI;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Text.RegularExpressions;
|
||||
using MpvNet.Windows.WPF;
|
||||
using MpvNet.Windows.UI;
|
||||
using MpvNet.Help;
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
using MpvNet.MVVM;
|
||||
using MpvNet.Windows.WPF.MsgBox;
|
||||
|
||||
@@ -556,12 +556,12 @@ public partial class MainForm : Form
|
||||
if (App.AutofitImage > 1)
|
||||
App.AutofitImage = 1;
|
||||
|
||||
bool isAudio = FileTypes.IsAudio(Player.Path.Ext());
|
||||
bool isAudio = FileTypes.IsAudio(Player.Path.Ext);
|
||||
|
||||
if (isAudio)
|
||||
autoFitHeight = Convert.ToInt32(workingArea.Height * App.AutofitAudio);
|
||||
|
||||
if (FileTypes.IsImage(Player.Path.Ext()))
|
||||
if (FileTypes.IsImage(Player.Path.Ext))
|
||||
autoFitHeight = Convert.ToInt32(workingArea.Height * App.AutofitImage);
|
||||
|
||||
if (Player.VideoSize.Height == 0 || Player.VideoSize.Width == 0)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.PowerShell.5.ReferenceAssemblies" version="1.1.0" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
using MpvNet.Help;
|
||||
using MpvNet.MVVM;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
|
||||
namespace MpvNet;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
|
||||
namespace MpvNet;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ExtensionLoader
|
||||
{
|
||||
foreach (string dir in Directory.GetDirectories(path))
|
||||
{
|
||||
LoadDll(dir.AddSep() + Path.GetFileName(dir) + ".dll");
|
||||
LoadDll(dir.Separator + Path.GetFileName(dir) + ".dll");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
namespace MpvNet.ExtensionMethod;
|
||||
|
||||
public static class ObjectExtension
|
||||
{
|
||||
public static string ToStringEx(this object instance) => instance?.ToString() ?? "";
|
||||
}
|
||||
10
src/MpvNet/ExtensionMethod/ObjectExtensions.cs
Normal file
10
src/MpvNet/ExtensionMethod/ObjectExtensions.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
namespace MpvNet.Extensions;
|
||||
|
||||
public static class ObjectExtensions
|
||||
{
|
||||
extension(object instance)
|
||||
{
|
||||
public string ToStringEx() => instance?.ToString() ?? "";
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
|
||||
namespace MpvNet.ExtensionMethod;
|
||||
|
||||
public static class PathStringExtension
|
||||
{
|
||||
public static string Ext(this string filepath) => filepath.Ext(false);
|
||||
|
||||
public static string Ext(this string filepath, bool includeDot)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filepath))
|
||||
return "";
|
||||
|
||||
char[] chars = filepath.ToCharArray();
|
||||
|
||||
for (int x = filepath.Length - 1; x >= 0; x--)
|
||||
{
|
||||
if (chars[x] == Path.DirectorySeparatorChar)
|
||||
return "";
|
||||
|
||||
if (chars[x] == '.')
|
||||
return filepath.Substring(x + (includeDot ? 0 : 1)).ToLowerInvariant();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string FileName(this string instance)
|
||||
{
|
||||
if (string.IsNullOrEmpty(instance))
|
||||
return "";
|
||||
|
||||
int index = instance.LastIndexOf('\\');
|
||||
|
||||
if (index > -1)
|
||||
return instance[(index + 1)..];
|
||||
|
||||
index = instance.LastIndexOf('/');
|
||||
|
||||
if (index > -1)
|
||||
return instance[(index + 1)..];
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static string ShortPath(this string instance, int maxLength)
|
||||
{
|
||||
if (string.IsNullOrEmpty(instance))
|
||||
return "";
|
||||
|
||||
if (instance.Length > maxLength && instance.Substring(1, 2) == ":\\")
|
||||
instance = instance[..3] + "...\\" + instance.FileName();
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Ensure trailing directory separator char
|
||||
public static string AddSep(this string instance)
|
||||
{
|
||||
if (string.IsNullOrEmpty(instance))
|
||||
return "";
|
||||
|
||||
if (!instance.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
instance = instance + Path.DirectorySeparatorChar;
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
77
src/MpvNet/ExtensionMethod/PathStringExtensions.cs
Normal file
77
src/MpvNet/ExtensionMethod/PathStringExtensions.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
namespace MpvNet.Extensions;
|
||||
|
||||
public static class PathStringExtensions
|
||||
{
|
||||
extension(string filepath)
|
||||
{
|
||||
public string Ext => GetExt(filepath, false);
|
||||
|
||||
static string GetExt(string path, bool includeDot)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return "";
|
||||
|
||||
char[] chars = path.ToCharArray();
|
||||
|
||||
for (int x = path.Length - 1; x >= 0; x--)
|
||||
{
|
||||
if (chars[x] == '/')
|
||||
return "";
|
||||
if (chars[x] == '\\')
|
||||
return "";
|
||||
if (chars[x] == '.')
|
||||
return path[(x + (includeDot ? 0 : 1))..].ToLowerInvariant();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public string FileName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(filepath))
|
||||
return "";
|
||||
|
||||
int index = filepath.LastIndexOf('\\');
|
||||
|
||||
if (index > -1)
|
||||
return filepath[(index + 1)..];
|
||||
|
||||
index = filepath.LastIndexOf('/');
|
||||
|
||||
if (index > -1)
|
||||
return filepath[(index + 1)..];
|
||||
|
||||
return filepath;
|
||||
}
|
||||
}
|
||||
|
||||
public string ShortPath(int maxLength)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filepath))
|
||||
return "";
|
||||
|
||||
if (filepath.Length > maxLength && filepath.Substring(1, 2) == ":\\")
|
||||
filepath = $"{filepath[..3]}...\\{filepath.FileName}";
|
||||
|
||||
return filepath;
|
||||
}
|
||||
|
||||
// Ensure trailing directory separator char
|
||||
public string Separator
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(filepath))
|
||||
return "";
|
||||
|
||||
if (!filepath.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
filepath = filepath + Path.DirectorySeparatorChar;
|
||||
|
||||
return filepath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
|
||||
using System.Globalization;
|
||||
|
||||
namespace MpvNet.ExtensionMethod;
|
||||
namespace MpvNet.Extensions;
|
||||
|
||||
public static class StringExtension
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string ToUpperEx(this string instance) => (instance != null) ? instance.ToUpperInvariant() : "";
|
||||
public static string ToUpperEx(this string instance) => instance?.ToUpperInvariant() ?? "";
|
||||
|
||||
public static string ToLowerEx(this string instance) => (instance != null) ? instance.ToLowerInvariant() : "";
|
||||
public static string ToLowerEx(this string instance) => instance?.ToLowerInvariant() ?? "";
|
||||
|
||||
public static string TrimEx(this string? instance) => (instance == null) ? "" : instance.Trim();
|
||||
public static string TrimEx(this string? instance) => instance?.Trim() ?? "";
|
||||
|
||||
public static int ToInt(this string instance, int defaultValue = 0)
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
|
||||
namespace MpvNet;
|
||||
|
||||
@@ -49,5 +49,5 @@ public static class FileTypes
|
||||
IsVideo(exts, ext) || IsAudio(exts, ext) || IsImage(exts, ext);
|
||||
|
||||
public static IEnumerable<string> GetMediaFiles(string[] files) =>
|
||||
files.Where(i => IsMedia(files, i.Ext()));
|
||||
files.Where(i => IsMedia(files, i.Ext));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
|
||||
namespace MpvNet;
|
||||
|
||||
public class Folder
|
||||
{
|
||||
public static string Startup { get; } = Path.GetDirectoryName(Environment.ProcessPath)!.AddSep();
|
||||
public static string AppData { get; } = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).AddSep();
|
||||
public static string Startup { get; } = Path.GetDirectoryName(Environment.ProcessPath)!.Separator;
|
||||
public static string AppData { get; } = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Separator;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public static class InputHelp
|
||||
Add(b, new ("", "", "playlist-next", "MBTN_Forward", _("Next File")));
|
||||
Add(b, new ("", "", "playlist-prev", "<", _("Previous File")));
|
||||
Add(b, new ("", "", "playlist-next", ">", _("Next File")));
|
||||
Add(b, new ("", "", "ignore", "MBTN_Left", _("Ignore left mouse butten")));
|
||||
Add(b, new ("", "", "ignore", "MBTN_Left", _("Ignore left mouse button")));
|
||||
Add(b, new ("", "", "cycle fullscreen", "f", _("Fullscreen")));
|
||||
Add(b, new ("", "", "cycle fullscreen", "MBTN_Left_DBL", _("Fullscreen")));
|
||||
Add(b, new ("", "", "no-osd seek 1 exact", "Shift+Right", _("Seek Forward")));
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
|
||||
using MpvNet.ExtensionMethod;
|
||||
using MpvNet.Extensions;
|
||||
using MpvNet.Help;
|
||||
using MpvNet.Native;
|
||||
|
||||
@@ -127,7 +127,7 @@ public class MainPlayer : MpvClient
|
||||
{
|
||||
string configDir = CommandLine.GetValue("config-dir");
|
||||
string fullPath = System.IO.Path.GetFullPath(configDir);
|
||||
App.InputConf.Path = fullPath.AddSep() + "input.conf";
|
||||
App.InputConf.Path = fullPath.Separator + "input.conf";
|
||||
string content = App.InputConf.GetContent();
|
||||
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
@@ -250,7 +250,7 @@ public class MainPlayer : MpvClient
|
||||
string? mpvnet_home = Environment.GetEnvironmentVariable("MPVNET_HOME");
|
||||
|
||||
if (Directory.Exists(mpvnet_home))
|
||||
return _configFolder = mpvnet_home.AddSep();
|
||||
return _configFolder = mpvnet_home.Separator;
|
||||
|
||||
_configFolder = Folder.Startup + "portable_config";
|
||||
|
||||
@@ -260,7 +260,7 @@ public class MainPlayer : MpvClient
|
||||
if (!Directory.Exists(_configFolder))
|
||||
Directory.CreateDirectory(_configFolder);
|
||||
|
||||
_configFolder = _configFolder.AddSep();
|
||||
_configFolder = _configFolder.Separator;
|
||||
}
|
||||
|
||||
return _configFolder;
|
||||
@@ -441,7 +441,7 @@ public class MainPlayer : MpvClient
|
||||
|
||||
file = ConvertFilePath(file);
|
||||
|
||||
string ext = file.Ext();
|
||||
string ext = file.Ext;
|
||||
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
|
||||
<#
|
||||
|
||||
Script that releases mpv.net on GitHub.
|
||||
Script that builds mpv.net and releases it on GitHub.
|
||||
Please note that debug builds are built and released,
|
||||
for release builds, scripts need to be rewritten.
|
||||
|
||||
Needs 2 positional CLI arguments:
|
||||
1. Directory where the mpv.net source code is located.
|
||||
1. Directory where the mpv.net source code is located (mpv.net\src)
|
||||
2. Directory of the output files, for instance the desktop dir.
|
||||
|
||||
Dependencies:
|
||||
7zip installation found at: 'C:\Program Files\7-Zip\7z.exe'.
|
||||
Inno Setup compiler installation found at: 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe'.
|
||||
GitHub CLI https://cli.github.com
|
||||
GitHub CLI https://cli.github.com, the env var GH_TOKEN must be defined.
|
||||
|
||||
Notes:
|
||||
Before you run the script you need to update the versions found in the file:
|
||||
\mpv.net\src\MpvNet.Windows\MpvNet.Windows.csproj
|
||||
#>
|
||||
|
||||
# Stop when the first error occurs
|
||||
|
||||
Reference in New Issue
Block a user