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