static void sound_save(int config_type, xml_data_node *parentnode) { int mixernum; /* we only care about game files */ if (config_type != CONFIG_TYPE_GAME) return; /* iterate over mixer channels */ if (parentnode != NULL) for (mixernum = 0; mixernum < MAX_MIXER_CHANNELS; mixernum++) { float defvol = sound_get_default_gain(mixernum); float newvol = sound_get_user_gain(mixernum); if (defvol != newvol) { xml_data_node *channelnode = xml_add_child(parentnode, "channel", NULL); if (channelnode != NULL) { xml_set_attribute_int(channelnode, "index", mixernum); xml_set_attribute_float(channelnode, "defvol", defvol); xml_set_attribute_float(channelnode, "newvol", newvol); } } } }
void laserdisc_device::config_save(config_type cfg_type, xml_data_node *parentnode) { // we only care about game files if (cfg_type != config_type::CONFIG_TYPE_GAME) return; // create a node xml_data_node *ldnode = xml_add_child(parentnode, "device", nullptr); if (ldnode != nullptr) { // output the basics xml_set_attribute(ldnode, "tag", tag().c_str()); // add an overlay node xml_data_node *overnode = xml_add_child(ldnode, "overlay", nullptr); bool changed = false; if (overnode != nullptr) { // output the positioning controls if (m_overposx != m_orig_config.m_overposx) { xml_set_attribute_float(overnode, "hoffset", m_overposx); changed = true; } if (m_overscalex != m_orig_config.m_overscalex) { xml_set_attribute_float(overnode, "hstretch", m_overscalex); changed = true; } if (m_overposy != m_orig_config.m_overposy) { xml_set_attribute_float(overnode, "voffset", m_overposy); changed = true; } if (m_overscaley != m_orig_config.m_overscaley) { xml_set_attribute_float(overnode, "vstretch", m_overscaley); changed = true; } } // if nothing changed, kill the node if (!changed) xml_delete_node(ldnode); } }