+ g_parser->GetCurrentConfiguration(&g_config);
+
+ {
+ cec_menu_language lang;
+ if (g_parser->GetDeviceMenuLanguage(CECDEVICE_TV, &lang))
+ {
+ PrintToStdOut("TV menu language: %s", lang.language);
+ PrintToStdOut("Do you want the application to use the menu language of the TV (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ g_config.bUseTVMenuLanguage = (input == "y" || input == "Y") ? 1 : 0;
+ }
+ else
+ {
+ PrintToStdOut("The TV did not respond properly to the menu language request.");
+ }
+ }
+
+ {
+ PrintToStdOut("Do you want to make the CEC adapter the active source when starting the application (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ g_config.bActivateSource = (input == "y" || input == "Y") ? 1 : 0;
+ }
+
+ {
+ PrintToStdOut("Do you want to power on the TV when starting the application (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ if (input == "y" || input == "Y")
+ g_config.wakeDevices.Set(CECDEVICE_TV);
+ }
+
+ {
+ PrintToStdOut("Do you want to power off CEC devices when closing the application (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ if (input == "y" || input == "Y")
+ g_config.powerOffDevices.Set(CECDEVICE_TV);
+ }
+
+ {
+ PrintToStdOut("Do you want to power off CEC devices when the screensaver is activated (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ g_config.bPowerOffScreensaver = (input == "y" || input == "Y") ? 1 : 0;
+ }
+
+ {
+ PrintToStdOut("Do you want to put the PC in standby when the TV is put in standby mode (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ g_config.bPowerOffOnStandby = (input == "y" || input == "Y") ? 1 : 0;
+ }
+
+ {
+ PrintToStdOut("Do you want to send an inactive source message when stopping the application (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ g_config.bSendInactiveSource = (input == "y" || input == "Y") ? 1 : 0;
+ }
+
+ PrintToStdOut("\n\n=== USB-CEC Adapter Configuration Summary ===");
+ PrintToStdOut("HDMI port number: %d", g_config.iHDMIPort);
+ PrintToStdOut("Connected to HDMI device: %X", (uint8_t)g_config.baseDevice);
+ PrintToStdOut("Physical address: %4X", g_config.iPhysicalAddress);
+ PrintToStdOut("Use the TV's language setting: %s", g_config.bUseTVMenuLanguage ? "yes" : "no");
+ PrintToStdOut("Make the adapter the active source when starting XBMC: %s", g_config.bActivateSource ? "yes" : "no");
+ PrintToStdOut("Power on the TV when starting XBMC: %s", g_config.wakeDevices.IsSet(CECDEVICE_BROADCAST) ? "yes" : "no");
+ PrintToStdOut("Power off devices when stopping XBMC: %s", g_config.powerOffDevices.IsSet(CECDEVICE_BROADCAST) ? "yes" : "no");
+ PrintToStdOut("Put devices in standby mode when activating screensaver: %s", g_config.bPowerOffScreensaver ? "yes" : "no");
+ PrintToStdOut("Put this PC in standby mode when the TV is switched off: %s", g_config.bPowerOffOnStandby ? "yes" : "no");
+ PrintToStdOut("Send an inactive source message when stopping XBMC: %s\n\n", g_config.bSendInactiveSource ? "yes" : "no");
+
+ PrintToStdOut("Storing settings ...");
+ if (g_parser->PersistConfiguration(&g_config))
+ PrintToStdOut("Settings stored.");
+ else
+ PrintToStdOut("The settings could not be stored");