conf editor bug fix
This commit is contained in:
@@ -82,7 +82,7 @@ public class ConfParser
|
|||||||
{
|
{
|
||||||
public static List<ConfSection> Parse(string content)
|
public static List<ConfSection> 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>();
|
var sections = new List<ConfSection>();
|
||||||
ConfSection? currentGroup = null;
|
ConfSection? currentGroup = null;
|
||||||
|
|
||||||
|
|||||||
@@ -48,13 +48,13 @@ public class GuiCommand
|
|||||||
["show-command-palette"] = args => ShowCommandPalette(),
|
["show-command-palette"] = args => ShowCommandPalette(),
|
||||||
|
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
["show-info"] = args => ShowMediaInfo(new[] { "osd" }), // backward compatibility
|
["show-info"] = args => ShowMediaInfo(new[] { "osd" }), // deprecated
|
||||||
["playlist-random"] = args => PlaylistRandom(), // backward compatibility
|
["playlist-random"] = args => PlaylistRandom(), // deprecated
|
||||||
["quick-bookmark"] = args => QuickBookmark(), // backward compatibility
|
["quick-bookmark"] = args => QuickBookmark(), // deprecated
|
||||||
["show-commands"] = args => ShowCommands(), // backward compatibility
|
["show-commands"] = args => ShowCommands(), // deprecated
|
||||||
["show-history"] = args => ShowHistory(), // backward compatibility
|
["show-history"] = args => ShowHistory(), // deprecated
|
||||||
["show-playlist"] = args => ShowPlaylist(), // backward compatibility
|
["show-playlist"] = args => ShowPlaylist(), // deprecated
|
||||||
};
|
};
|
||||||
|
|
||||||
public void ShowDialog(Type winType)
|
public void ShowDialog(Type winType)
|
||||||
@@ -276,27 +276,27 @@ public class GuiCommand
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public void PlaylistRandom() =>
|
public void PlaylistRandom() =>
|
||||||
Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" +
|
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");
|
"https://github.com/stax76/mpv-scripts/blob/main/misc.lua");
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public void QuickBookmark() =>
|
public void QuickBookmark() =>
|
||||||
Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" +
|
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");
|
"https://github.com/stax76/mpv-scripts/blob/main/misc.lua");
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public void ShowCommands() =>
|
public void ShowCommands() =>
|
||||||
Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" +
|
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");
|
"https://github.com/stax76/mpv-scripts#command_palette");
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public void ShowHistory() =>
|
public void ShowHistory() =>
|
||||||
Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" +
|
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");
|
"https://github.com/stax76/mpv-scripts/blob/main/history.lua");
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public void ShowPlaylist() =>
|
public void ShowPlaylist() =>
|
||||||
Msg.ShowInfo("This feature was moved to a user script,\nwhich can be found here:\n\n" +
|
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");
|
"https://github.com/stax76/mpv-scripts#command_palette");
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
|||||||
node.IsSelected = false;
|
node.IsSelected = false;
|
||||||
|
|
||||||
foreach (var it in node.Children)
|
foreach (var it in node.Children)
|
||||||
SelectNodeFromSearchText(it);
|
UnselectNode(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExpandNode(NodeViewModel node)
|
void ExpandNode(NodeViewModel node)
|
||||||
@@ -467,7 +467,7 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
|||||||
node.IsExpanded = true;
|
node.IsExpanded = true;
|
||||||
|
|
||||||
foreach (var it in node.Children)
|
foreach (var it in node.Children)
|
||||||
SelectNodeFromSearchText(it);
|
ExpandNode(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RelayCommand] void ShowMpvNetSpecificSettings() => SearchControl.Text = "mpv.net";
|
[RelayCommand] void ShowMpvNetSpecificSettings() => SearchControl.Text = "mpv.net";
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ public class Command
|
|||||||
["show-text"] = args => ShowText(args[0], Convert.ToInt32(args[1]), Convert.ToInt32(args[2])),
|
["show-text"] = args => ShowText(args[0], Convert.ToInt32(args[1]), Convert.ToInt32(args[2])),
|
||||||
|
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
["playlist-add"] = args => PlaylistAdd(Convert.ToInt32(args[0])), // backward compatibility
|
["playlist-add"] = args => PlaylistAdd(Convert.ToInt32(args[0])), // deprecated
|
||||||
["show-progress"] = args => ShowProgress(), // backward compatibility
|
["show-progress"] = args => ShowProgress(), // deprecated
|
||||||
["cycle-audio"] = args => CycleAudio(), // backward compatibility
|
["cycle-audio"] = args => CycleAudio(), // deprecated
|
||||||
["cycle-subtitles"] = args => CycleSubtitles(), // backward compatibility
|
["cycle-subtitles"] = args => CycleSubtitles(), // deprecated
|
||||||
["playlist-first"] = args => PlaylistFirst(), // backward compatibility
|
["playlist-first"] = args => PlaylistFirst(), // deprecated
|
||||||
["playlist-last"] = args => PlaylistLast(), // backward compatibility
|
["playlist-last"] = args => PlaylistLast(), // deprecated
|
||||||
};
|
};
|
||||||
|
|
||||||
public string FormatTime(double value) => ((int)value).ToString("00");
|
public string FormatTime(double value) => ((int)value).ToString("00");
|
||||||
@@ -64,7 +64,7 @@ public class Command
|
|||||||
"}${osd-ass-cc/1}" + text + "\" " + duration);
|
"}${osd-ass-cc/1}" + text + "\" " + duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public static void PlaylistAdd(int value)
|
public static void PlaylistAdd(int value)
|
||||||
{
|
{
|
||||||
int pos = Player.PlaylistPos;
|
int pos = Player.PlaylistPos;
|
||||||
@@ -84,7 +84,7 @@ public class Command
|
|||||||
Player.SetPropertyInt("playlist-pos", pos);
|
Player.SetPropertyInt("playlist-pos", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public void ShowProgress()
|
public void ShowProgress()
|
||||||
{
|
{
|
||||||
TimeSpan position = TimeSpan.FromSeconds(Player.GetPropertyDouble("time-pos"));
|
TimeSpan position = TimeSpan.FromSeconds(Player.GetPropertyDouble("time-pos"));
|
||||||
@@ -99,7 +99,7 @@ public class Command
|
|||||||
Player.CommandV("show-text", text, "5000");
|
Player.CommandV("show-text", text, "5000");
|
||||||
}
|
}
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public static void CycleAudio()
|
public static void CycleAudio()
|
||||||
{
|
{
|
||||||
Player.UpdateExternalTracks();
|
Player.UpdateExternalTracks();
|
||||||
@@ -128,7 +128,7 @@ public class Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public static void CycleSubtitles()
|
public static void CycleSubtitles()
|
||||||
{
|
{
|
||||||
Player.UpdateExternalTracks();
|
Player.UpdateExternalTracks();
|
||||||
@@ -160,14 +160,14 @@ public class Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public static void PlaylistFirst()
|
public static void PlaylistFirst()
|
||||||
{
|
{
|
||||||
if (Player.PlaylistPos != 0)
|
if (Player.PlaylistPos != 0)
|
||||||
Player.SetPropertyInt("playlist-pos", 0);
|
Player.SetPropertyInt("playlist-pos", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// backward compatibility
|
// deprecated
|
||||||
public static void PlaylistLast()
|
public static void PlaylistLast()
|
||||||
{
|
{
|
||||||
int count = Player.GetPropertyInt("playlist-count");
|
int count = Player.GetPropertyInt("playlist-count");
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ public static class Global
|
|||||||
public static readonly string BR = Environment.NewLine;
|
public static readonly string BR = Environment.NewLine;
|
||||||
public static readonly string BR2 = Environment.NewLine + Environment.NewLine;
|
public static readonly string BR2 = Environment.NewLine + Environment.NewLine;
|
||||||
public static readonly MainPlayer Player = new MainPlayer();
|
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();
|
public static readonly AppClass App = new AppClass();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user