CecLogicalAddresses(void)
{
Addresses = gcnew array<CecLogicalAddress>(16);
+ Clear();
+ }
+
+ void Clear(void)
+ {
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
Addresses[iPtr] = CecLogicalAddress::Unregistered;
}
return Addresses[(unsigned int)iAddress] != CecLogicalAddress::Unregistered;
}
+ void Set(CecLogicalAddress iAddress)
+ {
+ Addresses[(unsigned int)iAddress] = iAddress;
+ }
+
property CecLogicalAddress Primary;
property array<CecLogicalAddress> ^ Addresses;
};
BaseDevice = (CecLogicalAddress)CEC_DEFAULT_BASE_DEVICE;
HDMIPort = CEC_DEFAULT_HDMI_PORT;
ClientVersion = CecClientVersion::VersionPre1_5;
+ TvVendor = CecVendorId::Unknown;
GetSettingsFromROM = false;
UseTVMenuLanguage = CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE == 1;
- PowerOnStartup = CEC_DEFAULT_SETTING_POWER_ON_STARTUP == 1;
- PowerOffShutdown = CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN == 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;
}
Callbacks = callbacks;
}
- property System::String ^ DeviceName;
- property CecDeviceTypeList ^ DeviceTypes;
- property uint16_t PhysicalAddress;
- property CecLogicalAddress BaseDevice;
- property uint8_t HDMIPort;
- property CecClientVersion ClientVersion;
+ property System::String ^ DeviceName;
+ property CecDeviceTypeList ^ DeviceTypes;
+ property uint16_t PhysicalAddress;
+ property CecLogicalAddress BaseDevice;
+ property uint8_t HDMIPort;
+ property CecClientVersion ClientVersion;
+ property CecVendorId TvVendor;
// player specific settings
- property bool GetSettingsFromROM;
- property bool UseTVMenuLanguage;
- property bool PowerOnStartup;
- property bool PowerOffShutdown;
- property bool PowerOffScreensaver;
- property bool PowerOffOnStandby;
-
- property CecCallbackMethods ^Callbacks;
+ property bool GetSettingsFromROM;
+ property bool UseTVMenuLanguage;
+ property bool ActivateSource;
+ property CecLogicalAddresses ^WakeDevices;
+ property CecLogicalAddresses ^PowerOffDevices;
+ property bool PowerOffScreensaver;
+ property bool PowerOffOnStandby;
+
+ property CecCallbackMethods ^ Callbacks;
};
// the callback methods are called by unmanaged code, so we need some delegates for this
netConfig->HDMIPort = config.iHDMIPort;
netConfig->ClientVersion = (CecClientVersion)config.clientVersion;
netConfig->GetSettingsFromROM = config.bGetSettingsFromROM == 1;
- netConfig->PowerOnStartup = config.bPowerOnStartup == 1;
- netConfig->PowerOffShutdown = config.bPowerOffShutdown == 1;
+ 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->PowerOffDevices->Clear();
+ iDevices = 0;
+ for (uint8_t iPtr = 0; iPtr <= 16; iPtr++)
+ if (config.powerOffDevices[iPtr])
+ netConfig->PowerOffDevices->Addresses[iDevices++] = (CecLogicalAddress)iPtr;
+
netConfig->PowerOffScreensaver = config.bPowerOffScreensaver == 1;
netConfig->PowerOffOnStandby = config.bPowerOffOnStandby == 1;
config.iHDMIPort = netConfig->HDMIPort;
config.clientVersion = (cec_client_version)netConfig->ClientVersion;
config.bGetSettingsFromROM = netConfig->GetSettingsFromROM;
- config.bPowerOnStartup = netConfig->PowerOnStartup;
- config.bPowerOffShutdown = netConfig->PowerOffShutdown;
+ config.bActivateSource = netConfig->ActivateSource;
+ config.tvVendor = (cec_vendor_id)netConfig->TvVendor;
+ config.wakeDevices.Clear();
+ for (int iPtr = 0; iPtr < 16; iPtr++)
+ {
+ if (netConfig->WakeDevices->IsSet((CecLogicalAddress)iPtr))
+ config.wakeDevices.Set((cec_logical_address)iPtr);
+ }
+ config.powerOffDevices.Clear();
+ for (int iPtr = 0; iPtr < 16; iPtr++)
+ {
+ if (netConfig->PowerOffDevices->IsSet((CecLogicalAddress)iPtr))
+ config.powerOffDevices.Set((cec_logical_address)iPtr);
+ }
config.bPowerOffScreensaver = netConfig->PowerOffScreensaver;
config.bPowerOffOnStandby = netConfig->PowerOffOnStandby;
config.callbacks = &g_cecCallbacks;
{
// delete the callbacks, since these might already have been destroyed in .NET
m_libCec->EnableCallbacks(NULL, NULL);
+ m_libCec->StandbyDevices();
m_libCec->Close();
}
configuration->PhysicalAddress = config.iPhysicalAddress;
configuration->PowerOffOnStandby = config.bPowerOffOnStandby == 1;
configuration->PowerOffScreensaver = config.bPowerOffScreensaver == 1;
- configuration->PowerOffShutdown = config.bPowerOffShutdown == 1;
- configuration->PowerOnStartup = config.bPowerOnStartup == 1;
+ configuration->ActivateSource = config.bActivateSource == 1;
+ 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->PowerOffDevices->Clear();
+ iDevices = 0;
+ for (uint8_t iPtr = 0; iPtr <= 16; iPtr++)
+ if (config.powerOffDevices[iPtr])
+ configuration->PowerOffDevices->Addresses[iDevices++] = (CecLogicalAddress)iPtr;
+
configuration->UseTVMenuLanguage = config.bUseTVMenuLanguage == 1;
for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
configuration->DeviceTypes->Types[iPtr] = (CecDeviceType)config.deviceTypes.types[iPtr];