This commit is contained in:
Frank Skare
2019-04-07 00:29:04 +02:00
parent 4492a423b4
commit b6072f03bf
9 changed files with 50 additions and 47 deletions

View File

@@ -79,7 +79,7 @@ https://github.com/stax76/mpv.net/wiki/Scripting-(CSharp,-Python,-JavaScript,-Lu
- the startup size was reduced and a issue was fixed that when the screen property was defined for a screen that isn't connected the startup size wasn't applied - the startup size was reduced and a issue was fixed that when the screen property was defined for a screen that isn't connected the startup size wasn't applied
- added feature to load external audio and subtitle files in the menu under: Open > Load external audio|subtitle files (default binding at: [input.conf](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt)) - added feature to load external audio and subtitle files in the menu under: Open > Load external audio|subtitle files (default binding at: [input.conf](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt))
- previously the conf edit GUI removed settings from the conf file if the setting was set to the default, the new behavior is not to remove anything - previously the conf edit GUI removed settings from the conf file if the setting was set to the default, the new behavior is not to remove anything
- the autofit mpv property was partly implemented, you can use 'autofit = 50%' in mpv.conf or '--autofit=50%' on the command line, WxH isn't implemented and only percent values are accepted. There is a new wiki page explaining limitations compared to the original mpv: <https://github.com/stax76/mpv.net/wiki/Limitations> - the autofit mpv property was partly implemented, you can use 'autofit = 50%' in mpv.conf or '--autofit=50%' on the command line, WxH isn't implemented and only percent values are accepted. There is a new wiki page explaining the mpv.net limitations compared to the original mpv: [Limitations](https://github.com/stax76/mpv.net/wiki/Limitations)
### 2.3 (2019-04-04) ### 2.3 (2019-04-04)

View File

@@ -61,16 +61,20 @@ namespace mpvnet.Properties {
} }
/// <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
/// # This file defines the input (keys and mouse) bindings of mpv and mpv.net
/// # and it also defines the context menu of mpv.net. mpv.net has an input
/// # editor and an conf editor as alternatives to editing conf text files.
/// # The input and conf editors can be found in mpv.net&apos;s context menu at:
/// ///
/// o script-message mpv.net open-files #menu: O ; Open Files... /// # Settings &gt; Show Config Editor
/// _ ignore #menu: _ ; - /// # Settings &gt; Show Input Editor
/// Space cycle pause #menu: Space, Enter ; Play/Pause ///
/// Enter cycle pause /// # The defaults of this file can be found at:
/// s stop #menu: S ; Stop ///
/// _ ignore #menu: _ ; - /// # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt
/// f cycle fullscreen #menu: F ; Toggle Fullscreen ///
/// [rest of string was truncated]&quot;;. /// # the [rest of string was truncated]&quot;;.
/// </summary> /// </summary>
internal static string input_conf { internal static string input_conf {
get { get {
@@ -79,15 +83,20 @@ namespace mpvnet.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to input-ar-delay = 500 /// Looks up a localized string similar to
///# mpv manual: https://mpv.io/manual/master/
///
///# mpv.net mpv.conf defaults: https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpv.conf.txt
///
///input-ar-delay = 500
///input-ar-rate = 20 ///input-ar-rate = 20
///volume = 50 ///volume = 50
///hwdec = yes ///hwdec = yes
///vo = direct3d
///keep-open = yes ///keep-open = yes
///keep-open-pause = no ///keep-open-pause = no
///osd-playing-msg = &apos;${filename}&apos; ///osd-playing-msg = ${filename}
///screenshot-directory = ~~desktop/. ///screenshot-directory = ~~desktop/
///input-default-bindings = no.
/// </summary> /// </summary>
internal static string mpv_conf { internal static string mpv_conf {
get { get {

View File

@@ -1,7 +1,7 @@
# This file defines the input (keys and mouse) bindings of mpv and mpv.net # This file defines the input (keys and mouse) bindings of mpv and mpv.net
# and it also defines the context menu of mpv.net. mpv.net has a input # and it also defines the context menu of mpv.net. mpv.net has an input
# editor and a conf editor as alternatives to editing this file via texteditor. # editor and an conf editor as alternatives to editing conf text files.
# The input and conf editors can be found in mpv.net's context menu at: # The input and conf editors can be found in mpv.net's context menu at:
# Settings > Show Config Editor # Settings > Show Config Editor

View File

@@ -197,36 +197,29 @@ namespace mpvnet
case mpv_event_id.MPV_EVENT_CLIENT_MESSAGE: case mpv_event_id.MPV_EVENT_CLIENT_MESSAGE:
if (ClientMessage != null) if (ClientMessage != null)
{ {
try var client_messageData = (mpv_event_client_message)Marshal.PtrToStructure(evt.data, typeof(mpv_event_client_message));
string[] args = NativeUtf8StrArray2ManagedStrArray(client_messageData.args, client_messageData.num_args);
if (args != null && args.Length > 1 && args[0] == "mpv.net")
{ {
var client_messageData = (mpv_event_client_message)Marshal.PtrToStructure(evt.data, typeof(mpv_event_client_message)); bool found = false;
string[] args = NativeUtf8StrArray2ManagedStrArray(client_messageData.args, client_messageData.num_args);
if (args != null && args.Length > 1 && args[0] == "mpv.net") foreach (var i in mpvnet.Command.Commands)
{ {
bool found = false; if (args[1] == i.Name)
foreach (var i in mpvnet.Command.Commands)
{ {
if (args[1] == i.Name) found = true;
{ i.Action.Invoke(args.Skip(2).ToArray());
found = true;
i.Action.Invoke(args.Skip(2).ToArray());
}
}
if (!found)
{
List<string> names = mpvnet.Command.Commands.Select((item) => item.Name).ToList();
names.Sort();
MainForm.Instance.ShowMsgBox($"No command '{args[1]}' found. Available commands are:\n\n{string.Join("\n", names)}\n\nHow to bind these commands can be seen in the default input bindings and menu definition located at:\n\nhttps://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt", MessageBoxIcon.Error);
} }
} }
ClientMessage?.Invoke(args); if (!found)
} {
catch (Exception ex) List<string> names = mpvnet.Command.Commands.Select((item) => item.Name).ToList();
{ names.Sort();
MainForm.Instance.ShowMsgBox(ex.GetType().Name + "\n\n" + ex.ToString(), MessageBoxIcon.Error); MainForm.Instance.ShowMsgBox($"No command '{args[1]}' found. Available commands are:\n\n{string.Join("\n", names)}\n\nHow to bind these commands can be seen in the default input bindings and menu definition located at:\n\nhttps://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt", MessageBoxIcon.Error);
}
} }
ClientMessage?.Invoke(args);
} }
break; break;
case mpv_event_id.MPV_EVENT_VIDEO_RECONFIG: case mpv_event_id.MPV_EVENT_VIDEO_RECONFIG:

View File

@@ -25,6 +25,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<LangVersion>7.3</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>

View File

@@ -12,8 +12,8 @@
<mpvInputEdit.Properties.Settings> <mpvInputEdit.Properties.Settings>
<setting name="input_conf_help" serializeAs="String"> <setting name="input_conf_help" serializeAs="String">
<value> # This file defines the input (keys and mouse) bindings of mpv and mpv.net <value> # This file defines the input (keys and mouse) bindings of mpv and mpv.net
# and it also defines the context menu of mpv.net. mpv.net has a input # and it also defines the context menu of mpv.net. mpv.net has an input
# editor and a conf editor as alternatives to editing this file via texteditor. # editor and an conf editor as alternatives to editing conf text files.
# The input and conf editors can be found in mpv.net's context menu at: # The input and conf editors can be found in mpv.net's context menu at:
# Settings &gt; Show Config Editor # Settings &gt; Show Config Editor

View File

@@ -26,8 +26,8 @@ namespace mpvInputEdit.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@" # This file defines the input (keys and mouse) bindings of mpv and mpv.net [global::System.Configuration.DefaultSettingValueAttribute(@" # This file defines the input (keys and mouse) bindings of mpv and mpv.net
# and it also defines the context menu of mpv.net. mpv.net has a input # and it also defines the context menu of mpv.net. mpv.net has an input
# editor and a conf editor as alternatives to editing this file via texteditor. # editor and an conf editor as alternatives to editing conf text files.
# The input and conf editors can be found in mpv.net's context menu at: # The input and conf editors can be found in mpv.net's context menu at:
# Settings > Show Config Editor # Settings > Show Config Editor

View File

@@ -4,8 +4,8 @@
<Settings> <Settings>
<Setting Name="input_conf_help" Type="System.String" Scope="User"> <Setting Name="input_conf_help" Type="System.String" Scope="User">
<Value Profile="(Default)"> # This file defines the input (keys and mouse) bindings of mpv and mpv.net <Value Profile="(Default)"> # This file defines the input (keys and mouse) bindings of mpv and mpv.net
# and it also defines the context menu of mpv.net. mpv.net has a input # and it also defines the context menu of mpv.net. mpv.net has an input
# editor and a conf editor as alternatives to editing this file via texteditor. # editor and an conf editor as alternatives to editing conf text files.
# The input and conf editors can be found in mpv.net's context menu at: # The input and conf editors can be found in mpv.net's context menu at:
# Settings &gt; Show Config Editor # Settings &gt; Show Config Editor

View File

@@ -10,7 +10,7 @@ AppVersion={#MyAppVersion}
AppPublisher=stax76 AppPublisher=stax76
ArchitecturesInstallIn64BitMode=x64 ArchitecturesInstallIn64BitMode=x64
Compression=lzma2 Compression=lzma2
DefaultDirName={commonpf}\{#MyAppName} DefaultDirName={pf}\{#MyAppName}
OutputBaseFilename=mpvnet-{#MyAppVersion} OutputBaseFilename=mpvnet-{#MyAppVersion}
OutputDir=C:\Users\frank\Desktop OutputDir=C:\Users\frank\Desktop
DefaultGroupName={#MyAppName} DefaultGroupName={#MyAppName}