diff --git a/src/MpvNet.Windows/Conf.cs b/src/MpvNet.Windows/Conf.cs index 87fde57..700f361 100644 --- a/src/MpvNet.Windows/Conf.cs +++ b/src/MpvNet.Windows/Conf.cs @@ -82,7 +82,7 @@ public class ConfParser { public static List Parse(string content) { - string[] lines = content.Split(BR.ToCharArray(), StringSplitOptions.None); + string[] lines = content.Split(new[] { "\r\n" }, StringSplitOptions.None); var sections = new List(); ConfSection? currentGroup = null; diff --git a/src/MpvNet.Windows/GuiCommand.cs b/src/MpvNet.Windows/GuiCommand.cs index e7563c4..f078f20 100644 --- a/src/MpvNet.Windows/GuiCommand.cs +++ b/src/MpvNet.Windows/GuiCommand.cs @@ -48,13 +48,13 @@ public class GuiCommand ["show-command-palette"] = args => ShowCommandPalette(), - // backward compatibility - ["show-info"] = args => ShowMediaInfo(new[] { "osd" }), // backward compatibility - ["playlist-random"] = args => PlaylistRandom(), // backward compatibility - ["quick-bookmark"] = args => QuickBookmark(), // backward compatibility - ["show-commands"] = args => ShowCommands(), // backward compatibility - ["show-history"] = args => ShowHistory(), // backward compatibility - ["show-playlist"] = args => ShowPlaylist(), // backward compatibility + // deprecated + ["show-info"] = args => ShowMediaInfo(new[] { "osd" }), // deprecated + ["playlist-random"] = args => PlaylistRandom(), // deprecated + ["quick-bookmark"] = args => QuickBookmark(), // deprecated + ["show-commands"] = args => ShowCommands(), // deprecated + ["show-history"] = args => ShowHistory(), // deprecated + ["show-playlist"] = args => ShowPlaylist(), // deprecated }; public void ShowDialog(Type winType) @@ -276,27 +276,27 @@ public class GuiCommand }); } - // backward compatibility + // deprecated public void PlaylistRandom() => Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" + "https://github.com/stax76/mpv-scripts/blob/main/misc.lua"); - // backward compatibility + // deprecated public void QuickBookmark() => Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" + "https://github.com/stax76/mpv-scripts/blob/main/misc.lua"); - // backward compatibility + // deprecated public void ShowCommands() => Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" + "https://github.com/stax76/mpv-scripts#command_palette"); - // backward compatibility + // deprecated public void ShowHistory() => Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" + "https://github.com/stax76/mpv-scripts/blob/main/history.lua"); - // backward compatibility + // deprecated public void ShowPlaylist() => Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" + "https://github.com/stax76/mpv-scripts#command_palette"); diff --git a/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs b/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs index 202514c..5f344fe 100644 --- a/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs +++ b/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs @@ -459,7 +459,7 @@ public partial class ConfWindow : Window, INotifyPropertyChanged node.IsSelected = false; foreach (var it in node.Children) - SelectNodeFromSearchText(it); + UnselectNode(it); } void ExpandNode(NodeViewModel node) @@ -467,7 +467,7 @@ public partial class ConfWindow : Window, INotifyPropertyChanged node.IsExpanded = true; foreach (var it in node.Children) - SelectNodeFromSearchText(it); + ExpandNode(it); } [RelayCommand] void ShowMpvNetSpecificSettings() => SearchControl.Text = "mpv.net"; diff --git a/src/MpvNet/Command.cs b/src/MpvNet/Command.cs index 161b23e..75f7632 100644 --- a/src/MpvNet/Command.cs +++ b/src/MpvNet/Command.cs @@ -19,13 +19,13 @@ public class Command ["show-text"] = args => ShowText(args[0], Convert.ToInt32(args[1]), Convert.ToInt32(args[2])), - // backward compatibility - ["playlist-add"] = args => PlaylistAdd(Convert.ToInt32(args[0])), // backward compatibility - ["show-progress"] = args => ShowProgress(), // backward compatibility - ["cycle-audio"] = args => CycleAudio(), // backward compatibility - ["cycle-subtitles"] = args => CycleSubtitles(), // backward compatibility - ["playlist-first"] = args => PlaylistFirst(), // backward compatibility - ["playlist-last"] = args => PlaylistLast(), // backward compatibility + // deprecated + ["playlist-add"] = args => PlaylistAdd(Convert.ToInt32(args[0])), // deprecated + ["show-progress"] = args => ShowProgress(), // deprecated + ["cycle-audio"] = args => CycleAudio(), // deprecated + ["cycle-subtitles"] = args => CycleSubtitles(), // deprecated + ["playlist-first"] = args => PlaylistFirst(), // deprecated + ["playlist-last"] = args => PlaylistLast(), // deprecated }; public string FormatTime(double value) => ((int)value).ToString("00"); @@ -64,7 +64,7 @@ public class Command "}${osd-ass-cc/1}" + text + "\" " + duration); } - // backward compatibility + // deprecated public static void PlaylistAdd(int value) { int pos = Player.PlaylistPos; @@ -84,7 +84,7 @@ public class Command Player.SetPropertyInt("playlist-pos", pos); } - // backward compatibility + // deprecated public void ShowProgress() { TimeSpan position = TimeSpan.FromSeconds(Player.GetPropertyDouble("time-pos")); @@ -99,7 +99,7 @@ public class Command Player.CommandV("show-text", text, "5000"); } - // backward compatibility + // deprecated public static void CycleAudio() { Player.UpdateExternalTracks(); @@ -128,7 +128,7 @@ public class Command } } - // backward compatibility + // deprecated public static void CycleSubtitles() { Player.UpdateExternalTracks(); @@ -160,14 +160,14 @@ public class Command } } - // backward compatibility + // deprecated public static void PlaylistFirst() { if (Player.PlaylistPos != 0) Player.SetPropertyInt("playlist-pos", 0); } - // backward compatibility + // deprecated public static void PlaylistLast() { int count = Player.GetPropertyInt("playlist-count"); diff --git a/src/MpvNet/Global.cs b/src/MpvNet/Global.cs index 74632ad..4315e5e 100644 --- a/src/MpvNet/Global.cs +++ b/src/MpvNet/Global.cs @@ -6,6 +6,6 @@ public static class Global public static readonly string BR = Environment.NewLine; public static readonly string BR2 = Environment.NewLine + Environment.NewLine; public static readonly MainPlayer Player = new MainPlayer(); - public static readonly MainPlayer Core = Player; // backward compatibility + public static readonly MainPlayer Core = Player; // deprecated public static readonly AppClass App = new AppClass(); }