add some 2023 oled settings

This commit is contained in:
Vincent Maas committed 2023-05-12 19:25:41 +02:00
1 parent fa013b056f
commit 58e03313e0
6 files changed
+101 -40

No files matched your search

+2 -2
View File
@@ -18,8 +18,8 @@
<PublisherName>Maassoft</PublisherName>
<Company>Maassoft</Company>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>9.3.0.0</ApplicationVersion>
<Version>9.3.0.0</Version>
<ApplicationVersion>9.4.0.0</ApplicationVersion>
<Version>9.4.0.0</Version>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>false</BootstrapperEnabled>
+15
View File
@@ -237,6 +237,14 @@ namespace ColorControl.Services.LG
AddGenericPictureAction("freesyncOLEDHDMI2", typeof(OffToOn), category: "other", fromModelYear: ModelYear.Series2020);
AddGenericPictureAction("freesyncOLEDHDMI3", typeof(OffToOn), category: "other", fromModelYear: ModelYear.Series2020);
AddGenericPictureAction("freesyncOLEDHDMI4", typeof(OffToOn), category: "other", fromModelYear: ModelYear.Series2020);
AddGenericPictureAction("444BypassHDMI1", typeof(OffToOn), category: "other", title: "4:4:4 Pass Through HDMI1", fromModelYear: ModelYear.Series2023);
AddGenericPictureAction("444BypassHDMI2", typeof(OffToOn), category: "other", title: "4:4:4 Pass Through HDMI2", fromModelYear: ModelYear.Series2023);
AddGenericPictureAction("444BypassHDMI3", typeof(OffToOn), category: "other", title: "4:4:4 Pass Through HDMI3", fromModelYear: ModelYear.Series2023);
AddGenericPictureAction("444BypassHDMI4", typeof(OffToOn), category: "other", title: "4:4:4 Pass Through HDMI4", fromModelYear: ModelYear.Series2023);
AddGenericPictureAction("444BypassHDMINone", typeof(OffToOn), category: "other", title: "4:4:4 Pass Through Non-HDMI", fromModelYear: ModelYear.Series2023);
AddGenericPictureAction("qmsVrr", typeof(OffToOn), category: "other", title: "QMS-VRR", fromModelYear: ModelYear.Series2023);
//AddGenericPictureAction("freesyncSupport", typeof(OffToOn), category: "other");
AddGenericPictureAction("hdmiPcMode_hdmi1", typeof(FalseToTrue), category: "other");
AddGenericPictureAction("hdmiPcMode_hdmi2", typeof(FalseToTrue), category: "other");
@@ -1017,6 +1025,13 @@ namespace ColorControl.Services.LG
await _lgTvApi.SetConfig("tv.model.motionProMode", mode);
}
public async Task SetSvcMenuFlag(bool enabled)
{
await CheckConnectionAsync();
await _lgTvApi.SetSystemSettings("svcMenuFlag", enabled, "other");
}
internal async Task SetConfig(string key, object value)
{
await CheckConnectionAsync();
+32 -5
View File
@@ -53,6 +53,9 @@
mnuLgOLEDMotionPro = new System.Windows.Forms.ToolStripMenuItem();
miLgEnableMotionPro = new System.Windows.Forms.ToolStripMenuItem();
miLgDisableMotionPro = new System.Windows.Forms.ToolStripMenuItem();
mnuLgSetSvcMenuFlag = new System.Windows.Forms.ToolStripMenuItem();
miLgFullServiceMenuEnable = new System.Windows.Forms.ToolStripMenuItem();
miLgFullServiceMenuDisable = new System.Windows.Forms.ToolStripMenuItem();
miLgExpertSeparator1 = new System.Windows.Forms.ToolStripSeparator();
chkLgRemoteControlShow = new System.Windows.Forms.CheckBox();
label3 = new System.Windows.Forms.Label();
@@ -384,17 +387,17 @@
// mnuLgExpert
//
mnuLgExpert.ImageScalingSize = new System.Drawing.Size(20, 20);
mnuLgExpert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { mnuLgOLEDMotionPro, miLgExpertSeparator1 });
mnuLgExpert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { mnuLgOLEDMotionPro, mnuLgSetSvcMenuFlag, miLgExpertSeparator1 });
mnuLgExpert.Name = "mnuLgButtons";
mnuLgExpert.Size = new System.Drawing.Size(359, 32);
mnuLgExpert.Size = new System.Drawing.Size(321, 76);
mnuLgExpert.Opening += mnuLgExpert_Opening;
//
// mnuLgOLEDMotionPro
//
mnuLgOLEDMotionPro.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { miLgEnableMotionPro, miLgDisableMotionPro });
mnuLgOLEDMotionPro.Name = "mnuLgOLEDMotionPro";
mnuLgOLEDMotionPro.Size = new System.Drawing.Size(358, 22);
mnuLgOLEDMotionPro.Text = "Activate OLED Motion Pro (B9/C9/E9/W9/C2/G2 only)";
mnuLgOLEDMotionPro.Size = new System.Drawing.Size(320, 22);
mnuLgOLEDMotionPro.Text = "Activate OLED Motion Pro (B9/C9/E9/W9 only)";
//
// miLgEnableMotionPro
//
@@ -410,10 +413,31 @@
miLgDisableMotionPro.Text = "Disable OLED Motion Pro";
miLgDisableMotionPro.Click += miLgDisableMotionPro_Click;
//
// mnuLgSetSvcMenuFlag
//
mnuLgSetSvcMenuFlag.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { miLgFullServiceMenuEnable, miLgFullServiceMenuDisable });
mnuLgSetSvcMenuFlag.Name = "mnuLgSetSvcMenuFlag";
mnuLgSetSvcMenuFlag.Size = new System.Drawing.Size(320, 22);
mnuLgSetSvcMenuFlag.Text = "Enable Full Service Menu (C3/G3 only)";
//
// miLgFullServiceMenuEnable
//
miLgFullServiceMenuEnable.Name = "miLgFullServiceMenuEnable";
miLgFullServiceMenuEnable.Size = new System.Drawing.Size(112, 22);
miLgFullServiceMenuEnable.Text = "Enable";
miLgFullServiceMenuEnable.Click += miLgFullServiceMenuEnable_Click;
//
// miLgFullServiceMenuDisable
//
miLgFullServiceMenuDisable.Name = "miLgFullServiceMenuDisable";
miLgFullServiceMenuDisable.Size = new System.Drawing.Size(112, 22);
miLgFullServiceMenuDisable.Text = "Disable";
miLgFullServiceMenuDisable.Click += miLgFullServiceMenuDisable_Click;
//
// miLgExpertSeparator1
//
miLgExpertSeparator1.Name = "miLgExpertSeparator1";
miLgExpertSeparator1.Size = new System.Drawing.Size(355, 6);
miLgExpertSeparator1.Size = new System.Drawing.Size(317, 6);
//
// chkLgRemoteControlShow
//
@@ -908,5 +932,8 @@
private System.Windows.Forms.ToolStripMenuItem miTestPowerOffOn;
private System.Windows.Forms.ToolStripMenuItem miNvSettings;
private System.Windows.Forms.Button btnLgDeviceOptionsSettings;
private System.Windows.Forms.ToolStripMenuItem mnuLgSetSvcMenuFlag;
private System.Windows.Forms.ToolStripMenuItem miLgFullServiceMenuEnable;
private System.Windows.Forms.ToolStripMenuItem miLgFullServiceMenuDisable;
}
}
+27 -5
View File
@@ -844,7 +844,12 @@ Do you want to continue?"
var enableVisible = eligibleModelsEnable.Any(m => device?.ModelName?.Contains(m) == true);
mnuLgOLEDMotionPro.Visible = visible;
miLgEnableMotionPro.Visible = enableVisible;
miLgExpertSeparator1.Visible = visible;
var svcMenuFlagVisible = new[] { "C3", "G3" }.Any(m => device?.ModelName?.Contains(m) == true);
mnuLgSetSvcMenuFlag.Visible = svcMenuFlagVisible;
miLgExpertSeparator1.Visible = visible || svcMenuFlagVisible;
BuildLgActionMenu(device, mnuLgExpert.Items, mnuLgExpert.Name, btnLgExpertColorGamut_Click, _lgService.Config.ShowAdvancedActions, true);
}
@@ -999,19 +1004,19 @@ Do you want to continue?"
await _lgService.ApplyPreset(preset);
}
private void miLgEnableMotionPro_Click(object sender, EventArgs e)
private async void miLgEnableMotionPro_Click(object sender, EventArgs e)
{
if (MessageForms.QuestionYesNo("Are you sure you want to enable OLED Motion Pro? This app and its creator are in no way accountable for any damages it may cause to your tv.") == DialogResult.Yes)
{
_lgService.SelectedDevice?.SetOLEDMotionPro("OLED Motion Pro");
await _lgService.SelectedDevice?.SetOLEDMotionPro("OLED Motion Pro");
MessageForms.InfoOk("Setting applied.");
}
}
private void miLgDisableMotionPro_Click(object sender, EventArgs e)
private async void miLgDisableMotionPro_Click(object sender, EventArgs e)
{
_lgService.SelectedDevice?.SetOLEDMotionPro("OLED Motion");
await _lgService.SelectedDevice?.SetOLEDMotionPro("OLED Motion");
MessageForms.InfoOk("Setting applied.");
}
@@ -1315,5 +1320,22 @@ The InStart, EzAdjust and Software Update items are now visible under the Expert
device.TurnScreenOnAfterScreenSaver = turnOnField.ValueAsBool;
device.HandleManualScreenSaver = manualField.ValueAsBool;
}
private async void miLgFullServiceMenuEnable_Click(object sender, EventArgs e)
{
if (MessageForms.QuestionYesNo("Are you sure you want to enable the full service menu (instead of the simplified one)? This app and its creator are in no way accountable for any damages it may cause to your tv.") == DialogResult.Yes)
{
await _lgService.SelectedDevice?.SetSvcMenuFlag(false);
MessageForms.InfoOk("Setting applied.");
}
}
private async void miLgFullServiceMenuDisable_Click(object sender, EventArgs e)
{
await _lgService.SelectedDevice?.SetSvcMenuFlag(true);
MessageForms.InfoOk("Setting applied.");
}
}
}
+22 -21
View File
@@ -110,16 +110,18 @@ namespace LgTv
_messageWriter.WriteString(message);
using (var cancellationTokenSource = new CancellationTokenSource(5000))
{
await _messageWriter.StoreAsync().AsTask(cancellationTokenSource.Token).ContinueWith((antecedent) =>
{
if (antecedent.Status != TaskStatus.RanToCompletion)
{
throw new Exception("SendMessageAsync cancelled due to timeout");
}
});
}
await _messageWriter.StoreAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(5));
//using (var cancellationTokenSource = new CancellationTokenSource(5000))
//{
// await _messageWriter.StoreAsync().AsTask(cancellationTokenSource.Token).ContinueWith((antecedent) =>
// {
// if (antecedent.Status != TaskStatus.RanToCompletion)
// {
// throw new Exception("SendMessageAsync cancelled due to timeout");
// }
// });
//}
}
catch (Exception e)
{
@@ -187,24 +189,23 @@ namespace LgTv
ConnectionClosed = true;
}
private void Connection_MessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
private async void Connection_MessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
{
try
{
var task = new Task<DataReader>(new Func<DataReader>(args.GetDataReader));
var task = new Task<DataReader>(args.GetDataReader);
task.Start();
var result = task.Wait(5000);
var dataReader = await task.WaitAsync(TimeSpan.FromSeconds(5));
var dr = result ? task.Result : null;
if (!result)
{
throw new Exception("Timeout while reading response, possible disconnect");
}
//if (!result)
//{
// throw new Exception("Timeout while reading response, possible disconnect");
//}
using (dr)
using (dataReader)
{
dr.UnicodeEncoding = UnicodeEncoding.Utf8;
var message = dr.ReadString(dr.UnconsumedBufferLength);
dataReader.UnicodeEncoding = UnicodeEncoding.Utf8;
var message = dataReader.ReadString(dataReader.UnconsumedBufferLength);
var obj = JsonConvert.DeserializeObject<dynamic>(message);
var id = (string)obj.id;
var type = (string)obj.type;
+3 -7
View File
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows10.0.20348.0</TargetFramework>
<Version>0.8.1.105</Version>
<Version>0.8.1.106</Version>
<Company>falahati.net</Company>
<Description>NvAPIWrapper is a .Net wrapper for NVIDIA public API</Description>
<Authors>Soroush Falahati</Authors>
@@ -23,17 +23,13 @@
<OutputPath>..\Debug</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<BumpRevision>True</BumpRevision>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<BumpRevision>False</BumpRevision>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<OutputPath>..\Release</OutputPath>
<DocumentationFile>..\Release\NvAPIWrapper.xml</DocumentationFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<ItemGroup>
<PackageReference PrivateAssets="all" Include="MSBump" Version="2.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="readme.txt">