Merge branch 'volume-speed' into TemporaryHackishBranch

# Conflicts:
#	Core/Config.cpp
#	Core/Config.h
This commit is contained in:
LunaMoo committed 2019-06-23 23:55:13 +02:00
commit 3754333508
4 files changed
+18 -3

No files matched your search

+1
View File
@@ -795,6 +795,7 @@ static ConfigSetting soundSettings[] = {
ConfigSetting("GlobalVolume", &g_Config.iGlobalVolume, VOLUME_MAX, true, true),
ConfigSetting("SASVolume", &g_Config.iSASVolume, 8, true, true),
ConfigSetting("ATRACMP3Volume", &g_Config.iATRACMP3Volume, 8, true, true),
ConfigSetting("AltSpeedVolume", &g_Config.iAltSpeedVolume, -1, true, true),
ConfigSetting(false),
};
+1
View File
@@ -212,6 +212,7 @@ public:
int iAudioLatency; // 0 = low , 1 = medium(default) , 2 = high
int iAudioBackend;
int iGlobalVolume, iSASVolume, iATRACMP3Volume;
int iAltSpeedVolume;
bool bExtraAudioBuffering; // For bluetooth
// UI
+10 -3
View File
@@ -137,12 +137,19 @@ inline void ClampBufferToS16(s16 *out, const s32 *in, size_t size, s8 volShift)
}
inline void ClampBufferToS16WithVolume(s16 *out, const s32 *in, size_t size) {
if (g_Config.iGlobalVolume >= VOLUME_MAX) {
int volume = g_Config.iGlobalVolume;
if (PSP_CoreParameter().fpsLimit != FPSLimit::NORMAL || PSP_CoreParameter().unthrottle) {
if (g_Config.iAltSpeedVolume != -1) {
volume = g_Config.iAltSpeedVolume;
}
}
if (volume >= VOLUME_MAX) {
ClampBufferToS16<false>(out, in, size, 0);
} else if (g_Config.iGlobalVolume <= VOLUME_OFF) {
} else if (volume <= VOLUME_OFF) {
memset(out, 0, size * sizeof(s16));
} else {
ClampBufferToS16<true>(out, in, size, VOLUME_MAX - (s8)g_Config.iGlobalVolume);
ClampBufferToS16<true>(out, in, size, VOLUME_MAX - (s8)volume);
}
}
+6
View File
@@ -514,6 +514,12 @@ void GameSettingsScreen::CreateViews() {
PopupSliderChoice *volume = audioSettings->Add(new PopupSliderChoice(&g_Config.iGlobalVolume, VOLUME_OFF, VOLUME_MAX, a->T("Global volume"), screenManager()));
volume->SetEnabledPtr(&g_Config.bEnableSound);
volume->SetZeroLabel(a->T("Mute"));
PopupSliderChoice *altVolume = audioSettings->Add(new PopupSliderChoice(&g_Config.iAltSpeedVolume, VOLUME_OFF, VOLUME_MAX, a->T("Alternate speed volume"), screenManager()));
altVolume->SetEnabledPtr(&g_Config.bEnableSound);
altVolume->SetZeroLabel(a->T("Mute"));
altVolume->SetNegativeDisable(a->T("Use global volume"));
if (!g_Config.bSimpleUI) {
#ifdef _WIN32