Added gain for libADLMIDI and for libOPNMIDI

This commit is contained in:
Wohlstand 2025-07-05 15:19:33 +03:00 committed by Rachael Alexanderson
commit 798ceddea6
3 changed files with 34 additions and 1 deletions

View file

@ -90,6 +90,8 @@ EXTERN_CVAR(Float, snd_musicvolume)
EXTERN_CVAR(Int, snd_mididevice)
EXTERN_CVAR(Float, mod_dumb_mastervolume)
EXTERN_CVAR(Float, fluid_gain)
EXTERN_CVAR(Float, adl_gain)
EXTERN_CVAR(Float, opn_gain)
CVAR(Bool, mus_calcgain, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // changing this will only take effect for the next song.

View file

@ -114,6 +114,20 @@ CUSTOM_CVAR(Bool, adl_auto_arpeggio, false, CVAR_ARCHIVE | CVAR_VIRTUAL)
{
FORWARD_BOOL_CVAR(adl_auto_arpeggio);
}
CUSTOM_CVAR(Float, adl_gain, 0.5, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL)
{
if (!mus_usereplaygain)
{
FORWARD_CVAR(adl_gain);
}
else
{
// Replay gain will disable the user setting for consistency.
float newval;
ChangeMusicSetting(zmusic_adl_gain, mus_playing.handle, 1.0f, & newval);
}
}
#endif
//==========================================================================
//
@ -295,6 +309,20 @@ CUSTOM_CVAR(Bool, opn_auto_arpeggio, false, CVAR_ARCHIVE | CVAR_VIRTUAL)
{
FORWARD_BOOL_CVAR(adl_auto_arpeggio);
}
CUSTOM_CVAR(Float, opn_gain, 0.5, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL)
{
if (!mus_usereplaygain)
{
FORWARD_CVAR(opn_gain);
}
else
{
// Replay gain will disable the user setting for consistency.
float newval;
ChangeMusicSetting(zmusic_opn_gain, mus_playing.handle, 1.0f, & newval);
}
}
//==========================================================================
//
// GUS MIDI device

View file

@ -2286,12 +2286,14 @@ OptionMenu ModReplayerOptions protected
4, "$OPTVAL_NP2OPNA"
5, "$OPTVAL_MAMEOPNA"
6, "$OPTVAL_YMFMOPNA"
7, "$OPTVAL_NUKEDOPN2YM2612"
// 7'th is a VGM Dumper, it should NEVER been used during normal runtime
8, "$OPTVAL_NUKEDOPN2YM2612"
}
OptionMenu ADLOptions protected
{
Title "$ADVSNDMNU_ADLMIDI"
Slider "$ADVSNDMNU_FLUIDGAIN", "adl_gain", 0, 10, 0.1, 1
Option "$ADVSNDMNU_OPLCORES", "adl_emulator_id", "ADLOplCores"
Option "$ADVSNDMNU_RUNPCMRATE", "adl_run_at_pcm_rate", "OnOff"
Slider "$ADVSNDMNU_ADLNUMCHIPS", "adl_chips_count", 1, 32, 1, 0
@ -2309,6 +2311,7 @@ OptionMenu ModReplayerOptions protected
OptionMenu OPNOptions protected
{
Title "$ADVSNDMNU_OPNMIDI"
Slider "$ADVSNDMNU_FLUIDGAIN", "opn_gain", 0, 10, 0.1, 1
Option "$ADVSNDMNU_OPNCORES", "opn_emulator_id", "OpnCores"
Option "$ADVSNDMNU_RUNPCMRATE", "opn_run_at_pcm_rate", "OnOff"
Slider "$ADVSNDMNU_OPNNUMCHIPS", "opn_chips_count", 1, 32, 1, 0