+ ref class CecCallbackMethods; //forward
+ public ref class LibCECConfiguration
+ {
+ public:
+ LibCECConfiguration(void)
+ {
+ DeviceName = "";
+ DeviceTypes = gcnew CecDeviceTypeList();
+ AutodetectAddress = true;
+ PhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS;
+ BaseDevice = (CecLogicalAddress)CEC_DEFAULT_BASE_DEVICE;
+ HDMIPort = CEC_DEFAULT_HDMI_PORT;
+ ClientVersion = CecClientVersion::VersionPre1_5;
+ ServerVersion = CecServerVersion::VersionPre1_5;
+ TvVendor = CecVendorId::Unknown;
+
+ GetSettingsFromROM = false;
+ UseTVMenuLanguage = CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE == 1;
+ ActivateSource = CEC_DEFAULT_SETTING_ACTIVATE_SOURCE == 1;
+
+ WakeDevices = gcnew CecLogicalAddresses();
+ if (CEC_DEFAULT_SETTING_ACTIVATE_SOURCE == 1)
+ WakeDevices->Set(CecLogicalAddress::Tv);
+
+ PowerOffDevices = gcnew CecLogicalAddresses();
+ if (CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN == 1)
+ PowerOffDevices->Set(CecLogicalAddress::Broadcast);
+
+ PowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER == 1;
+ PowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY == 1;
+ SendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE == 1;
+ }
+
+ void SetCallbacks(CecCallbackMethods ^callbacks)
+ {
+ Callbacks = callbacks;
+ }
+
+ void Update(const CEC::libcec_configuration &config)
+ {
+ DeviceName = gcnew System::String(config.strDeviceName);
+
+ for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
+ DeviceTypes->Types[iPtr] = (CecDeviceType)config.deviceTypes.types[iPtr];
+
+ AutodetectAddress = config.bAutodetectAddress == 1;
+ PhysicalAddress = config.iPhysicalAddress;
+ BaseDevice = (CecLogicalAddress)config.baseDevice;
+ HDMIPort = config.iHDMIPort;
+ ClientVersion = (CecClientVersion)config.clientVersion;
+ ServerVersion = (CecServerVersion)config.serverVersion;
+ TvVendor = (CecVendorId)config.tvVendor;
+
+ // player specific settings
+ GetSettingsFromROM = config.bGetSettingsFromROM == 1;
+ UseTVMenuLanguage = config.bUseTVMenuLanguage == 1;
+ ActivateSource = config.bActivateSource == 1;
+
+ WakeDevices->Clear();
+ for (uint8_t iPtr = 0; iPtr <= 16; iPtr++)
+ if (config.wakeDevices[iPtr])
+ WakeDevices->Set((CecLogicalAddress)iPtr);
+
+ PowerOffDevices->Clear();
+ for (uint8_t iPtr = 0; iPtr <= 16; iPtr++)
+ if (config.powerOffDevices[iPtr])
+ PowerOffDevices->Set((CecLogicalAddress)iPtr);
+
+ PowerOffScreensaver = config.bPowerOffScreensaver == 1;
+ PowerOffOnStandby = config.bPowerOffOnStandby == 1;
+ SendInactiveSource = config.bSendInactiveSource == 1;
+ }
+
+ property System::String ^ DeviceName;
+ property CecDeviceTypeList ^ DeviceTypes;
+ property bool AutodetectAddress;
+ property uint16_t PhysicalAddress;
+ property CecLogicalAddress BaseDevice;
+ property uint8_t HDMIPort;
+ property CecClientVersion ClientVersion;
+ property CecServerVersion ServerVersion;
+ property CecVendorId TvVendor;
+
+ // player specific settings
+ property bool GetSettingsFromROM;
+ property bool UseTVMenuLanguage;
+ property bool ActivateSource;
+ property CecLogicalAddresses ^WakeDevices;
+ property CecLogicalAddresses ^PowerOffDevices;
+ property bool PowerOffScreensaver;
+ property bool PowerOffOnStandby;
+ property bool SendInactiveSource;
+
+ property CecCallbackMethods ^ Callbacks;
+ };
+