After using the config editor it's no longer necessary to restart mpv.net.
This commit is contained in:
@@ -19,9 +19,9 @@
|
|||||||
open source code however. Example scripts and extensions were updated.
|
open source code however. Example scripts and extensions were updated.
|
||||||
- Fix console not working due to incorrect mpv.conf value generated
|
- Fix console not working due to incorrect mpv.conf value generated
|
||||||
(script-opts=console-scale=0).
|
(script-opts=console-scale=0).
|
||||||
- Registry usage is not portable and also not popular, so settings
|
- Settings are stored in the file settings.xml now instead of the Registry.
|
||||||
are stored in the file settings.xml now instead of the Registry.
|
|
||||||
- Video rotation support added.
|
- Video rotation support added.
|
||||||
|
- After using the config editor it's no longer necessary to restart mpv.net.
|
||||||
|
|
||||||
|
|
||||||
5.4.8.8 Beta (2021-05-09)
|
5.4.8.8 Beta (2021-05-09)
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
|
|
||||||
using mpvnet;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
|
|
||||||
using Tommy;
|
using Tommy;
|
||||||
|
using mpvnet;
|
||||||
|
|
||||||
namespace DynamicGUI
|
namespace DynamicGUI
|
||||||
{
|
{
|
||||||
@@ -62,10 +61,10 @@ namespace DynamicGUI
|
|||||||
baseSetting.File = setting["file"];
|
baseSetting.File = setting["file"];
|
||||||
baseSetting.Filter = setting["filter"];
|
baseSetting.Filter = setting["filter"];
|
||||||
|
|
||||||
if (setting.HasKey("help")) baseSetting.Help = setting["help"];
|
if (setting.HasKey("help")) baseSetting.Help = setting["help"];
|
||||||
if (setting.HasKey("url")) baseSetting.URL = setting["url"];
|
if (setting.HasKey("url")) baseSetting.URL = setting["url"];
|
||||||
if (setting.HasKey("width")) baseSetting.Width = setting["width"];
|
if (setting.HasKey("width")) baseSetting.Width = setting["width"];
|
||||||
if (setting.HasKey("type")) baseSetting.Type = setting["type"];
|
if (setting.HasKey("type")) baseSetting.Type = setting["type"];
|
||||||
|
|
||||||
settingsList.Add(baseSetting);
|
settingsList.Add(baseSetting);
|
||||||
}
|
}
|
||||||
@@ -75,26 +74,29 @@ namespace DynamicGUI
|
|||||||
|
|
||||||
public class ConfItem
|
public class ConfItem
|
||||||
{
|
{
|
||||||
public string Name { get; set; } = "";
|
|
||||||
public string Value { get; set; } = "";
|
|
||||||
public string Comment { get; set; } = "";
|
public string Comment { get; set; } = "";
|
||||||
public string LineComment { get; set; } = "";
|
|
||||||
public string Section { get; set; } = "";
|
|
||||||
public string File { get; set; } = "";
|
public string File { get; set; } = "";
|
||||||
|
public string LineComment { get; set; } = "";
|
||||||
|
public string Name { get; set; } = "";
|
||||||
|
public string Section { get; set; } = "";
|
||||||
|
public string Value { get; set; } = "";
|
||||||
|
|
||||||
public bool IsSectionItem { get; set; }
|
public bool IsSectionItem { get; set; }
|
||||||
public SettingBase SettingBase { get; set; }
|
public SettingBase SettingBase { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class SettingBase
|
public abstract class SettingBase
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
|
||||||
public string File { get; set; }
|
|
||||||
public string Value { get; set; }
|
|
||||||
public string Help { get; set; }
|
|
||||||
public string Default { get; set; }
|
public string Default { get; set; }
|
||||||
public string URL { get; set; }
|
public string File { get; set; }
|
||||||
public string Filter { get; set; }
|
public string Filter { get; set; }
|
||||||
|
public string Help { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string StartValue { get; set; }
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
public string URL { get; set; }
|
||||||
|
public string Value { get; set; }
|
||||||
|
|
||||||
public int Width { get; set; }
|
public int Width { get; set; }
|
||||||
public ConfItem ConfItem { get; set; }
|
public ConfItem ConfItem { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,61 +1,70 @@
|
|||||||
<UserControl x:Name="OptionSettingControl1" x:Class="DynamicGUI.OptionSettingControl"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Name="OptionSettingControl1" x:Class="DynamicGUI.OptionSettingControl"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:DynamicGUI"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:local="clr-namespace:DynamicGUI"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800">
|
d:DesignWidth="800">
|
||||||
|
|
||||||
<Grid Margin="20,0">
|
<Grid Margin="20,0">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBox x:Name="TitleTextBox"
|
<TextBox
|
||||||
FontSize="24"
|
x:Name="TitleTextBox"
|
||||||
Margin="0,10"
|
FontSize="24"
|
||||||
BorderThickness="0"
|
Margin="0,10"
|
||||||
IsReadOnly="True"
|
BorderThickness="0"
|
||||||
Foreground="{x:Static mpvnet:Theme.Heading}"
|
IsReadOnly="True"
|
||||||
Background="{x:Static mpvnet:Theme.Background}" />
|
Foreground="{Binding Theme.Heading}"
|
||||||
|
Background="{Binding Theme.Background}"
|
||||||
|
/>
|
||||||
|
|
||||||
<ItemsControl x:Name="ItemsControl">
|
<ItemsControl x:Name="ItemsControl">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<WrapPanel Orientation="Vertical">
|
<WrapPanel Orientation="Vertical">
|
||||||
<RadioButton x:Name="RadioButton"
|
<RadioButton
|
||||||
VerticalContentAlignment="Center"
|
x:Name="RadioButton"
|
||||||
IsChecked="{Binding Checked}"
|
VerticalContentAlignment="Center"
|
||||||
GroupName="{Binding OptionSetting.Name}"
|
IsChecked="{Binding Checked}"
|
||||||
Content="{Binding Text}"
|
GroupName="{Binding OptionSetting.Name}"
|
||||||
FontSize="16"
|
Content="{Binding Text}"
|
||||||
FontWeight="Normal"
|
FontSize="16"
|
||||||
VerticalAlignment="Top"
|
FontWeight="Normal"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"/>
|
VerticalAlignment="Top"
|
||||||
|
Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Theme.Foreground}"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextBox x:Name="ItemHelpTextBox"
|
<TextBox
|
||||||
TextWrapping="WrapWithOverflow"
|
x:Name="ItemHelpTextBox"
|
||||||
Text="{Binding Help}"
|
TextWrapping="WrapWithOverflow"
|
||||||
Visibility="{Binding Visibility}"
|
Text="{Binding Help}"
|
||||||
Margin="10,0,0,0" BorderThickness="0"
|
Visibility="{Binding Visibility}"
|
||||||
IsReadOnly="True" Padding="7,0,0,0"
|
Margin="10,0,0,0" BorderThickness="0"
|
||||||
MinHeight="0"
|
IsReadOnly="True" Padding="7,0,0,0"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground2}"
|
MinHeight="0"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"/>
|
Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Theme.Foreground2}"
|
||||||
|
Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Theme.Background}"
|
||||||
|
/>
|
||||||
|
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
|
||||||
<TextBox x:Name="HelpTextBox"
|
<TextBox
|
||||||
TextWrapping="WrapWithOverflow"
|
x:Name="HelpTextBox"
|
||||||
BorderThickness="0"
|
TextWrapping="WrapWithOverflow"
|
||||||
IsReadOnly="True"
|
BorderThickness="0"
|
||||||
Margin="0,10,0,0"
|
IsReadOnly="True"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Margin="0,10,0,0"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"/>
|
Foreground="{Binding Theme.Foreground}"
|
||||||
|
Background="{Binding Theme.Background}"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
||||||
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
using mpvnet;
|
||||||
|
|
||||||
namespace DynamicGUI
|
namespace DynamicGUI
|
||||||
{
|
{
|
||||||
public partial class OptionSettingControl : UserControl, ISettingControl
|
public partial class OptionSettingControl : UserControl, ISettingControl
|
||||||
@@ -12,6 +14,7 @@ namespace DynamicGUI
|
|||||||
{
|
{
|
||||||
OptionSetting = optionSetting;
|
OptionSetting = optionSetting;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
TitleTextBox.Text = optionSetting.Name;
|
TitleTextBox.Text = optionSetting.Name;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(optionSetting.Help))
|
if (string.IsNullOrEmpty(optionSetting.Help))
|
||||||
@@ -26,6 +29,10 @@ namespace DynamicGUI
|
|||||||
Link.SetURL(optionSetting.URL);
|
Link.SetURL(optionSetting.URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
string _SearchableText;
|
string _SearchableText;
|
||||||
|
|
||||||
public string SearchableText {
|
public string SearchableText {
|
||||||
|
|||||||
@@ -1,54 +1,61 @@
|
|||||||
<UserControl x:Name="StringSettingControl1" x:Class="DynamicGUI.StringSettingControl"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Name="StringSettingControl1" x:Class="DynamicGUI.StringSettingControl"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:DynamicGUI"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:local="clr-namespace:DynamicGUI"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800">
|
d:DesignWidth="800">
|
||||||
|
|
||||||
<Grid Margin="20,0">
|
<Grid Margin="20,0">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBox x:Name="TitleTextBox"
|
<TextBox
|
||||||
FontSize="24"
|
x:Name="TitleTextBox"
|
||||||
Margin="0,10"
|
FontSize="24"
|
||||||
BorderThickness="0"
|
Margin="0,10"
|
||||||
IsReadOnly="True"
|
BorderThickness="0"
|
||||||
Foreground="{x:Static mpvnet:Theme.Heading}"
|
IsReadOnly="True"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"/>
|
Foreground="{Binding Theme.Heading}"
|
||||||
|
Background="{Binding Theme.Background}"
|
||||||
|
/>
|
||||||
|
|
||||||
<Grid Margin="0,0,0,10">
|
<Grid Margin="0,0,0,10">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBox x:Name="ValueTextBox"
|
<TextBox
|
||||||
Text="{Binding Path=Text, ElementName=StringSettingControl1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
x:Name="ValueTextBox"
|
||||||
Width="150"
|
Text="{Binding Path=Text, ElementName=StringSettingControl1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||||
Height="20"
|
Width="150"
|
||||||
HorizontalAlignment="Left"
|
Height="20"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
HorizontalAlignment="Left"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
CaretBrush="{x:Static mpvnet:Theme.Foreground}"
|
Background="{Binding Theme.Background}"
|
||||||
TextChanged="ValueTextBox_TextChanged"/>
|
CaretBrush="{Binding Theme.Foreground}"
|
||||||
|
TextChanged="ValueTextBox_TextChanged"
|
||||||
<Button x:Name="Button"
|
/>
|
||||||
Height="20"
|
|
||||||
Grid.Column="1"
|
<Button
|
||||||
Visibility="{Binding Path=Text, ElementName=StringSettingControl1}"
|
x:Name="Button"
|
||||||
Margin="5,0,0,0"
|
Height="20"
|
||||||
Width="20"
|
Grid.Column="1"
|
||||||
Click="Button_Click">...</Button>
|
Margin="5,0,0,0"
|
||||||
|
Width="20"
|
||||||
|
Click="Button_Click"
|
||||||
|
>...</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<TextBox x:Name="HelpTextBox"
|
<TextBox
|
||||||
TextWrapping="WrapWithOverflow"
|
x:Name="HelpTextBox"
|
||||||
BorderThickness="0"
|
TextWrapping="WrapWithOverflow"
|
||||||
IsReadOnly="True"
|
BorderThickness="0"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
IsReadOnly="True"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"/>
|
Foreground="{Binding Theme.Foreground}"
|
||||||
|
Background="{Binding Theme.Background}"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
||||||
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
|
||||||
|
using mpvnet;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
using WinForms = System.Windows.Forms;
|
using WinForms = System.Windows.Forms;
|
||||||
|
|
||||||
namespace DynamicGUI
|
namespace DynamicGUI
|
||||||
@@ -16,6 +18,7 @@ namespace DynamicGUI
|
|||||||
{
|
{
|
||||||
StringSetting = stringSetting;
|
StringSetting = stringSetting;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
TitleTextBox.Text = stringSetting.Name;
|
TitleTextBox.Text = stringSetting.Name;
|
||||||
HelpTextBox.Text = stringSetting.Help;
|
HelpTextBox.Text = stringSetting.Help;
|
||||||
ValueTextBox.Text = StringSetting.Value;
|
ValueTextBox.Text = StringSetting.Value;
|
||||||
@@ -32,6 +35,10 @@ namespace DynamicGUI
|
|||||||
LinkTextBlock.Visibility = Visibility.Collapsed;
|
LinkTextBlock.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
string _SearchableText;
|
string _SearchableText;
|
||||||
|
|
||||||
public string SearchableText {
|
public string SearchableText {
|
||||||
|
|||||||
@@ -94,7 +94,9 @@ namespace RatingExtension // the assembly name must end with 'Extension'!
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args[1] == "about")
|
else if (args[1] == "about")
|
||||||
MessageBox.Show("This extension writes a rating to the filename of rated videos when mpv.net shuts down.\n\nThe input.conf defaults contain key bindings for this extension to set ratings.",
|
MessageBox.Show($"This extension writes a rating to the filename of rated videos " +
|
||||||
|
"when mpv.net shuts down." + BR2 +
|
||||||
|
"The input.conf defaults contain key bindings for this extension to set ratings.",
|
||||||
"Rating Extension");
|
"Rating Extension");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ namespace mpvnet
|
|||||||
public static bool AutoLoadFolder { get; set; } = true;
|
public static bool AutoLoadFolder { get; set; } = true;
|
||||||
public static bool Queue { get; set; }
|
public static bool Queue { get; set; }
|
||||||
public static bool UpdateCheck { get; set; }
|
public static bool UpdateCheck { get; set; }
|
||||||
public static bool GlobalMediaKeys { get; set; }
|
|
||||||
|
|
||||||
public static int StartThreshold { get; set; } = 1500;
|
public static int StartThreshold { get; set; } = 1500;
|
||||||
public static int RecentCount { get; set; } = 15;
|
public static int RecentCount { get; set; } = 15;
|
||||||
@@ -52,8 +51,8 @@ namespace mpvnet
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
string dummy = Core.ConfigFolder;
|
var useless1 = Core.ConfigFolder;
|
||||||
var dummy2 = Core.Conf;
|
var useless2 = Core.Conf;
|
||||||
|
|
||||||
foreach (var i in Conf)
|
foreach (var i in Conf)
|
||||||
ProcessProperty(i.Key, i.Value, true);
|
ProcessProperty(i.Key, i.Value, true);
|
||||||
@@ -79,6 +78,14 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InitTheme();
|
||||||
|
|
||||||
|
Core.Shutdown += Shutdown;
|
||||||
|
Core.Initialized += Initialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void InitTheme()
|
||||||
|
{
|
||||||
string themeContent = null;
|
string themeContent = null;
|
||||||
|
|
||||||
if (File.Exists(Core.ConfigFolder + "theme.conf"))
|
if (File.Exists(Core.ConfigFolder + "theme.conf"))
|
||||||
@@ -89,8 +96,11 @@ namespace mpvnet
|
|||||||
Properties.Resources.theme,
|
Properties.Resources.theme,
|
||||||
IsDarkMode ? DarkTheme : LightTheme);
|
IsDarkMode ? DarkTheme : LightTheme);
|
||||||
|
|
||||||
Core.Shutdown += Shutdown;
|
ToolStripRendererEx.ForegroundColor = Theme.Current.GetWinFormsColor("menu-foreground");
|
||||||
Core.Initialized += Initialized;
|
ToolStripRendererEx.BackgroundColor = Theme.Current.GetWinFormsColor("menu-background");
|
||||||
|
ToolStripRendererEx.SelectionColor = Theme.Current.GetWinFormsColor("menu-highlight");
|
||||||
|
ToolStripRendererEx.BorderColor = Theme.Current.GetWinFormsColor("menu-border");
|
||||||
|
ToolStripRendererEx.CheckedColor = Theme.Current.GetWinFormsColor("menu-checked");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RunTask(Action action)
|
public static void RunTask(Action action)
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ using System.Text;
|
|||||||
|
|
||||||
using Microsoft.CSharp;
|
using Microsoft.CSharp;
|
||||||
|
|
||||||
|
using static mpvnet.Global;
|
||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
class CSharpScriptHost
|
class CSharpScriptHost
|
||||||
@@ -66,7 +68,7 @@ namespace mpvnet
|
|||||||
i.Line + "\n" + "Error Number: " + i.ErrorNumber + "\n" + i.ErrorText);
|
i.Line + "\n" + "Error Number: " + i.ErrorNumber + "\n" + i.ErrorText);
|
||||||
|
|
||||||
if (errors.Count() > 0)
|
if (errors.Count() > 0)
|
||||||
Terminal.WriteError(string.Join("\n\n", errors), Path.GetFileName(file));
|
Terminal.WriteError(string.Join(BR2, errors), Path.GetFileName(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
static string GetMD5(string code)
|
static string GetMD5(string code)
|
||||||
|
|||||||
@@ -144,12 +144,12 @@ namespace mpvnet
|
|||||||
mpv_error err = mpv_initialize(Handle);
|
mpv_error err = mpv_initialize(Handle);
|
||||||
|
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
throw new Exception("mpv_initialize error\n\n" + GetError(err));
|
throw new Exception("mpv_initialize error" + BR2 + GetError(err) + BR);
|
||||||
|
|
||||||
err = mpv_observe_property(Handle, 0, "video-rotate", mpv_format.MPV_FORMAT_INT64);
|
err = mpv_observe_property(Handle, 0, "video-rotate", mpv_format.MPV_FORMAT_INT64);
|
||||||
|
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
throw new Exception("mpv_observe_property video-rotate error\n\n" + GetError(err));
|
throw new Exception("mpv_observe_property video-rotate error" + BR2 + GetError(err) + BR);
|
||||||
|
|
||||||
Initialized?.Invoke();
|
Initialized?.Invoke();
|
||||||
InvokeAsync(InitializedAsync);
|
InvokeAsync(InitializedAsync);
|
||||||
@@ -929,7 +929,7 @@ namespace mpvnet
|
|||||||
Terminal.WriteError(msg);
|
Terminal.WriteError(msg);
|
||||||
|
|
||||||
Terminal.WriteError(GetError(err));
|
Terminal.WriteError(GetError(err));
|
||||||
throw new Exception(string.Join(BR2, messages) + BR2 + GetError(err));
|
throw new Exception(string.Join(BR2, messages) + BR2 + GetError(err) + BR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ namespace mpvnet
|
|||||||
if (knownExtensions.Contains(Path.GetFileName(extDir)))
|
if (knownExtensions.Contains(Path.GetFileName(extDir)))
|
||||||
catalog.Catalogs.Add(new DirectoryCatalog(extDir, Path.GetFileName(extDir) + ".dll"));
|
catalog.Catalogs.Add(new DirectoryCatalog(extDir, Path.GetFileName(extDir) + ".dll"));
|
||||||
else
|
else
|
||||||
Terminal.WriteError("Failed to load extension:\n\n" + extDir +
|
Terminal.WriteError("Failed to load extension:" + BR2 + extDir +
|
||||||
"\n\nOnly extensions that ship with mpv.net are allowed in <startup>\\extensions" +
|
BR2 + "Only extensions that ship with mpv.net are allowed in <startup>\\extensions" +
|
||||||
"\n\nUser extensions have to use <config folder>\\extensions" +
|
BR2 + "User extensions have to use <config folder>\\extensions" +
|
||||||
"\n\nNever copy or install a new mpv.net version over a old mpv.net version.");
|
BR2 + "Never copy or install a new mpv.net version over a old mpv.net version.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
using static mpvnet.Global;
|
||||||
|
|
||||||
public class Msg
|
public class Msg
|
||||||
{
|
{
|
||||||
public static void ShowInfo(object title, object content = null)
|
public static void ShowInfo(object title, object content = null)
|
||||||
@@ -33,7 +35,7 @@ public class Msg
|
|||||||
public static DialogResult Show(object title, object content, MessageBoxIcon icon,
|
public static DialogResult Show(object title, object content, MessageBoxIcon icon,
|
||||||
MessageBoxButtons buttons = MessageBoxButtons.OK)
|
MessageBoxButtons buttons = MessageBoxButtons.OK)
|
||||||
{
|
{
|
||||||
string msg = (title?.ToString().TrimEx() + "\n\n" + content?.ToString().TrimEx()).Trim();
|
string msg = (title?.ToString().TrimEx() + BR2 + content?.ToString().TrimEx()).Trim();
|
||||||
return MessageBox.Show(msg, Application.ProductName, buttons, icon);
|
return MessageBox.Show(msg, Application.ProductName, buttons, icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ namespace mpvnet
|
|||||||
|
|
||||||
public static Theme Current { get; set; }
|
public static Theme Current { get; set; }
|
||||||
|
|
||||||
public static Brush Foreground { get; set; }
|
public Brush Foreground { get; set; }
|
||||||
public static Brush Foreground2 { get; set; }
|
public Brush Foreground2 { get; set; }
|
||||||
public static Brush Background { get; set; }
|
public Brush Background { get; set; }
|
||||||
public static Brush Heading { get; set; }
|
public Brush Heading { get; set; }
|
||||||
|
|
||||||
public System.Drawing.Color GetWinFormsColor(string key)
|
public System.Drawing.Color GetWinFormsColor(string key)
|
||||||
{
|
{
|
||||||
@@ -31,6 +31,8 @@ namespace mpvnet
|
|||||||
|
|
||||||
public static void Init(string customContent, string defaultContent, string activeTheme)
|
public static void Init(string customContent, string defaultContent, string activeTheme)
|
||||||
{
|
{
|
||||||
|
Current = null;
|
||||||
|
|
||||||
DefaultThemes = Load(defaultContent);
|
DefaultThemes = Load(defaultContent);
|
||||||
CustomThemes = Load(customContent);
|
CustomThemes = Load(customContent);
|
||||||
|
|
||||||
@@ -65,10 +67,10 @@ namespace mpvnet
|
|||||||
if (Current == null)
|
if (Current == null)
|
||||||
Current = DefaultThemes[0];
|
Current = DefaultThemes[0];
|
||||||
|
|
||||||
Foreground = Current.GetBrush("foreground");
|
Current.Foreground = Current.GetBrush("foreground");
|
||||||
Foreground2 = Current.GetBrush("foreground2");
|
Current.Foreground2 = Current.GetBrush("foreground2");
|
||||||
Background = Current.GetBrush("background");
|
Current.Background = Current.GetBrush("background");
|
||||||
Heading = Current.GetBrush("heading");
|
Current.Heading = Current.GetBrush("heading");
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<Theme> Load(string content)
|
static List<Theme> Load(string content)
|
||||||
|
|||||||
@@ -44,8 +44,8 @@
|
|||||||
_ ignore #menu: -
|
_ ignore #menu: -
|
||||||
Enter cycle fullscreen #menu: Toggle Fullscreen
|
Enter cycle fullscreen #menu: Toggle Fullscreen
|
||||||
|
|
||||||
F11 playlist-prev #menu: Navigate > Previous File
|
F11 playlist-prev; set pause no #menu: Navigate > Previous File
|
||||||
F12 playlist-next #menu: Navigate > Next File
|
F12 playlist-next; set pause no #menu: Navigate > Next File
|
||||||
_ ignore #menu: Navigate > -
|
_ ignore #menu: Navigate > -
|
||||||
Home script-message mpv.net playlist-first #menu: Navigate > First File
|
Home script-message mpv.net playlist-first #menu: Navigate > First File
|
||||||
End script-message mpv.net playlist-last #menu: Navigate > Last File
|
End script-message mpv.net playlist-last #menu: Navigate > Last File
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
// In input.conf add:
|
// In input.conf add:
|
||||||
|
|
||||||
// KP0 script-message rate-file 0 #menu: Extensions > Rating > 0stars
|
// KP0 script-message rate-file 0 #menu: Script > Rating > 0stars
|
||||||
// KP1 script-message rate-file 1 #menu: Extensions > Rating > 1stars
|
// KP1 script-message rate-file 1 #menu: Script > Rating > 1stars
|
||||||
// KP2 script-message rate-file 2 #menu: Extensions > Rating > 2stars
|
// KP2 script-message rate-file 2 #menu: Script > Rating > 2stars
|
||||||
// KP3 script-message rate-file 3 #menu: Extensions > Rating > 3stars
|
// KP3 script-message rate-file 3 #menu: Script > Rating > 3stars
|
||||||
// KP4 script-message rate-file 4 #menu: Extensions > Rating > 4stars
|
// KP4 script-message rate-file 4 #menu: Script > Rating > 4stars
|
||||||
// KP5 script-message rate-file 5 #menu: Extensions > Rating > 5stars
|
// KP5 script-message rate-file 5 #menu: Script > Rating > 5stars
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
<Window x:Class="mpvnet.AboutWindow"
|
<Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="mpvnet.AboutWindow"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
||||||
Title="About mpv.net"
|
Title="About mpv.net"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
SizeToContent="WidthAndHeight"
|
SizeToContent="WidthAndHeight"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
Background="{x:Static mpvnet:Theme.Background}">
|
Background="{Binding Theme.Background}"
|
||||||
|
>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel HorizontalAlignment="Center">
|
<StackPanel HorizontalAlignment="Center">
|
||||||
|
|||||||
@@ -9,10 +9,15 @@ namespace mpvnet
|
|||||||
public AboutWindow()
|
public AboutWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
ContentBlock.Text = App.Version;
|
ContentBlock.Text = App.Version;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPreviewKeyDown(KeyEventArgs e) => Close();
|
protected override void OnPreviewKeyDown(KeyEventArgs e) => Close();
|
||||||
protected override void OnMouseDown(MouseButtonEventArgs e) => Close();
|
protected override void OnMouseDown(MouseButtonEventArgs e) => Close();
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<Window x:Class="mpvnet.CommandPaletteWindow"
|
<Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="mpvnet.CommandPaletteWindow"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
||||||
Title="Command Palette"
|
Title="Command Palette"
|
||||||
Height="295"
|
Height="295"
|
||||||
Width="400"
|
Width="400"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -21,17 +21,21 @@
|
|||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBox Name="FilterTextBox"
|
<TextBox
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Name="FilterTextBox"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
PreviewKeyDown="FilterTextBox_PreviewKeyDown"
|
Background="{Binding Theme.Background}"
|
||||||
TextChanged="FilterTextBox_TextChanged"/>
|
PreviewKeyDown="FilterTextBox_PreviewKeyDown"
|
||||||
|
TextChanged="FilterTextBox_TextChanged"
|
||||||
|
/>
|
||||||
|
|
||||||
<ListView Name="ListView"
|
<ListView
|
||||||
Grid.Row="1"
|
Name="ListView"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Grid.Row="1"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
MouseUp="ListView_MouseUp">
|
Background="{Binding Theme.Background}"
|
||||||
|
MouseUp="ListView_MouseUp"
|
||||||
|
>
|
||||||
|
|
||||||
<ListView.ItemContainerStyle>
|
<ListView.ItemContainerStyle>
|
||||||
<Style TargetType="ListBoxItem">
|
<Style TargetType="ListBoxItem">
|
||||||
@@ -48,10 +52,12 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Text="{Binding Display}"></TextBlock>
|
<TextBlock Text="{Binding Display}"></TextBlock>
|
||||||
|
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock
|
||||||
Text="{Binding Input}"
|
Grid.Column="1"
|
||||||
HorizontalAlignment="Right"></TextBlock>
|
Text="{Binding Input}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace mpvnet
|
|||||||
public CommandPaletteWindow()
|
public CommandPaletteWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
CollectionViewSource collectionViewSource = new CollectionViewSource() { Source = CommandItem.Items };
|
CollectionViewSource collectionViewSource = new CollectionViewSource() { Source = CommandItem.Items };
|
||||||
CollectionView = collectionViewSource.View;
|
CollectionView = collectionViewSource.View;
|
||||||
var yourCostumFilter = new Predicate<object>(item => Filter((CommandItem)item));
|
var yourCostumFilter = new Predicate<object>(item => Filter((CommandItem)item));
|
||||||
@@ -24,6 +25,10 @@ namespace mpvnet
|
|||||||
ListView.ItemsSource = CollectionView;
|
ListView.ItemsSource = CollectionView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
bool Filter(CommandItem item)
|
bool Filter(CommandItem item)
|
||||||
{
|
{
|
||||||
if (item.Command == "")
|
if (item.Command == "")
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
<Window xmlns:Controls="clr-namespace:Controls" x:Name="ConfWindow1" x:Class="mpvnet.ConfWindow"
|
<Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns:Controls="clr-namespace:Controls" x:Name="ConfWindow1" x:Class="mpvnet.ConfWindow"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
||||||
Title="Config Editor"
|
Title="Config Editor"
|
||||||
Height="530"
|
Height="530"
|
||||||
Width="700"
|
Width="700"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Background="{Binding Theme.Background}"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Loaded="ConfWindow1_Loaded">
|
Loaded="ConfWindow1_Loaded"
|
||||||
|
>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -31,24 +32,29 @@
|
|||||||
HintText="Find a setting"
|
HintText="Find a setting"
|
||||||
Width="250"
|
Width="250"
|
||||||
Margin="0,20,0,0"
|
Margin="0,20,0,0"
|
||||||
Grid.ColumnSpan="2"/>
|
Grid.ColumnSpan="2"
|
||||||
|
/>
|
||||||
|
|
||||||
<ScrollViewer Name="MainScrollViewer"
|
<ScrollViewer
|
||||||
VerticalScrollBarVisibility="Auto"
|
Name="MainScrollViewer"
|
||||||
Grid.Row="1"
|
VerticalScrollBarVisibility="Auto"
|
||||||
Grid.Column="2"
|
Grid.Row="1"
|
||||||
Margin="0,0,0,10">
|
Grid.Column="2"
|
||||||
|
Margin="0,0,0,10"
|
||||||
|
>
|
||||||
|
|
||||||
<StackPanel x:Name="MainStackPanel"></StackPanel>
|
<StackPanel x:Name="MainStackPanel"></StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
<StackPanel Margin="20,0,0,0" Grid.Row="1">
|
<StackPanel Margin="20,0,0,0" Grid.Row="1">
|
||||||
<ListBox Name="FilterListBox"
|
<ListBox
|
||||||
ItemsSource="{Binding FilterStrings}"
|
Name="FilterListBox"
|
||||||
BorderThickness="0"
|
ItemsSource="{Binding FilterStrings}"
|
||||||
SelectionChanged="FilterListBox_SelectionChanged"
|
BorderThickness="0"
|
||||||
Foreground="{x:Static mpvnet:Theme.Heading}"
|
SelectionChanged="FilterListBox_SelectionChanged"
|
||||||
Background="{x:Static mpvnet:Theme.Background}">
|
Foreground="{Binding Theme.Heading}"
|
||||||
|
Background="{Binding Theme.Background}"
|
||||||
|
>
|
||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@@ -57,10 +63,10 @@
|
|||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<TextBlock Name="OpenSettingsTextBlock" Margin="0,30,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static mpvnet:Theme.Heading}" MouseUp="OpenSettingsTextBlock_MouseUp">Open config folder</TextBlock>
|
<TextBlock Name="OpenSettingsTextBlock" Margin="0,30,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="OpenSettingsTextBlock_MouseUp">Open config folder</TextBlock>
|
||||||
<TextBlock Name="PreviewTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static mpvnet:Theme.Heading}" MouseUp="PreviewTextBlock_MouseUp">Preview mpv.conf</TextBlock>
|
<TextBlock Name="PreviewTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="PreviewTextBlock_MouseUp">Preview mpv.conf</TextBlock>
|
||||||
<TextBlock Name="ShowManualTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static mpvnet:Theme.Heading}" MouseUp="ShowManualTextBlock_MouseUp">Show mpv manual</TextBlock>
|
<TextBlock Name="ShowManualTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="ShowManualTextBlock_MouseUp">Show mpv manual</TextBlock>
|
||||||
<TextBlock Name="SupportTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static mpvnet:Theme.Heading}" MouseUp="SupportTextBlock_MouseUp">Show support forum</TextBlock>
|
<TextBlock Name="SupportTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{Binding Theme.Heading}" MouseUp="SupportTextBlock_MouseUp">Show support forum</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -35,10 +35,16 @@ namespace mpvnet
|
|||||||
FilterListBox.SelectedItem = SearchControl.Text.TrimEnd(':');
|
FilterListBox.SelectedItem = SearchControl.Text.TrimEnd(':');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
void LoadSettings()
|
void LoadSettings()
|
||||||
{
|
{
|
||||||
foreach (SettingBase setting in SettingsDefinitions)
|
foreach (SettingBase setting in SettingsDefinitions)
|
||||||
{
|
{
|
||||||
|
setting.StartValue = setting.Value;
|
||||||
|
|
||||||
if (!FilterStrings.Contains(setting.Filter))
|
if (!FilterStrings.Contains(setting.Filter))
|
||||||
FilterStrings.Add(setting.Filter);
|
FilterStrings.Add(setting.Filter);
|
||||||
|
|
||||||
@@ -47,9 +53,9 @@ namespace mpvnet
|
|||||||
if (setting.Name == confItem.Name && confItem.Section == "" && !confItem.IsSectionItem)
|
if (setting.Name == confItem.Name && confItem.Section == "" && !confItem.IsSectionItem)
|
||||||
{
|
{
|
||||||
setting.Value = confItem.Value.Trim('\'', '"');
|
setting.Value = confItem.Value.Trim('\'', '"');
|
||||||
|
setting.StartValue = setting.Value;
|
||||||
setting.ConfItem = confItem;
|
setting.ConfItem = confItem;
|
||||||
confItem.SettingBase = setting;
|
confItem.SettingBase = setting;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +81,30 @@ namespace mpvnet
|
|||||||
|
|
||||||
File.WriteAllText(Core.ConfPath, GetContent("mpv"));
|
File.WriteAllText(Core.ConfPath, GetContent("mpv"));
|
||||||
File.WriteAllText(App.ConfPath, GetContent("mpvnet"));
|
File.WriteAllText(App.ConfPath, GetContent("mpvnet"));
|
||||||
Msg.ShowInfo("Changes will be available on next startup.");
|
|
||||||
|
foreach (SettingBase item in SettingsDefinitions)
|
||||||
|
{
|
||||||
|
if (item.Value != item.StartValue)
|
||||||
|
{
|
||||||
|
if (item.File == "mpv")
|
||||||
|
{
|
||||||
|
Core.ProcessProperty(item.Name, item.Value);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Core.set_property_string(item.Name, item.Value, true);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
App.ShowError(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.File == "mpvnet")
|
||||||
|
App.ProcessProperty(item.Name, item.Value, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
App.InitTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
string GetCompareString()
|
string GetCompareString()
|
||||||
@@ -90,6 +119,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
string comment = "";
|
string comment = "";
|
||||||
string section = "";
|
string section = "";
|
||||||
|
|
||||||
bool isSectionItem = false;
|
bool isSectionItem = false;
|
||||||
|
|
||||||
foreach (string currentLine in File.ReadAllLines(file))
|
foreach (string currentLine in File.ReadAllLines(file))
|
||||||
@@ -175,7 +205,7 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
else if ((item.SettingBase.Value ?? "") != item.SettingBase.Default)
|
else if ((item.SettingBase.Value ?? "") != item.SettingBase.Default)
|
||||||
{
|
{
|
||||||
string value = "";
|
string value;
|
||||||
|
|
||||||
if (item.SettingBase.Type == "string" ||
|
if (item.SettingBase.Type == "string" ||
|
||||||
item.SettingBase.Type == "folder" ||
|
item.SettingBase.Type == "folder" ||
|
||||||
@@ -205,7 +235,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
if ((setting.Value ?? "") != setting.Default)
|
if ((setting.Value ?? "") != setting.Default)
|
||||||
{
|
{
|
||||||
string value = "";
|
string value;
|
||||||
|
|
||||||
if (setting.Type == "string" ||
|
if (setting.Type == "string" ||
|
||||||
setting.Type == "folder" ||
|
setting.Type == "folder" ||
|
||||||
@@ -300,7 +330,7 @@ namespace mpvnet
|
|||||||
ProcessHelp.ShellExecute("https://mpv.io/manual/master/");
|
ProcessHelp.ShellExecute("https://mpv.io/manual/master/");
|
||||||
|
|
||||||
void SupportTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
|
void SupportTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
|
||||||
ProcessHelp.ShellExecute("https://github.com/stax76/mpv.net#Support");
|
ProcessHelp.ShellExecute("https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#support");
|
||||||
|
|
||||||
protected override void OnKeyDown(KeyEventArgs e)
|
protected override void OnKeyDown(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
<Window x:Class="mpvnet.EverythingWindow"
|
<Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="mpvnet.EverythingWindow"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
||||||
Title="Media File Search"
|
Title="Media File Search"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="600"
|
Width="600"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded"
|
||||||
|
>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -20,18 +21,22 @@
|
|||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBox Name="FilterTextBox"
|
<TextBox
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Name="FilterTextBox"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
PreviewKeyDown="FilterTextBox_PreviewKeyDown"
|
Background="{Binding Theme.Background}"
|
||||||
TextChanged="FilterTextBox_TextChanged"/>
|
PreviewKeyDown="FilterTextBox_PreviewKeyDown"
|
||||||
|
TextChanged="FilterTextBox_TextChanged"
|
||||||
|
/>
|
||||||
|
|
||||||
<ListView Name="ListView"
|
<ListView
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Name="ListView"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
Grid.Row="1"
|
Background="{Binding Theme.Background}"
|
||||||
MouseUp="ListView_MouseUp"
|
Grid.Row="1"
|
||||||
PreviewKeyDown="ListView_PreviewKeyDown">
|
MouseUp="ListView_MouseUp"
|
||||||
|
PreviewKeyDown="ListView_PreviewKeyDown"
|
||||||
|
>
|
||||||
|
|
||||||
<ListView.ItemContainerStyle>
|
<ListView.ItemContainerStyle>
|
||||||
<Style TargetType="ListBoxItem">
|
<Style TargetType="ListBoxItem">
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ namespace mpvnet
|
|||||||
public EverythingWindow()
|
public EverythingWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int EVERYTHING_REQUEST_FILE_NAME = 0x00000001;
|
const int EVERYTHING_REQUEST_FILE_NAME = 0x00000001;
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
<Window xmlns:Controls="clr-namespace:Controls" x:Class="mpvnet.InputWindow"
|
<Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns:Controls="clr-namespace:Controls" x:Class="mpvnet.InputWindow"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
||||||
Title="Input Editor"
|
Title="Input Editor"
|
||||||
Height="500"
|
Height="500"
|
||||||
Width="750"
|
Width="750"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Background="{Binding Theme.Background}"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
Closed="Window_Closed">
|
Closed="Window_Closed"
|
||||||
|
>
|
||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style x:Key="DataGrid_Font_Centering" TargetType="{x:Type DataGridCell}">
|
<Style x:Key="DataGrid_Font_Centering" TargetType="{x:Type DataGridCell}">
|
||||||
@@ -41,13 +42,16 @@
|
|||||||
x:Name="SearchControl"
|
x:Name="SearchControl"
|
||||||
Width="300"
|
Width="300"
|
||||||
Margin="0,20,0,20"
|
Margin="0,20,0,20"
|
||||||
Grid.ColumnSpan="2" />
|
Grid.ColumnSpan="2"
|
||||||
|
/>
|
||||||
|
|
||||||
<DataGrid x:Name="DataGrid"
|
<DataGrid
|
||||||
Grid.Row="1"
|
x:Name="DataGrid"
|
||||||
CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute"
|
Grid.Row="1"
|
||||||
AutoGenerateColumns="False"
|
CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute"
|
||||||
CellStyle="{StaticResource DataGrid_Font_Centering}" >
|
AutoGenerateColumns="False"
|
||||||
|
CellStyle="{StaticResource DataGrid_Font_Centering}"
|
||||||
|
>
|
||||||
|
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Header="Menu" Binding="{Binding Path}"/>
|
<DataGridTextColumn Header="Menu" Binding="{Binding Path}"/>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ namespace mpvnet
|
|||||||
public InputWindow()
|
public InputWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
InitialInputConfContent = GetInputConfContent();
|
InitialInputConfContent = GetInputConfContent();
|
||||||
SearchControl.SearchTextBox.TextChanged += SearchTextBox_TextChanged;
|
SearchControl.SearchTextBox.TextChanged += SearchTextBox_TextChanged;
|
||||||
DataGrid.SelectionMode = DataGridSelectionMode.Single;
|
DataGrid.SelectionMode = DataGridSelectionMode.Single;
|
||||||
@@ -30,6 +31,10 @@ namespace mpvnet
|
|||||||
DataGrid.ItemsSource = CollectionView;
|
DataGrid.ItemsSource = CollectionView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
CollectionView.Refresh();
|
CollectionView.Refresh();
|
||||||
@@ -38,7 +43,10 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
SearchControl.SearchTextBox.Text = "";
|
SearchControl.SearchTextBox.Text = "";
|
||||||
Msg.ShowInfo("Filtering",
|
Msg.ShowInfo("Filtering",
|
||||||
"Reduce the filter scope with:\n\ni input\n\nm menu\n\nc command\n\n" +
|
"Reduce the filter scope with:" + BR2 +
|
||||||
|
"i input" + BR2 +
|
||||||
|
"m menu" + BR2 +
|
||||||
|
"c command" + BR2 +
|
||||||
"If only one character is entered input search is performed.");
|
"If only one character is entered input search is performed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,7 +95,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
foreach (CommandItem i in CommandItem.Items)
|
foreach (CommandItem i in CommandItem.Items)
|
||||||
if (items.ContainsKey(i.Input) && i.Input != "")
|
if (items.ContainsKey(i.Input) && i.Input != "")
|
||||||
Msg.ShowInfo($"Duplicate found:\n\n{i.Input}: {i.Path}\n\n{items[i.Input].Input}: {items[i.Input].Path}\n\nPlease note that you can chain multiple commands in the same line by using a semicolon as separator.", "Duplicate Found");
|
Msg.ShowInfo($"Duplicate found:{BR2 + i.Input}: {i.Path + BR2}{items[i.Input].Input}: {items[i.Input].Path + BR2}Please note that you can chain multiple commands in the same line by using a semicolon as separator.", "Duplicate Found");
|
||||||
else
|
else
|
||||||
items[i.Input] = i;
|
items[i.Input] = i;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
<Window x:Class="mpvnet.LearnWindow"
|
<Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="mpvnet.LearnWindow"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|
||||||
Title="Learn Input"
|
Title="Learn Input"
|
||||||
Height="200"
|
Height="200"
|
||||||
Width="400"
|
Width="400"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Background="{Binding Theme.Background}"
|
||||||
MouseWheel="Window_MouseWheel"
|
MouseWheel="Window_MouseWheel"
|
||||||
MouseUp="Window_MouseUp"
|
MouseUp="Window_MouseUp"
|
||||||
MouseDoubleClick="Window_MouseDoubleClick" PreviewKeyDown="Window_PreviewKeyDown">
|
MouseDoubleClick="Window_MouseDoubleClick" PreviewKeyDown="Window_PreviewKeyDown"
|
||||||
|
>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -29,19 +30,24 @@
|
|||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock x:Name="MenuTextBlock"
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
FontSize="16"></TextBlock>
|
|
||||||
|
|
||||||
<TextBlock x:Name="KeyTextBlock"
|
<TextBlock
|
||||||
Grid.Row="1"
|
x:Name="MenuTextBlock"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
FontSize="16" />
|
FontSize="16"
|
||||||
|
>
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
x:Name="KeyTextBlock"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
/>
|
||||||
|
|
||||||
<Button x:Name="ConfirmButton" Grid.Row="2" Click="ConfirmButton_Click">Confirm</Button>
|
<Button x:Name="ConfirmButton" Grid.Row="2" Click="ConfirmButton_Click">Confirm</Button>
|
||||||
<Button x:Name="ClearButton" Grid.Row="2" Click="ClearButton_Click" Grid.Column="1">Clear</Button>
|
<Button x:Name="ClearButton" Grid.Row="2" Click="ClearButton_Click" Grid.Column="1">Clear</Button>
|
||||||
|
|||||||
@@ -24,7 +24,15 @@ namespace mpvnet
|
|||||||
int VK_LCONTROL = 0xA2;
|
int VK_LCONTROL = 0xA2;
|
||||||
int VK_RCONTROL = 0xA3;
|
int VK_RCONTROL = 0xA3;
|
||||||
|
|
||||||
public LearnWindow() => InitializeComponent();
|
public LearnWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||||
static extern short GetKeyState(int keyCode);
|
static extern short GetKeyState(int keyCode);
|
||||||
|
|||||||
@@ -1,21 +1,24 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
>
|
||||||
|
|
||||||
<Style TargetType="TextBox">
|
<Style TargetType="TextBox">
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="{x:Type TextBox}">
|
<ControlTemplate TargetType="{x:Type TextBox}">
|
||||||
<Border x:Name="border"
|
<Border
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
x:Name="border"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
Background="{TemplateBinding Background}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
SnapsToDevicePixels="True">
|
Background="{TemplateBinding Background}"
|
||||||
|
SnapsToDevicePixels="True">
|
||||||
|
|
||||||
<ScrollViewer x:Name="PART_ContentHost"
|
<ScrollViewer
|
||||||
Focusable="false"
|
x:Name="PART_ContentHost"
|
||||||
HorizontalScrollBarVisibility="Hidden"
|
Focusable="false"
|
||||||
VerticalScrollBarVisibility="Hidden"/>
|
HorizontalScrollBarVisibility="Hidden"
|
||||||
|
VerticalScrollBarVisibility="Hidden"/>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
@@ -26,7 +29,7 @@
|
|||||||
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsFocused" Value="true">
|
<Trigger Property="IsFocused" Value="true">
|
||||||
<Setter Property="BorderBrush" TargetName="border" Value="{x:Static mpvnet:Theme.Heading}"/>
|
<Setter Property="BorderBrush" TargetName="border" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Theme.Heading}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
@@ -49,22 +52,25 @@
|
|||||||
x:Name="normal"
|
x:Name="normal"
|
||||||
Width="18"
|
Width="18"
|
||||||
Height="18"
|
Height="18"
|
||||||
Fill="{x:Static mpvnet:Theme.Background}"
|
Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Theme.Background}"
|
||||||
Stroke="{x:Static mpvnet:Theme.Heading}"
|
Stroke="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Theme.Heading}"
|
||||||
StrokeThickness="2" />
|
StrokeThickness="2"
|
||||||
|
/>
|
||||||
<Ellipse
|
<Ellipse
|
||||||
x:Name="Checked1"
|
x:Name="Checked1"
|
||||||
Width="8"
|
Width="8"
|
||||||
Height="8"
|
Height="8"
|
||||||
Fill="{TemplateBinding Foreground}"
|
Fill="{TemplateBinding Foreground}"
|
||||||
Opacity="0" />
|
Opacity="0"
|
||||||
|
/>
|
||||||
<Ellipse
|
<Ellipse
|
||||||
x:Name="disabled"
|
x:Name="disabled"
|
||||||
Width="18"
|
Width="18"
|
||||||
Height="18"
|
Height="18"
|
||||||
Fill="{DynamicResource SemiTransparentWhiteBrush}"
|
Fill="{DynamicResource SemiTransparentWhiteBrush}"
|
||||||
Opacity="0"
|
Opacity="0"
|
||||||
StrokeThickness="{TemplateBinding BorderThickness}" />
|
StrokeThickness="{TemplateBinding BorderThickness}"
|
||||||
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
@@ -77,7 +83,8 @@
|
|||||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
||||||
RecognizesAccessKey="True" />
|
RecognizesAccessKey="True"
|
||||||
|
/>
|
||||||
|
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
<VisualStateGroup x:Name="CommonStates">
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
@@ -88,12 +95,14 @@
|
|||||||
Storyboard.TargetName="contentPresenter"
|
Storyboard.TargetName="contentPresenter"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)"
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
||||||
To=".55"
|
To=".55"
|
||||||
Duration="0" />
|
Duration="0"
|
||||||
|
/>
|
||||||
<DoubleAnimation
|
<DoubleAnimation
|
||||||
Storyboard.TargetName="disabled"
|
Storyboard.TargetName="disabled"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)"
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
||||||
To="1"
|
To="1"
|
||||||
Duration="0" />
|
Duration="0"
|
||||||
|
/>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
@@ -104,7 +113,8 @@
|
|||||||
Storyboard.TargetName="Checked1"
|
Storyboard.TargetName="Checked1"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)"
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
||||||
To="1"
|
To="1"
|
||||||
Duration="0" />
|
Duration="0"
|
||||||
|
/>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="Unchecked" />
|
<VisualState x:Name="Unchecked" />
|
||||||
|
|||||||
@@ -1,56 +1,69 @@
|
|||||||
<UserControl x:Class="Controls.SearchTextBoxUserControl"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="Controls.SearchTextBoxUserControl"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800">
|
d:DesignWidth="800"
|
||||||
|
>
|
||||||
|
|
||||||
<Grid Name="SearchTextBoxUserControl1"
|
<Grid
|
||||||
Background="{x:Static mpvnet:Theme.Background}">
|
Name="SearchTextBoxUserControl1"
|
||||||
|
Background="{Binding Theme.Background}"
|
||||||
|
>
|
||||||
|
|
||||||
<TextBlock Name="HintTextBlock"
|
<TextBlock
|
||||||
Margin="5,2"
|
Name="HintTextBlock"
|
||||||
Text="Find a setting"
|
Margin="5,2"
|
||||||
VerticalAlignment="Center"
|
Text="Find a setting"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground2}"
|
VerticalAlignment="Center"
|
||||||
Background="{x:Static mpvnet:Theme.Background}" />
|
Foreground="{Binding Theme.Foreground2}"
|
||||||
|
Background="{Binding Theme.Background}"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextBox Name="SearchTextBox"
|
<TextBox
|
||||||
Height="25"
|
Name="SearchTextBox"
|
||||||
Padding="1,2,0,0"
|
Height="25"
|
||||||
BorderThickness="2"
|
Padding="1,2,0,0"
|
||||||
Background="Transparent"
|
BorderThickness="2"
|
||||||
TextChanged="SearchTextBox_TextChanged"
|
Background="Transparent"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
TextChanged="SearchTextBox_TextChanged"
|
||||||
CaretBrush="{x:Static mpvnet:Theme.Foreground}" />
|
Foreground="{Binding Theme.Foreground}"
|
||||||
|
CaretBrush="{Binding Theme.Foreground}"
|
||||||
|
/>
|
||||||
|
|
||||||
<Button Name="SearchClearButton"
|
<Button
|
||||||
Background="Transparent"
|
Name="SearchClearButton"
|
||||||
HorizontalAlignment="Right"
|
Background="Transparent"
|
||||||
FontFamily="Marlett"
|
HorizontalAlignment="Right"
|
||||||
FontSize="10"
|
FontFamily="Marlett"
|
||||||
Width="17"
|
FontSize="10"
|
||||||
Height="17"
|
Width="17"
|
||||||
Margin="2,0,4,0"
|
Height="17"
|
||||||
Visibility="Hidden"
|
Margin="2,0,4,0"
|
||||||
Click="SearchClearButton_Click" >r
|
Visibility="Hidden"
|
||||||
|
Click="SearchClearButton_Click"
|
||||||
|
>r
|
||||||
|
|
||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
<Setter Property="Background" Value="{x:Static mpvnet:Theme.Background}"/>
|
<Setter Property="Background" Value="{Binding Theme.Background}"/>
|
||||||
<Setter Property="Foreground" Value="{x:Static mpvnet:Theme.Foreground2}"/>
|
<Setter Property="Foreground" Value="{Binding Theme.Foreground2}"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="Button">
|
<ControlTemplate TargetType="Button">
|
||||||
<Border BorderThickness="1"
|
<Border
|
||||||
BorderBrush="{TemplateBinding Foreground}"
|
BorderThickness="1"
|
||||||
SnapsToDevicePixels="True">
|
BorderBrush="{TemplateBinding Foreground}"
|
||||||
|
SnapsToDevicePixels="True"
|
||||||
|
>
|
||||||
|
|
||||||
<ContentPresenter HorizontalAlignment="Center"
|
<ContentPresenter
|
||||||
VerticalAlignment="Center" />
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
/>
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
@@ -58,7 +71,7 @@
|
|||||||
|
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Foreground" Value="{x:Static mpvnet:Theme.Heading}"/>
|
<Setter Property="Foreground" Value="{Binding Theme.Heading}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
using mpvnet;
|
||||||
|
|
||||||
namespace Controls
|
namespace Controls
|
||||||
{
|
{
|
||||||
public partial class SearchTextBoxUserControl : UserControl
|
public partial class SearchTextBoxUserControl : UserControl
|
||||||
@@ -10,9 +12,17 @@ namespace Controls
|
|||||||
public SearchTextBoxUserControl()
|
public SearchTextBoxUserControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text { get => SearchTextBox.Text; set => SearchTextBox.Text = value; }
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Text {
|
||||||
|
get => SearchTextBox.Text;
|
||||||
|
set => SearchTextBox.Text = value;
|
||||||
|
}
|
||||||
|
|
||||||
string _HintText;
|
string _HintText;
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
<Window x:Class="mpvnet.SetupWindow"
|
<Window
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="mpvnet.SetupWindow"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mpvnet="clr-namespace:mpvnet"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
xmlns:mpvnet="clr-namespace:mpvnet"
|
||||||
|
mc:Ignorable="d"
|
||||||
Title="mpv.net Setup"
|
|
||||||
FontSize="13"
|
Title="mpv.net Setup"
|
||||||
Foreground="{x:Static mpvnet:Theme.Foreground}"
|
FontSize="13"
|
||||||
Background="{x:Static mpvnet:Theme.Background}"
|
Foreground="{Binding Theme.Foreground}"
|
||||||
SizeToContent="WidthAndHeight"
|
Background="{Binding Theme.Background}"
|
||||||
WindowStartupLocation="CenterOwner" >
|
SizeToContent="WidthAndHeight"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
|
>
|
||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
@@ -32,11 +34,13 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Grid.Column="0"
|
<Image
|
||||||
Source="{x:Static mpvnet:SetupWindow.ShieldIcon}"
|
Grid.Column="0"
|
||||||
Width="18"
|
Source="{x:Static mpvnet:SetupWindow.ShieldIcon}"
|
||||||
Height="18"
|
Width="18"
|
||||||
Margin="3,0,0,0"/>
|
Height="18"
|
||||||
|
Margin="3,0,0,0"
|
||||||
|
/>
|
||||||
<ContentPresenter Grid.Column="1" HorizontalAlignment="Center" />
|
<ContentPresenter Grid.Column="1" HorizontalAlignment="Center" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -13,7 +13,15 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
public partial class SetupWindow : Window
|
public partial class SetupWindow : Window
|
||||||
{
|
{
|
||||||
public SetupWindow() => InitializeComponent();
|
public SetupWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Theme Theme {
|
||||||
|
get => Theme.Current;
|
||||||
|
}
|
||||||
|
|
||||||
static BitmapSource _ShieldIcon;
|
static BitmapSource _ShieldIcon;
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ namespace mpvnet
|
|||||||
Application.Current.Resources.MergedDictionaries.Add(
|
Application.Current.Resources.MergedDictionaries.Add(
|
||||||
Application.LoadComponent(new Uri("mpvnet;component/WPF/Resources.xaml",
|
Application.LoadComponent(new Uri("mpvnet;component/WPF/Resources.xaml",
|
||||||
UriKind.Relative)) as ResourceDictionary);
|
UriKind.Relative)) as ResourceDictionary);
|
||||||
|
|
||||||
Application.Current.DispatcherUnhandledException += (sender, e) => App.ShowException(e.Exception);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ namespace mpvnet
|
|||||||
public MainForm()
|
public MainForm()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SetColors();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -945,15 +944,6 @@ namespace mpvnet
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetColors()
|
|
||||||
{
|
|
||||||
ToolStripRendererEx.ForegroundColor = Theme.Current.GetWinFormsColor("menu-foreground");
|
|
||||||
ToolStripRendererEx.BackgroundColor = Theme.Current.GetWinFormsColor("menu-background");
|
|
||||||
ToolStripRendererEx.SelectionColor = Theme.Current.GetWinFormsColor("menu-highlight");
|
|
||||||
ToolStripRendererEx.BorderColor = Theme.Current.GetWinFormsColor("menu-border");
|
|
||||||
ToolStripRendererEx.CheckedColor = Theme.Current.GetWinFormsColor("menu-checked");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnResize(EventArgs e)
|
protected override void OnResize(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnResize(e);
|
base.OnResize(e);
|
||||||
|
|||||||
@@ -197,7 +197,9 @@ public class ToolStripRendererEx : ToolStripSystemRenderer
|
|||||||
|
|
||||||
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
|
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Direction == ArrowDirection.Down) throw new NotImplementedException();
|
if (e.Direction == ArrowDirection.Down)
|
||||||
|
throw new NotImplementedException();
|
||||||
|
|
||||||
float x1 = e.Item.Width - e.Item.Height * 0.6f;
|
float x1 = e.Item.Width - e.Item.Height * 0.6f;
|
||||||
float y1 = e.Item.Height * 0.25f;
|
float y1 = e.Item.Height * 0.25f;
|
||||||
float x2 = x1 + e.Item.Height * 0.25f;
|
float x2 = x1 + e.Item.Height * 0.25f;
|
||||||
|
|||||||
@@ -234,6 +234,7 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
Reference in New Issue
Block a user