-
This commit is contained in:
@@ -130,6 +130,14 @@ $position = [mp]::get_property_number("time-pos");
|
|||||||
```
|
```
|
||||||
Please note that PowerShell don't allow assigning to events and mpv.net uses as workaround a matching script filename, a list of available events can be found in the mpv manual or in the file mp.cs in the mpv.net source code.
|
Please note that PowerShell don't allow assigning to events and mpv.net uses as workaround a matching script filename, a list of available events can be found in the mpv manual or in the file mp.cs in the mpv.net source code.
|
||||||
|
|
||||||
|
### Support
|
||||||
|
|
||||||
|
<https://forum.doom9.org/showthread.php?t=174841>
|
||||||
|
|
||||||
|
<https://forum.videohelp.com/threads/392514-mpv-net-a-extendable-media-player-for-windows>
|
||||||
|
|
||||||
|
<https://github.com/stax76/mpv.net/issues>
|
||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
### soon
|
### soon
|
||||||
|
|||||||
@@ -211,10 +211,7 @@ namespace mpvnet
|
|||||||
BeginInvoke(new Action(() => Close()));
|
BeginInvoke(new Action(() => Close()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsFullscreen
|
public bool IsFullscreen => WindowState == FormWindowState.Maximized;
|
||||||
{
|
|
||||||
get => WindowState == FormWindowState.Maximized;
|
|
||||||
}
|
|
||||||
|
|
||||||
void mp_ChangeFullscreen(bool value)
|
void mp_ChangeFullscreen(bool value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,14 +29,11 @@ namespace mpvnet
|
|||||||
|
|
||||||
//public class OSVersion
|
//public class OSVersion
|
||||||
//{
|
//{
|
||||||
// public static float Windows7 { get; set; } = 6.1f;
|
// public static float Windows7 { get; } = 6.1f;
|
||||||
// public static float Windows8 { get; set; } = 6.2f;
|
// public static float Windows8 { get; } = 6.2f;
|
||||||
// public static float Windows81 { get; set; } = 6.3f;
|
// public static float Windows81 { get; } = 6.3f;
|
||||||
// public static float Windows10 { get; set; } = 10f;
|
// public static float Windows10 { get; } = 10f;
|
||||||
|
|
||||||
// public static float Current
|
// public static float Current => Environment.OSVersion.Version.Major + Environment.OSVersion.Version.Minor / 10f;
|
||||||
// {
|
|
||||||
// get => Environment.OSVersion.Version.Major + Environment.OSVersion.Version.Minor / 10f;
|
|
||||||
// }
|
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
@@ -59,25 +59,10 @@ namespace mpvnet
|
|||||||
Bottom = bottom;
|
Bottom = bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rectangle ToRectangle()
|
public Rectangle ToRectangle() { return Rectangle.FromLTRB(Left, Top, Right, Bottom); }
|
||||||
{
|
public Size Size => new Size(Right - Left, Bottom - Top);
|
||||||
return Rectangle.FromLTRB(Left, Top, Right, Bottom);
|
public int Width => Right - Left;
|
||||||
}
|
public int Height => Bottom - Top;
|
||||||
|
|
||||||
public Size Size
|
|
||||||
{
|
|
||||||
get => new Size(Right - Left, Bottom - Top);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Width
|
|
||||||
{
|
|
||||||
get => Right - Left;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Height
|
|
||||||
{
|
|
||||||
get => Bottom - Top;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
195
mpv.net/Properties/Resources.Designer.cs
generated
195
mpv.net/Properties/Resources.Designer.cs
generated
@@ -1,97 +1,98 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.42000
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace mpvnet.Properties {
|
namespace mpvnet.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources() {
|
internal Resources() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("mpvnet.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("mpvnet.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to # mpv.net key bindings, mouse bindings and context menu configuration
|
/// Looks up a localized string similar to # mpv.net key bindings, mouse bindings and context menu configuration
|
||||||
///
|
///
|
||||||
/// o script-message mpv.net open-files #menu: O ; Open Files...
|
/// o script-message mpv.net open-files #menu: O ; Open Files...
|
||||||
/// _ ignore #menu: _ ; -
|
/// _ ignore #menu: _ ; -
|
||||||
/// Space cycle pause #menu: Space, Enter ; Play/Pause
|
/// Space cycle pause #menu: Space, Enter ; Play/Pause
|
||||||
/// Enter cycle pause
|
/// Enter cycle pause
|
||||||
/// s stop #menu: S ; Stop
|
/// s stop #menu: S ; Stop
|
||||||
/// _ ignore #menu: _ ; -
|
/// _ ignore #menu: _ ; -
|
||||||
/// f cycle fullscreen #menu: F ; Toggle Fullscreen
/// [rest of string was truncated]";.
|
/// f cycle fullscreen #menu: F ; Toggle Fullscreen
|
||||||
/// </summary>
|
/// [rest of string was truncated]";.
|
||||||
internal static string input_conf {
|
/// </summary>
|
||||||
get {
|
internal static string input_conf {
|
||||||
return ResourceManager.GetString("input_conf", resourceCulture);
|
get {
|
||||||
}
|
return ResourceManager.GetString("input_conf", resourceCulture);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to input-ar-delay = 500
|
/// <summary>
|
||||||
///input-ar-rate = 20
|
/// Looks up a localized string similar to input-ar-delay = 500
|
||||||
///volume = 50
|
///input-ar-rate = 20
|
||||||
///hwdec = yes
|
///volume = 50
|
||||||
///vo = direct3d
|
///hwdec = yes
|
||||||
///keep-open = yes
|
///vo = direct3d
|
||||||
///keep-open-pause = no
|
///keep-open = yes
|
||||||
///osd-playing-msg = '${filename}'
|
///keep-open-pause = no
|
||||||
///screenshot-directory = ~~desktop/.
|
///osd-playing-msg = '${filename}'
|
||||||
/// </summary>
|
///screenshot-directory = ~~desktop/.
|
||||||
internal static string mpv_conf {
|
/// </summary>
|
||||||
get {
|
internal static string mpv_conf {
|
||||||
return ResourceManager.GetString("mpv_conf", resourceCulture);
|
get {
|
||||||
}
|
return ResourceManager.GetString("mpv_conf", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace mpvnet
|
|||||||
public static string mpvConfFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\";
|
public static string mpvConfFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\";
|
||||||
public static string InputConfPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\input.conf";
|
public static string InputConfPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\input.conf";
|
||||||
public static string mpvConfPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\mpv.conf";
|
public static string mpvConfPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\mpv.conf";
|
||||||
public static List<PythonScript> PythonScripts { get; } = new List<PythonScript>();
|
public static List<PythonScript> PythonScripts => new List<PythonScript>();
|
||||||
public static AutoResetEvent AutoResetEvent = new AutoResetEvent(false);
|
public static AutoResetEvent AutoResetEvent = new AutoResetEvent(false);
|
||||||
|
|
||||||
private static Dictionary<string, string> _mpvConf;
|
private static Dictionary<string, string> _mpvConf;
|
||||||
|
|||||||
@@ -4,9 +4,27 @@
|
|||||||
xmlns:local="clr-namespace:DynamicGUI"
|
xmlns:local="clr-namespace:DynamicGUI"
|
||||||
StartupUri="MainWindow.xaml">
|
StartupUri="MainWindow.xaml">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<!--<Style x:Key="UrlTextBoxStyle" TargetType="TextBox">
|
<Style TargetType="TextBox">
|
||||||
<Setter Property="Cursor" Value="Hand"/>
|
<Setter Property="Template">
|
||||||
<Setter Property="Foreground" Value="Blue"/>
|
<Setter.Value>
|
||||||
</Style>-->
|
<ControlTemplate TargetType="{x:Type TextBox}">
|
||||||
|
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
||||||
|
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsEnabled" Value="false">
|
||||||
|
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsFocused" Value="true">
|
||||||
|
<Setter Property="BorderBrush" TargetName="border" Value="{x:Static SystemParameters.WindowGlassBrush}"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
@@ -1,30 +1,7 @@
|
|||||||
[[settings]]
|
[[settings]]
|
||||||
name = "volume"
|
|
||||||
default = ""
|
|
||||||
help = "volume=<integer> Set the startup volume. 0 means silence, 100 means no volume reduction or amplification. Negative values can be passed for compatibility, but are treated as 0. Since mpv 0.18.1, this always controls the internal mixer (aka \"softvol\")."
|
|
||||||
|
|
||||||
[[settings]]
|
|
||||||
name = "screen"
|
|
||||||
default = ""
|
|
||||||
help = "screen=<default|0-32> In multi-monitor configurations (i.e. a single desktop that spans across multiple displays), this option tells mpv which screen to display the video on. Default: default."
|
|
||||||
|
|
||||||
[[settings]]
|
|
||||||
name = "osd-playing-msg"
|
|
||||||
default = ""
|
|
||||||
width = 300
|
|
||||||
helpurl = "https://mpv.io/manual/master/#property-expansion"
|
|
||||||
help = "osd-playing-msg=<value> Show a message on OSD when playback starts. The string is expanded for properties, e.g. --osd-playing-msg='file: ${filename}' will show the message file: followed by a space and the currently played filename."
|
|
||||||
|
|
||||||
[[settings]]
|
|
||||||
name = "fullscreen"
|
|
||||||
alias = "fs"
|
|
||||||
default = "no"
|
|
||||||
help = "fullscreen=<yes|no>, fs=<yes|no> Start the player in fullscreen mode. Default: no."
|
|
||||||
options = [{ name = "yes" }, { name = "no", text = "no (Default)" }]
|
|
||||||
|
|
||||||
[[settings]]
|
|
||||||
name = "hwdec"
|
name = "hwdec"
|
||||||
default = "no"
|
default = "no"
|
||||||
|
filter = "Video"
|
||||||
helpurl = "https://mpv.io/manual/master/#options-hwdec"
|
helpurl = "https://mpv.io/manual/master/#options-hwdec"
|
||||||
help = "hwdec=<mode> Specify the hardware video decoding API that should be used if possible. Whether hardware decoding is actually done depends on the video codec. If hardware decoding is not possible, mpv will fall back on software decoding."
|
help = "hwdec=<mode> Specify the hardware video decoding API that should be used if possible. Whether hardware decoding is actually done depends on the video codec. If hardware decoding is not possible, mpv will fall back on software decoding."
|
||||||
options = [{ name = "no", text = "no (Default)", help = "always use software decoding (Default)" },
|
options = [{ name = "no", text = "no (Default)", help = "always use software decoding (Default)" },
|
||||||
@@ -45,20 +22,57 @@ options = [{ name = "no", text = "no (Default)", help = "always use software dec
|
|||||||
[[settings]]
|
[[settings]]
|
||||||
name = "vo"
|
name = "vo"
|
||||||
default = "gpu"
|
default = "gpu"
|
||||||
|
filter = "Video"
|
||||||
helpurl = "https://mpv.io/manual/master/#video-output-drivers-vo"
|
helpurl = "https://mpv.io/manual/master/#video-output-drivers-vo"
|
||||||
help = "gpu=<mode> Video output drivers to be used. Default = gpu."
|
help = "gpu=<mode> Video output drivers to be used. Default = gpu."
|
||||||
options = [{ name = "gpu", text = "gpu (Default)", help = "General purpose, customizable, GPU-accelerated video output driver. It supports extended scaling methods, dithering, color management, custom shaders, HDR, and more. (Default)" },
|
options = [{ name = "gpu", text = "gpu (Default)", help = "General purpose, customizable, GPU-accelerated video output driver. It supports extended scaling methods, dithering, color management, custom shaders, HDR, and more. (Default)" },
|
||||||
{ name = "direct3d", help = "Video output driver that uses the Direct3D interface" }]
|
{ name = "direct3d", help = "Video output driver that uses the Direct3D interface" }]
|
||||||
|
|
||||||
|
[[settings]]
|
||||||
|
name = "volume"
|
||||||
|
default = ""
|
||||||
|
filter = "Audio"
|
||||||
|
help = "volume=<integer> Set the startup volume. 0 means silence, 100 means no volume reduction or amplification. Negative values can be passed for compatibility, but are treated as 0. Since mpv 0.18.1, this always controls the internal mixer (aka \"softvol\")."
|
||||||
|
|
||||||
|
[[settings]]
|
||||||
|
name = "slang"
|
||||||
|
default = ""
|
||||||
|
filter = "Subtitles"
|
||||||
|
help = "--slang=<languagecode[,languagecode,...]> Specify a priority list of subtitle languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two letter language codes, Matroska uses ISO 639-2 three letter language codes while OGM uses a free-form identifier. See also --sid."
|
||||||
|
|
||||||
|
[[settings]]
|
||||||
|
name = "screen"
|
||||||
|
default = ""
|
||||||
|
filter = "Screen"
|
||||||
|
help = "screen=<default|0-32> In multi-monitor configurations (i.e. a single desktop that spans across multiple displays), this option tells mpv which screen to display the video on. Default: default."
|
||||||
|
|
||||||
|
[[settings]]
|
||||||
|
name = "osd-playing-msg"
|
||||||
|
default = ""
|
||||||
|
width = 300
|
||||||
|
filter = "Screen"
|
||||||
|
helpurl = "https://mpv.io/manual/master/#property-expansion"
|
||||||
|
help = "osd-playing-msg=<value> Show a message on OSD when playback starts. The string is expanded for properties, e.g. --osd-playing-msg='file: ${filename}' will show the message file: followed by a space and the currently played filename."
|
||||||
|
|
||||||
|
[[settings]]
|
||||||
|
name = "fullscreen"
|
||||||
|
alias = "fs"
|
||||||
|
default = "no"
|
||||||
|
filter = "Screen"
|
||||||
|
help = "fullscreen=<yes|no>, fs=<yes|no> Start the player in fullscreen mode. Default: no."
|
||||||
|
options = [{ name = "yes" }, { name = "no", text = "no (Default)" }]
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "keep-open-pause"
|
name = "keep-open-pause"
|
||||||
default = "yes"
|
default = "yes"
|
||||||
|
filter = "Playback"
|
||||||
help = "keep-open-pause=<yes|no> If set to no, instead of pausing when --keep-open is active, just stop at end of file and continue playing forward when you seek backwards until end where it stops again. Default: yes."
|
help = "keep-open-pause=<yes|no> If set to no, instead of pausing when --keep-open is active, just stop at end of file and continue playing forward when you seek backwards until end where it stops again. Default: yes."
|
||||||
options = [{ name = "yes", text = "yes (Default)" }, { name = "no" }]
|
options = [{ name = "yes", text = "yes (Default)" }, { name = "no" }]
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "keep-open"
|
name = "keep-open"
|
||||||
default = "no"
|
default = "no"
|
||||||
|
filter = "Playback"
|
||||||
help = "keep-open=<yes|no|always> Do not terminate when playing or seeking beyond the end of the file, and there is not next file to be played (and --loop is not used). Instead, pause the player. When trying to seek beyond end of the file, the player will attempt to seek to the last frame.\n\nNormally, this will act like set pause yes on EOF, unless the --keep-open-pause=no option is set."
|
help = "keep-open=<yes|no|always> Do not terminate when playing or seeking beyond the end of the file, and there is not next file to be played (and --loop is not used). Instead, pause the player. When trying to seek beyond end of the file, the player will attempt to seek to the last frame.\n\nNormally, this will act like set pause yes on EOF, unless the --keep-open-pause=no option is set."
|
||||||
options = [{ name = "yes", help = "Don't terminate if the current file is the last playlist entry. Equivalent to --keep-open without arguments."},
|
options = [{ name = "yes", help = "Don't terminate if the current file is the last playlist entry. Equivalent to --keep-open without arguments."},
|
||||||
{ name = "no", text = "no (Default)", help = "If the current file ends, go to the next file or terminate. (Default.)" },
|
{ name = "no", text = "no (Default)", help = "If the current file ends, go to the next file or terminate. (Default.)" },
|
||||||
@@ -68,11 +82,13 @@ options = [{ name = "yes", help = "Don't terminate if the current file is the la
|
|||||||
name = "loop-file"
|
name = "loop-file"
|
||||||
alias = "loop"
|
alias = "loop"
|
||||||
default = ""
|
default = ""
|
||||||
|
filter = "Playback"
|
||||||
help = "loop-file=<N|inf|no>, loop=<N|inf|no> Loop a single file N times. inf means forever, no means normal playback. For compatibility, --loop-file and --loop-file=yes are also accepted, and are the same as --loop-file=inf.\n\nThe difference to --loop-playlist is that this doesn't loop the playlist, just the file itself. If the playlist contains only a single file, the difference between the two option is that this option performs a seek on loop, instead of reloading the file.\n\n--loop is an alias for this option."
|
help = "loop-file=<N|inf|no>, loop=<N|inf|no> Loop a single file N times. inf means forever, no means normal playback. For compatibility, --loop-file and --loop-file=yes are also accepted, and are the same as --loop-file=inf.\n\nThe difference to --loop-playlist is that this doesn't loop the playlist, just the file itself. If the playlist contains only a single file, the difference between the two option is that this option performs a seek on loop, instead of reloading the file.\n\n--loop is an alias for this option."
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "save-position-on-quit"
|
name = "save-position-on-quit"
|
||||||
default = "no"
|
default = "no"
|
||||||
|
filter = "Playback"
|
||||||
help = "Always save the current playback position on quit. When this file is played again later, the player will seek to the old playback position on start. This does not happen if playback of a file is stopped in any other way than quitting. For example, going to the next file in the playlist will not save the position, and start playback at beginning the next time the file is played.\n\nThis behavior is disabled by default, but is always available when quitting the player with Shift+Q."
|
help = "Always save the current playback position on quit. When this file is played again later, the player will seek to the old playback position on start. This does not happen if playback of a file is stopped in any other way than quitting. For example, going to the next file in the playlist will not save the position, and start playback at beginning the next time the file is played.\n\nThis behavior is disabled by default, but is always available when quitting the player with Shift+Q."
|
||||||
options = [{ name = "yes" }, { name = "no", text = "no (Default)" }]
|
options = [{ name = "yes" }, { name = "no", text = "no (Default)" }]
|
||||||
|
|
||||||
@@ -81,33 +97,33 @@ name = "screenshot-directory"
|
|||||||
default = ""
|
default = ""
|
||||||
width = 500
|
width = 500
|
||||||
folder = true
|
folder = true
|
||||||
|
filter = "Screen"
|
||||||
help = "screenshot-directory=<value> Store screenshots in this directory. This path is joined with the filename generated by --screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot.\n\nThis option is not set by default, and thus will write screenshots to the directory from which mpv was started. In pseudo-gui mode (see PSEUDO GUI MODE), this is set to the desktop."
|
help = "screenshot-directory=<value> Store screenshots in this directory. This path is joined with the filename generated by --screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot.\n\nThis option is not set by default, and thus will write screenshots to the directory from which mpv was started. In pseudo-gui mode (see PSEUDO GUI MODE), this is set to the desktop."
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "input-ar-delay"
|
name = "input-ar-delay"
|
||||||
default = ""
|
default = ""
|
||||||
|
filter = "Input"
|
||||||
help = "input-ar-delay=<integer> Delay in milliseconds before we start to autorepeat a key (0 to disable)."
|
help = "input-ar-delay=<integer> Delay in milliseconds before we start to autorepeat a key (0 to disable)."
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "input-ar-rate"
|
name = "input-ar-rate"
|
||||||
default = ""
|
default = ""
|
||||||
|
filter = "Input"
|
||||||
help = "input-ar-rate=<integer> Number of key presses to generate per second on autorepeat."
|
help = "input-ar-rate=<integer> Number of key presses to generate per second on autorepeat."
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "alang"
|
name = "alang"
|
||||||
default = ""
|
default = ""
|
||||||
|
filter = "Audio"
|
||||||
help = "alang=<languagecode[,languagecode,...]> Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also --aid.\n\nExamples\n\nmpv dvd://1 --alang=hu,en chooses the Hungarian language track on a DVD and falls back on English if Hungarian is not available.\n\nmpv --alang=jpn example.mkv plays a Matroska file with Japanese audio."
|
help = "alang=<languagecode[,languagecode,...]> Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also --aid.\n\nExamples\n\nmpv dvd://1 --alang=hu,en chooses the Hungarian language track on a DVD and falls back on English if Hungarian is not available.\n\nmpv --alang=jpn example.mkv plays a Matroska file with Japanese audio."
|
||||||
|
|
||||||
[[settings]]
|
|
||||||
name = "slang"
|
|
||||||
default = ""
|
|
||||||
help = "--slang=<languagecode[,languagecode,...]> Specify a priority list of subtitle languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two letter language codes, Matroska uses ISO 639-2 three letter language codes while OGM uses a free-form identifier. See also --sid."
|
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "hr-seek"
|
name = "hr-seek"
|
||||||
default = "absolute"
|
default = "absolute"
|
||||||
|
filter = "Playback"
|
||||||
help = "hr-seek=<no|absolute|yes> Select when to use precise seeks that are not limited to keyframes. Such seeks require decoding video from the previous keyframe up to the target position and so can take some time depending on decoding performance. For some video formats, precise seeks are disabled. This option selects the default choice to use for seeks; it is possible to explicitly override that default in the definition of key bindings and in input commands."
|
help = "hr-seek=<no|absolute|yes> Select when to use precise seeks that are not limited to keyframes. Such seeks require decoding video from the previous keyframe up to the target position and so can take some time depending on decoding performance. For some video formats, precise seeks are disabled. This option selects the default choice to use for seeks; it is possible to explicitly override that default in the definition of key bindings and in input commands."
|
||||||
options = [{ name = "yes", help = "Use precise seeks whenever possible." },
|
options = [{ name = "yes", help = "Use precise seeks whenever possible." },
|
||||||
{ name = "no", help = "Never use precise seeks." },
|
{ name = "no", help = "Never use precise seeks." },
|
||||||
{ name = "absolute", text = "absolute (Default)", help = "Use precise seeks if the seek is to an absolute position in the file, such as a chapter seek, but not for relative seeks like the default behavior of arrow keys (default)." },
|
{ name = "absolute", text = "absolute (Default)", help = "Use precise seeks if the seek is to an absolute position in the file, such as a chapter seek, but not for relative seeks like the default behavior of arrow keys (default)." },
|
||||||
{ name = "always", help = "Same as yes (for compatibility)." }]
|
{ name = "always", help = "Same as yes (for compatibility)." }]
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ namespace DynamicGUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
baseSetting.Name = setting["name"];
|
baseSetting.Name = setting["name"];
|
||||||
|
baseSetting.Filter = setting["filter"];
|
||||||
if (setting.HasKey("help")) baseSetting.Help = setting["help"];
|
if (setting.HasKey("help")) baseSetting.Help = setting["help"];
|
||||||
if (setting.HasKey("helpurl")) baseSetting.HelpURL = setting["helpurl"];
|
if (setting.HasKey("helpurl")) baseSetting.HelpURL = setting["helpurl"];
|
||||||
if (setting.HasKey("alias")) baseSetting.Alias = setting["alias"];
|
if (setting.HasKey("alias")) baseSetting.Alias = setting["alias"];
|
||||||
@@ -62,6 +63,7 @@ namespace DynamicGUI
|
|||||||
public string Alias { get; set; }
|
public string Alias { get; set; }
|
||||||
public string Help { get; set; }
|
public string Help { get; set; }
|
||||||
public string HelpURL { get; set; }
|
public string HelpURL { get; set; }
|
||||||
|
public string Filter { get; set; }
|
||||||
public int Width { get; set; }
|
public int Width { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
namespace DynamicGUI
|
namespace DynamicGUI
|
||||||
{
|
{
|
||||||
interface ISearch
|
interface ISettingControl
|
||||||
{
|
{
|
||||||
bool Contains(string searchString);
|
bool Contains(string searchString);
|
||||||
|
SettingBase SettingBase { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<Grid Margin="20,0">
|
<Grid Margin="20,0">
|
||||||
<WrapPanel Orientation="Vertical">
|
<StackPanel>
|
||||||
<TextBox x:Name="TitleTextBox" FontSize="24" Margin="0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
<TextBox x:Name="TitleTextBox" FontSize="24" Margin="0,10" BorderThickness="0" IsReadOnly="True" Foreground="{x:Static SystemParameters.WindowGlassBrush}"></TextBox>
|
||||||
<ItemsControl x:Name="ItemsControl">
|
<ItemsControl x:Name="ItemsControl">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@@ -20,9 +20,9 @@
|
|||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" BorderThickness="0" IsReadOnly="True" Margin="0,10,0,0"></TextBox>
|
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" BorderThickness="0" IsReadOnly="True" Margin="0,10,0,0"></TextBox>
|
||||||
<TextBlock Margin="0,10,0,0">
|
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
||||||
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</WrapPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace DynamicGUI
|
namespace DynamicGUI
|
||||||
{
|
{
|
||||||
public partial class OptionSettingControl : UserControl, ISearch
|
public partial class OptionSettingControl : UserControl, ISettingControl
|
||||||
{
|
{
|
||||||
private OptionSetting OptionSetting;
|
private OptionSetting OptionSetting;
|
||||||
|
|
||||||
@@ -14,6 +15,9 @@ namespace DynamicGUI
|
|||||||
HelpTextBox.Text = optionSetting.Help;
|
HelpTextBox.Text = optionSetting.Help;
|
||||||
ItemsControl.ItemsSource = optionSetting.Options;
|
ItemsControl.ItemsSource = optionSetting.Options;
|
||||||
Link.SetURL(optionSetting.HelpURL);
|
Link.SetURL(optionSetting.HelpURL);
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(optionSetting.HelpURL))
|
||||||
|
LinkTextBlock.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _SearchableText;
|
private string _SearchableText;
|
||||||
@@ -31,6 +35,7 @@ namespace DynamicGUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SettingBase SettingBase => OptionSetting;
|
||||||
public bool Contains(string searchString) => SearchableText.Contains(searchString.ToLower());
|
public bool Contains(string searchString) => SearchableText.Contains(searchString.ToLower());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,8 @@
|
|||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800" >
|
d:DesignWidth="800" >
|
||||||
<Grid Margin="20,0">
|
<Grid Margin="20,0">
|
||||||
<WrapPanel Orientation="Vertical">
|
<StackPanel>
|
||||||
<TextBox x:Name="TitleTextBox" FontSize="24" Margin="0,0,0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
<TextBox x:Name="TitleTextBox" FontSize="24" Margin="0,10" BorderThickness="0" IsReadOnly="True" Foreground="{x:Static SystemParameters.WindowGlassBrush}"></TextBox>
|
||||||
<Grid Margin="0,0,0,10">
|
<Grid Margin="0,0,0,10">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@@ -19,6 +19,9 @@
|
|||||||
<Button x:Name="Button" Height="20" Grid.Column="1" Visibility="{Binding Path=Text, ElementName=StringSettingControl1}" Margin="5,0,0,0" Width="20" Click="Button_Click">...</Button>
|
<Button x:Name="Button" Height="20" Grid.Column="1" Visibility="{Binding Path=Text, ElementName=StringSettingControl1}" Margin="5,0,0,0" Width="20" Click="Button_Click">...</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" Margin="0,0,0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" Margin="0,0,0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
||||||
</WrapPanel>
|
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
||||||
|
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -3,7 +3,7 @@ using System.Windows.Controls;
|
|||||||
|
|
||||||
namespace DynamicGUI
|
namespace DynamicGUI
|
||||||
{
|
{
|
||||||
public partial class StringSettingControl : UserControl, ISearch
|
public partial class StringSettingControl : UserControl, ISettingControl
|
||||||
{
|
{
|
||||||
private StringSetting StringSetting;
|
private StringSetting StringSetting;
|
||||||
|
|
||||||
@@ -11,7 +11,6 @@ namespace DynamicGUI
|
|||||||
{
|
{
|
||||||
StringSetting = stringSetting;
|
StringSetting = stringSetting;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
TitleTextBox.Text = stringSetting.Name;
|
TitleTextBox.Text = stringSetting.Name;
|
||||||
HelpTextBox.Text = stringSetting.Help;
|
HelpTextBox.Text = stringSetting.Help;
|
||||||
ValueTextBox.Text = stringSetting.Value;
|
ValueTextBox.Text = stringSetting.Value;
|
||||||
@@ -19,6 +18,10 @@ namespace DynamicGUI
|
|||||||
ValueTextBox.Width = stringSetting.Width;
|
ValueTextBox.Width = stringSetting.Width;
|
||||||
if (!StringSetting.IsFolder)
|
if (!StringSetting.IsFolder)
|
||||||
Button.Visibility = Visibility.Hidden;
|
Button.Visibility = Visibility.Hidden;
|
||||||
|
Link.SetURL(StringSetting.HelpURL);
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(stringSetting.HelpURL))
|
||||||
|
LinkTextBlock.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _SearchableText;
|
private string _SearchableText;
|
||||||
@@ -33,6 +36,7 @@ namespace DynamicGUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool Contains(string searchString) => SearchableText.Contains(searchString.ToLower());
|
public bool Contains(string searchString) => SearchableText.Contains(searchString.ToLower());
|
||||||
|
public SettingBase SettingBase => StringSetting;
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,22 +1,39 @@
|
|||||||
<Window xmlns:DynamicGUI="clr-namespace:mpvSettingsEditor" x:Name="MainWindow1" x:Class="mpvSettingsEditor.MainWindow"
|
<Window x:Name="MainWindow1" x:Class="mpvSettingsEditor.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:mpvSettingsEditor"
|
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Height="500" Width="800" Loaded="MainWindow1_Loaded">
|
Height="500" Width="700" Loaded="MainWindow1_Loaded">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="4*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid x:Name="SearchGrid" Background="White" Width="300" Margin="0,0,0,10">
|
<Grid.ColumnDefinitions>
|
||||||
<TextBlock Margin="5,2" MinWidth="50" Text="Search..." Foreground="LightSteelBlue" IsHitTestVisible="False" />
|
<ColumnDefinition Width="10*" />
|
||||||
<TextBox MinWidth="50" Name="SearchTextBox" Background="Transparent" TextChanged="SearchTextBox_TextChanged" />
|
<ColumnDefinition Width="60*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid x:Name="SearchGrid" Background="White" Width="300" Margin="0,0,0,10" Grid.ColumnSpan="2">
|
||||||
|
<TextBlock x:Name="SearchTextBlock" Margin="5,2" Text="Find a setting" Foreground="LightSteelBlue" VerticalAlignment="Center" />
|
||||||
|
<TextBox Name="SearchTextBox" Padding="1,2,0,0" BorderThickness="2" Background="Transparent" TextChanged="SearchTextBox_TextChanged" Height="25" />
|
||||||
|
<Button x:Name="SearchClearButton" Background="Transparent" HorizontalAlignment="Right" Margin="2,0,4,0" FontSize="6" Width="16" Height="16" Visibility="Hidden" Click="SearchClearButton_Click">╳</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1">
|
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1" Grid.Column="1">
|
||||||
<WrapPanel x:Name="MainWrapPanel"></WrapPanel>
|
<StackPanel x:Name="MainStackPanel"></StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
<StackPanel Margin="20,0,0,0" Grid.Row="1">
|
||||||
|
<ListBox x:Name="FilterListBox" ItemsSource="{Binding FilterStrings}" BorderThickness="0" SelectionChanged="ListBox_SelectionChanged" Foreground="{x:Static SystemParameters.WindowGlassBrush}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding}" FontSize="16" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
<TextBlock x:Name="OpenSettingsTextBlock" Margin="0,30,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static SystemParameters.WindowGlassBrush}" MouseUp="OpenSettingsTextBlock_MouseUp">Open settings folder</TextBlock>
|
||||||
|
<TextBlock x:Name="ShowManualTextBlock" Margin="0,15,0,0" Cursor="Hand" TextWrapping="WrapWithOverflow" Foreground="{x:Static SystemParameters.WindowGlassBrush}" MouseUp="ShowManualTextBlock_MouseUp">Show mpv manual</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using DynamicGUI;
|
using DynamicGUI;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -14,15 +15,18 @@ namespace mpvSettingsEditor
|
|||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
public string mpvConfPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\mpv.conf";
|
public string mpvConfPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\mpv.conf";
|
||||||
private List<SettingBase> mpvSettings = Settings.LoadSettings(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\Definitions.toml");
|
private List<SettingBase> DynamicSettings = Settings.LoadSettings(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\Definitions.toml");
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
Title = (Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), true)[0] as AssemblyProductAttribute).Product + " " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
Title = (Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), true)[0] as AssemblyProductAttribute).Product + " " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
|
|
||||||
foreach (var setting in mpvSettings)
|
foreach (var setting in DynamicSettings)
|
||||||
{
|
{
|
||||||
|
if (!FilterStrings.Contains(setting.Filter))
|
||||||
|
FilterStrings.Add(setting.Filter);
|
||||||
foreach (var pair in mpvConf)
|
foreach (var pair in mpvConf)
|
||||||
{
|
{
|
||||||
if (setting.Name == pair.Key || setting.Alias == pair.Key)
|
if (setting.Name == pair.Key || setting.Alias == pair.Key)
|
||||||
@@ -39,10 +43,10 @@ namespace mpvSettingsEditor
|
|||||||
switch (setting)
|
switch (setting)
|
||||||
{
|
{
|
||||||
case StringSetting s:
|
case StringSetting s:
|
||||||
MainWrapPanel.Children.Add(new StringSettingControl(s));
|
MainStackPanel.Children.Add(new StringSettingControl(s));
|
||||||
break;
|
break;
|
||||||
case OptionSetting s:
|
case OptionSetting s:
|
||||||
MainWrapPanel.Children.Add(new OptionSettingControl(s));
|
MainStackPanel.Children.Add(new OptionSettingControl(s));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,11 +72,13 @@ namespace mpvSettingsEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<string> FilterStrings { get; } = new ObservableCollection<string>();
|
||||||
|
|
||||||
protected override void OnClosed(EventArgs e)
|
protected override void OnClosed(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnClosed(e);
|
base.OnClosed(e);
|
||||||
|
|
||||||
foreach (var mpvSetting in mpvSettings)
|
foreach (var mpvSetting in DynamicSettings)
|
||||||
{
|
{
|
||||||
switch (mpvSetting)
|
switch (mpvSetting)
|
||||||
{
|
{
|
||||||
@@ -96,7 +102,7 @@ namespace mpvSettingsEditor
|
|||||||
|
|
||||||
List<string> lines = File.ReadAllLines(mpvConfPath).ToList();
|
List<string> lines = File.ReadAllLines(mpvConfPath).ToList();
|
||||||
|
|
||||||
foreach (var mpvSetting in mpvSettings)
|
foreach (var mpvSetting in DynamicSettings)
|
||||||
{
|
{
|
||||||
foreach (var line in lines.ToArray())
|
foreach (var line in lines.ToArray())
|
||||||
{
|
{
|
||||||
@@ -129,7 +135,7 @@ namespace mpvSettingsEditor
|
|||||||
lines.Add(pair.Key + " = " + pair.Value);
|
lines.Add(pair.Key + " = " + pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var mpvSetting in mpvSettings)
|
foreach (var mpvSetting in DynamicSettings)
|
||||||
{
|
{
|
||||||
foreach (var line in lines.ToArray())
|
foreach (var line in lines.ToArray())
|
||||||
{
|
{
|
||||||
@@ -141,23 +147,72 @@ namespace mpvSettingsEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
File.WriteAllText(mpvConfPath, String.Join(Environment.NewLine, lines));
|
File.WriteAllText(mpvConfPath, String.Join(Environment.NewLine, lines));
|
||||||
MessageBox.Show("If running, restart mpv/mpv.net", Title, MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
|
foreach (Process process in Process.GetProcesses())
|
||||||
|
if (process.ProcessName == "mpv.net")
|
||||||
|
MessageBox.Show("Restart mpv.net in order to apply changed settings.", Title, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
else if (process.ProcessName == "mpv")
|
||||||
|
MessageBox.Show("Restart mpv in order to apply changed settings.", Title, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
for (int i = MainWrapPanel.Children.Count - 1; i >= 0; i--)
|
SearchTextBlock.Text = SearchTextBox.Text == "" ? "Find a setting" : "";
|
||||||
{
|
|
||||||
if ((MainWrapPanel.Children[i] as ISearch).Contains(SearchTextBox.Text))
|
|
||||||
MainWrapPanel.Children[i].Visibility = Visibility.Visible;
|
|
||||||
else
|
|
||||||
MainWrapPanel.Children[i].Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (SearchTextBox.Text == "")
|
||||||
|
SearchClearButton.Visibility = Visibility.Hidden;
|
||||||
|
else
|
||||||
|
SearchClearButton.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
string activeFilter = "";
|
||||||
|
|
||||||
|
foreach (var i in FilterStrings)
|
||||||
|
if (SearchTextBox.Text == i + ":")
|
||||||
|
activeFilter = i;
|
||||||
|
|
||||||
|
if (activeFilter == "")
|
||||||
|
{
|
||||||
|
foreach (UIElement i in MainStackPanel.Children)
|
||||||
|
if ((i as ISettingControl).Contains(SearchTextBox.Text))
|
||||||
|
i.Visibility = Visibility.Visible;
|
||||||
|
else
|
||||||
|
i.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
FilterListBox.SelectedItem = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
foreach (UIElement i in MainStackPanel.Children)
|
||||||
|
if ((i as ISettingControl).SettingBase.Filter == activeFilter)
|
||||||
|
i.Visibility = Visibility.Visible;
|
||||||
|
else
|
||||||
|
i.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
private void MainWindow1_Loaded(object sender, RoutedEventArgs e)
|
private void MainWindow1_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
FocusManager.SetFocusedElement(SearchGrid, SearchTextBox);
|
Keyboard.Focus(SearchTextBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.AddedItems.Count > 0)
|
||||||
|
SearchTextBox.Text = e.AddedItems[0].ToString() + ":";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SearchClearButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
SearchTextBox.Text = "";
|
||||||
|
Keyboard.Focus(SearchTextBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpenSettingsTextBlock_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Process.Start(Path.GetDirectoryName(mpvConfPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowManualTextBlock_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Process.Start("https://mpv.io/manual/master/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,11 +7,11 @@ using System.Windows;
|
|||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("mpv settings editor")]
|
[assembly: AssemblyTitle("mpv(.net) settings editor")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("mpv settings editor")]
|
[assembly: AssemblyProduct("mpv(.net) settings editor")]
|
||||||
[assembly: AssemblyCopyright("Copyright © stax76")]
|
[assembly: AssemblyCopyright("Copyright © stax76")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
@@ -51,5 +51,5 @@ using System.Windows;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.2.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("0.2.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|||||||
BIN
mpvSettingsEditor/mpv.ico
Normal file
BIN
mpvSettingsEditor/mpv.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
@@ -41,6 +41,9 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<LangVersion>8.0</LangVersion>
|
<LangVersion>8.0</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>mpv.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
@@ -125,5 +128,8 @@
|
|||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="mpv.ico" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user