use pascal casing everywhere

This commit is contained in:
Frank Skare
2021-07-15 14:40:59 +02:00
parent 43c150a18b
commit 886f3349ae
19 changed files with 270 additions and 277 deletions

View File

@@ -12,8 +12,8 @@ class Script
string content = "ctrl+w script-message my-message-1 my-argument-1";
string sectionName = Assembly.GetExecutingAssembly().GetName().Name;
CorePlayer core = Global.Core;
core.commandv("define-section", sectionName, content, "force");
core.commandv("enable-section", sectionName);
core.CommandV("define-section", sectionName, content, "force");
core.CommandV("enable-section", sectionName);
core.ClientMessage += ClientMessage;
}

View File

@@ -11,11 +11,11 @@ class Script
public Script()
{
Core = Global.Core;
Core.observe_property_bool("fullscreen", FullscreenChange);
Core.ObservePropertyBool("fullscreen", FullscreenChange);
}
void FullscreenChange(bool value)
{
Core.commandv("show-text", "fullscreen: " + value);
Core.CommandV("show-text", "fullscreen: " + value);
}
}

View File

@@ -25,11 +25,11 @@ class Script
{
if (MainForm.WindowState == FormWindowState.Minimized)
{
WasPlaying = !Core.get_property_bool("pause");
WasPlaying = !Core.GetPropertyBool("pause");
if (WasPlaying)
{
Core.set_property_bool("pause", true, true);
Core.SetPropertyBool("pause", true, true);
WasPaused = true;
}
}
@@ -37,7 +37,7 @@ class Script
{
if (WasPaused)
{
Core.set_property_bool("pause", false, true);
Core.SetPropertyBool("pause", false, true);
WasPaused = false;
}
}

View File

@@ -69,13 +69,13 @@ class Script
if (int.TryParse(args[1], out rating))
{
string path = Core.get_property_string("path");
string path = Core.GetPropertyString("path");
if (!File.Exists(path))
return;
Dic[path] = rating;
Core.commandv("show-text", "Rating: " + rating);
Core.CommandV("show-text", "Rating: " + rating);
}
}
}

View File

@@ -31,7 +31,7 @@ class Script
foreach (MediaTrack track in editionTracks)
{
MenuItem mi = new MenuItem(track.Text);
mi.Action = () => { Core.commandv("set", "edition", track.ID.ToString()); };
mi.Action = () => { Core.CommandV("set", "edition", track.ID.ToString()); };
mi.Checked = Core.Edition == track.ID;
menuItem.DropDownItems.Add(mi);
}

View File

@@ -17,4 +17,4 @@ $code = {
}
}
$mp.register_event("client-message", $code)
$mp.RegisterEvent("client-message", $code)

View File

@@ -1,13 +1,13 @@
$code = {
$isMinimized = $args[0]
$isPaused = $mp.get_property_bool('pause')
$isPaused = $mp.GetPropertyBool('pause')
if ($isMinimized)
{
if (-not $isPaused)
{
$mp.set_property_bool('pause', $true)
$mp.SetPropertyBool('pause', $true)
$script:wasPaused = $true
}
}
@@ -15,11 +15,11 @@ $code = {
{
if ($script:wasPaused -and $isPaused)
{
$mp.set_property_bool('pause', $false)
$mp.SetPropertyBool('pause', $false)
}
$script:wasPaused = $false
}
}
$mp.observe_property('window-minimized', 'bool', $code)
$mp.ObserveProperty('window-minimized', 'bool', $code)

View File

@@ -6,9 +6,8 @@
$code = {
if ($args[0] -eq 'show-in-file-explorer')
{
# probably works only with shell execute for which powershell has no built-in support
[Diagnostics.Process]::Start('explorer.exe', '/n, /select, "' + $mp.get_property_string('path') + '"')
Start-Process explorer.exe '/n,','/select,',"$($mp.GetPropertyString('path'))"
}
}
$mp.register_event("client-message", $code)
$mp.RegisterEvent("client-message", $code)