mirror of
https://github.com/holub/mame
synced 2025-05-30 01:23:07 +03:00
sound: deprecate cfg defvol, and change newvol to value
This commit is contained in:
parent
affef0120b
commit
c516e72e0c
@ -33,13 +33,6 @@
|
|||||||
#define LOG_OUTPUT_WAV (0)
|
#define LOG_OUTPUT_WAV (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
|
||||||
// CONSTANTS
|
|
||||||
//**************************************************************************
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// GLOBAL VARIABLES
|
// GLOBAL VARIABLES
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -47,7 +40,6 @@
|
|||||||
const attotime sound_manager::STREAMS_UPDATE_ATTOTIME = attotime::from_hz(STREAMS_UPDATE_FREQUENCY);
|
const attotime sound_manager::STREAMS_UPDATE_ATTOTIME = attotime::from_hz(STREAMS_UPDATE_FREQUENCY);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// STREAM BUFFER
|
// STREAM BUFFER
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -1390,10 +1382,19 @@ void sound_manager::config_load(config_type cfg_type, config_level cfg_level, ut
|
|||||||
mixer_input info;
|
mixer_input info;
|
||||||
if (indexed_mixer_input(node->get_attribute_int("index", -1), info))
|
if (indexed_mixer_input(node->get_attribute_int("index", -1), info))
|
||||||
{
|
{
|
||||||
|
float value = node->get_attribute_float("value", std::nanf(""));
|
||||||
|
|
||||||
|
if (std::isnan(value))
|
||||||
|
{
|
||||||
|
// TODO: remove defvol and newvol in 2024
|
||||||
float defvol = node->get_attribute_float("defvol", 1.0f);
|
float defvol = node->get_attribute_float("defvol", 1.0f);
|
||||||
float newvol = node->get_attribute_float("newvol", -1000.0f);
|
float newvol = node->get_attribute_float("newvol", -1000.0f);
|
||||||
if (newvol != -1000.0f)
|
if (newvol != -1000.0f && defvol != 0.0f)
|
||||||
info.stream->input(info.inputnum).set_user_gain(newvol / defvol);
|
value = newvol / defvol;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!std::isnan(value))
|
||||||
|
info.stream->input(info.inputnum).set_user_gain(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1442,14 +1443,14 @@ void sound_manager::config_save(config_type cfg_type, util::xml::data_node *pare
|
|||||||
if (!indexed_mixer_input(mixernum, info))
|
if (!indexed_mixer_input(mixernum, info))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
float const newvol = info.stream->input(info.inputnum).user_gain();
|
float const value = info.stream->input(info.inputnum).user_gain();
|
||||||
if (newvol != 1.0f)
|
if (value != 1.0f)
|
||||||
{
|
{
|
||||||
util::xml::data_node *const node = parentnode->add_child("channel", nullptr);
|
util::xml::data_node *const node = parentnode->add_child("channel", nullptr);
|
||||||
if (node)
|
if (node)
|
||||||
{
|
{
|
||||||
node->set_attribute_int("index", mixernum);
|
node->set_attribute_int("index", mixernum);
|
||||||
node->set_attribute_float("newvol", newvol);
|
node->set_attribute_float("value", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1457,7 +1458,7 @@ void sound_manager::config_save(config_type cfg_type, util::xml::data_node *pare
|
|||||||
// iterate over speakers for panning
|
// iterate over speakers for panning
|
||||||
for (speaker_device &speaker : speaker_device_enumerator(machine().root_device()))
|
for (speaker_device &speaker : speaker_device_enumerator(machine().root_device()))
|
||||||
{
|
{
|
||||||
float value = speaker.pan();
|
float const value = speaker.pan();
|
||||||
if (value != speaker.defpan())
|
if (value != speaker.defpan())
|
||||||
{
|
{
|
||||||
util::xml::data_node *const node = parentnode->add_child("panning", nullptr);
|
util::xml::data_node *const node = parentnode->add_child("panning", nullptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user