mirror of
https://github.com/holub/mame
synced 2025-06-07 21:33:45 +03:00
sound: save cfg master volume when non-default
This commit is contained in:
parent
c67bcb4b55
commit
d1cefdfed0
@ -1383,6 +1383,10 @@ void sound_manager::config_load(config_type cfg_type, config_level cfg_level, ut
|
|||||||
if ((cfg_type != config_type::SYSTEM) || !parentnode)
|
if ((cfg_type != config_type::SYSTEM) || !parentnode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// master volume attenuation
|
||||||
|
if (util::xml::data_node const *node = parentnode->get_child("attenuation"))
|
||||||
|
set_attenuation(std::clamp(int(node->get_attribute_int("value", 0)), -32, 0));
|
||||||
|
|
||||||
// iterate over channel nodes
|
// iterate over channel nodes
|
||||||
for (util::xml::data_node const *channelnode = parentnode->get_child("channel"); channelnode != nullptr; channelnode = channelnode->get_next_sibling("channel"))
|
for (util::xml::data_node const *channelnode = parentnode->get_child("channel"); channelnode != nullptr; channelnode = channelnode->get_next_sibling("channel"))
|
||||||
{
|
{
|
||||||
@ -1409,6 +1413,13 @@ void sound_manager::config_save(config_type cfg_type, util::xml::data_node *pare
|
|||||||
if (cfg_type != config_type::SYSTEM)
|
if (cfg_type != config_type::SYSTEM)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// master volume attenuation
|
||||||
|
if (m_attenuation != machine().options().volume())
|
||||||
|
{
|
||||||
|
if (util::xml::data_node *const node = parentnode->add_child("attenuation", nullptr))
|
||||||
|
node->set_attribute_int("value", m_attenuation);
|
||||||
|
}
|
||||||
|
|
||||||
// iterate over mixer channels
|
// iterate over mixer channels
|
||||||
for (int mixernum = 0; ; mixernum++)
|
for (int mixernum = 0; ; mixernum++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user