From: Lars Op den Kamp Date: Fri, 10 Feb 2012 11:45:11 +0000 (+0100) Subject: cec: use the new "config constructor" in CecSharpClient X-Git-Tag: upstream/2.2.0~1^2~35^2~112 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=7f7414d5b7b79fbe2b3da8a34e86a5c7067653c5 cec: use the new "config constructor" in CecSharpClient --- diff --git a/src/CecSharpTester/CecSharpClient.cs b/src/CecSharpTester/CecSharpClient.cs index a86d6fb..f989eb0 100644 --- a/src/CecSharpTester/CecSharpClient.cs +++ b/src/CecSharpTester/CecSharpClient.cs @@ -41,11 +41,14 @@ namespace CecSharpClient { public CecSharpClient() { - CecDeviceTypeList types = new CecDeviceTypeList(); - types.Types[0] = CecDeviceType.RecordingDevice; + Config = new LibCECConfiguration(); + Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; + Config.DeviceName = "CEC Tester"; + Config.ClientVersion = CecClientVersion.Version1_5_0; + Config.SetCallbacks(this); + LogLevel = (int)CecLogLevel.All; - Lib = new LibCecSharp("CEC Tester", types); - LogLevel = (int) CecLogLevel.All; + Lib = new LibCecSharp(Config); Console.WriteLine("CEC Parser created - libcec version " + Lib.GetLibVersionMajor() + "." + Lib.GetLibVersionMinor()); } @@ -195,8 +198,6 @@ namespace CecSharpClient public void MainLoop() { - Lib.EnableCallbacks(this); - Lib.PowerOnDevices(CecLogicalAddress.Tv); Lib.SetActiveSource(CecDeviceType.PlaybackDevice); @@ -385,7 +386,8 @@ namespace CecSharpClient } } - private int LogLevel; - private LibCecSharp Lib; + private int LogLevel; + private LibCecSharp Lib; + private LibCECConfiguration Config; } }