Esempio n. 1
0
        //-------------------------------------------------
        //  config_load - read and apply data from the
        //  configuration file
        //-------------------------------------------------
        void config_load(config_type cfg_type, util.xml.data_node parentnode)
        {
            // we only care about game files
            if (cfg_type != config_type.GAME)
            {
                return;
            }

            // might not have any data
            if (parentnode == null)
            {
                return;
            }

            throw new emu_unimplemented();
#if false
            // iterate over channel nodes
            for (xml_data_node channelnode = xml_get_sibling(parentnode.child, "channel"); channelnode != null; channelnode = xml_get_sibling(channelnode->next, "channel"))
            {
                mixer_input info;
                if (indexed_mixer_input(xml_get_attribute_int(channelnode, "index", -1), info))
                {
                    float defvol = xml_get_attribute_float(channelnode, "defvol", 1.0f);
                    float newvol = xml_get_attribute_float(channelnode, "newvol", -1000.0f);
                    if (newvol != -1000.0f)
                    {
                        info.stream.set_user_gain(info.inputnum, newvol / defvol);
                    }
                }
            }
#endif
        }
Esempio n. 2
0
        //-------------------------------------------------
        //  config_save - save data to the configuration
        //  file
        //-------------------------------------------------
        void config_save(config_type cfg_type, util.xml.data_node parentnode)
        {
            // we only care about game files
            if (cfg_type != config_type.GAME)
            {
                return;
            }

            // iterate over mixer channels
            if (parentnode != null)
            {
                throw new emu_unimplemented();
#if false
                for (int mixernum = 0; ; mixernum++)
                {
                    mixer_input info;
                    if (!indexed_mixer_input(mixernum, info))
                    {
                        break;
                    }

                    float newvol = info.stream.user_gain(info.inputnum);

                    if (newvol != 1.0f)
                    {
                        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, "newvol", newvol);
                        }
                    }
                }
#endif
            }
        }