| 76 | } |
| 77 | |
| 78 | void ConfigFileManager::saveDataToFile() { |
| 79 | std::unique_ptr<XmlElement> config_xml = std::make_unique<XmlElement>(XML_ATTRIBUTE_ODIN_CONFIG); |
| 80 | |
| 81 | XmlElement *big_gui = new XmlElement(XML_ATTRIBUTE_BIG_GUI); |
| 82 | big_gui->setAttribute("data", m_big_gui); |
| 83 | config_xml->addChildElement(big_gui); |
| 84 | |
| 85 | XmlElement *spline_ad1 = new XmlElement(XML_ATTRIBUTE_SPLINE_AD1); |
| 86 | spline_ad1->setAttribute("data", m_spline_ad_1_seen); |
| 87 | config_xml->addChildElement(spline_ad1); |
| 88 | |
| 89 | XmlElement *spline_ad2 = new XmlElement(XML_ATTRIBUTE_SPLINE_AD2); |
| 90 | spline_ad2->setAttribute("data", m_spline_ad_2_seen); |
| 91 | config_xml->addChildElement(spline_ad2); |
| 92 | |
| 93 | XmlElement *show_tooltip = new XmlElement(XML_ATTRIBUTE_SHOW_TOOLTIP); |
| 94 | show_tooltip->setAttribute("data", m_show_tooltip); |
| 95 | config_xml->addChildElement(show_tooltip); |
| 96 | |
| 97 | XmlElement *tuning_dir = new XmlElement(XML_ATTRIBUTE_TUNING_DIR); |
| 98 | tuning_dir->setAttribute("data", m_tuning_dir); |
| 99 | config_xml->addChildElement(tuning_dir); |
| 100 | |
| 101 | XmlElement *soundbank_dir = new XmlElement(XML_ATTRIBUTE_SOUNDBANK_DIR); |
| 102 | soundbank_dir->setAttribute("data", m_soundbank_dir); |
| 103 | config_xml->addChildElement(soundbank_dir); |
| 104 | |
| 105 | XmlElement *patch_dir = new XmlElement(XML_ATTRIBUTE_PATCH_DIR); |
| 106 | patch_dir->setAttribute("data", m_patch_dir); |
| 107 | config_xml->addChildElement(patch_dir); |
| 108 | |
| 109 | XmlElement *gui_scale = new XmlElement(XML_ATTRIBUTE_GUI_SCALE); |
| 110 | gui_scale->setAttribute("data", std::to_string(m_gui_scale)); |
| 111 | config_xml->addChildElement(gui_scale); |
| 112 | |
| 113 | XmlElement *num_gui_open = new XmlElement(XML_ATTRIBUTE_GUI_OPEN); |
| 114 | num_gui_open->setAttribute("data", std::to_string(m_num_gui_opens)); |
| 115 | config_xml->addChildElement(num_gui_open); |
| 116 | |
| 117 | //DBG_VAR(config_xml->toString()); |
| 118 | |
| 119 | String path_absolute = CONFIG_FILE_PATH; |
| 120 | File configuration_file = File(path_absolute); |
| 121 | |
| 122 | if (config_xml->writeTo(configuration_file)) { |
| 123 | DBG("Wrote configuration Xml to " << path_absolute); |
| 124 | } else { |
| 125 | DBG("Failed to write configuration file!"); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | void ConfigFileManager::setOptionBigGUI(bool p_GUI_big) { |
| 130 | m_big_gui = p_GUI_big; |
no outgoing calls
no test coverage detected