From: Lars Op den Kamp Date: Thu, 16 Feb 2012 00:59:06 +0000 (+0100) Subject: LibCecSharp: pass correctly formatted logical address lists X-Git-Tag: upstream/2.2.0~1^2~35^2~31 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=63851508ba8fac60c03c1899bf98595481a161c5;p=deb_libcec.git LibCecSharp: pass correctly formatted logical address lists --- diff --git a/src/LibCecSharp/CecSharpTypes.h b/src/LibCecSharp/CecSharpTypes.h index 4995574..f385cda 100644 --- a/src/LibCecSharp/CecSharpTypes.h +++ b/src/LibCecSharp/CecSharpTypes.h @@ -367,12 +367,12 @@ namespace CecSharp void Clear(void) { for (unsigned int iPtr = 0; iPtr < 16; iPtr++) - Addresses[iPtr] = CecLogicalAddress::Unregistered; + Addresses[iPtr] = CecLogicalAddress::Unknown; } bool IsSet(CecLogicalAddress iAddress) { - return Addresses[(unsigned int)iAddress] != CecLogicalAddress::Unregistered; + return Addresses[(unsigned int)iAddress] != CecLogicalAddress::Unknown; } void Set(CecLogicalAddress iAddress) @@ -750,16 +750,14 @@ namespace CecSharp netConfig->ActivateSource = config.bActivateSource == 1; netConfig->WakeDevices->Clear(); - int iDevices(0); for (uint8_t iPtr = 0; iPtr <= 16; iPtr++) if (config.wakeDevices[iPtr]) - netConfig->WakeDevices->Addresses[iDevices++] = (CecLogicalAddress)iPtr; + netConfig->WakeDevices->Set((CecLogicalAddress)iPtr); netConfig->PowerOffDevices->Clear(); - iDevices = 0; for (uint8_t iPtr = 0; iPtr <= 16; iPtr++) if (config.powerOffDevices[iPtr]) - netConfig->PowerOffDevices->Addresses[iDevices++] = (CecLogicalAddress)iPtr; + netConfig->PowerOffDevices->Set((CecLogicalAddress)iPtr); netConfig->PowerOffScreensaver = config.bPowerOffScreensaver == 1; netConfig->PowerOffOnStandby = config.bPowerOffOnStandby == 1; diff --git a/src/LibCecSharp/LibCecSharp.cpp b/src/LibCecSharp/LibCecSharp.cpp index 971dc4d..c02c4ea 100644 --- a/src/LibCecSharp/LibCecSharp.cpp +++ b/src/LibCecSharp/LibCecSharp.cpp @@ -440,16 +440,14 @@ namespace CecSharp configuration->TvVendor = (CecVendorId)config.tvVendor; configuration->WakeDevices->Clear(); - int iDevices(0); for (uint8_t iPtr = 0; iPtr <= 16; iPtr++) if (config.wakeDevices[iPtr]) - configuration->WakeDevices->Addresses[iDevices++] = (CecLogicalAddress)iPtr; + configuration->WakeDevices->Set((CecLogicalAddress)iPtr); configuration->PowerOffDevices->Clear(); - iDevices = 0; for (uint8_t iPtr = 0; iPtr <= 16; iPtr++) if (config.powerOffDevices[iPtr]) - configuration->PowerOffDevices->Addresses[iDevices++] = (CecLogicalAddress)iPtr; + configuration->PowerOffDevices->Set((CecLogicalAddress)iPtr); configuration->UseTVMenuLanguage = config.bUseTVMenuLanguage == 1; for (unsigned int iPtr = 0; iPtr < 5; iPtr++)