mirror of https://github.com/PCSX2/pcsx2.git
spu2x: linux port of Giga lastest update
=> Advanced (per-channel) Volume Adjustment AKA Room Correction windows: update CfgReadFloat to really return a float
This commit is contained in:
parent
f2e50d4ffd
commit
2084ead56c
|
@ -52,6 +52,12 @@ void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value)
|
||||||
spuConfig->Write(Name, Value);
|
spuConfig->Write(Name, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CfgWriteFloat(const wchar_t* Section, const wchar_t* Name, float Value)
|
||||||
|
{
|
||||||
|
setIni(Section);
|
||||||
|
spuConfig->Write(Name, (double)Value);
|
||||||
|
}
|
||||||
|
|
||||||
void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wxString& Data)
|
void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wxString& Data)
|
||||||
{
|
{
|
||||||
setIni(Section);
|
setIni(Section);
|
||||||
|
@ -78,6 +84,16 @@ int CfgReadInt(const wchar_t* Section, const wchar_t* Name,int Default)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CfgReadFloat(const wchar_t* Section, const wchar_t* Name, float Default)
|
||||||
|
{
|
||||||
|
double ret;
|
||||||
|
|
||||||
|
setIni(Section);
|
||||||
|
spuConfig->Read(Name, &ret, (double)Default);
|
||||||
|
|
||||||
|
return (float)ret;
|
||||||
|
}
|
||||||
|
|
||||||
void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default)
|
void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default)
|
||||||
{
|
{
|
||||||
setIni(Section);
|
setIni(Section);
|
||||||
|
|
|
@ -42,7 +42,25 @@ int Interpolation = 4;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool EffectsDisabled = false;
|
bool EffectsDisabled = false;
|
||||||
float FinalVolume;
|
float FinalVolume; // global
|
||||||
|
bool AdvancedVolumeControl;
|
||||||
|
float VolumeAdjustFLdb; // decibels settings, cos audiophiles love that
|
||||||
|
float VolumeAdjustCdb;
|
||||||
|
float VolumeAdjustFRdb;
|
||||||
|
float VolumeAdjustBLdb;
|
||||||
|
float VolumeAdjustBRdb;
|
||||||
|
float VolumeAdjustSLdb;
|
||||||
|
float VolumeAdjustSRdb;
|
||||||
|
float VolumeAdjustLFEdb;
|
||||||
|
float VolumeAdjustFL; // linear coefs calcualted from decibels,
|
||||||
|
float VolumeAdjustC;
|
||||||
|
float VolumeAdjustFR;
|
||||||
|
float VolumeAdjustBL;
|
||||||
|
float VolumeAdjustBR;
|
||||||
|
float VolumeAdjustSL;
|
||||||
|
float VolumeAdjustSR;
|
||||||
|
float VolumeAdjustLFE;
|
||||||
|
|
||||||
bool postprocess_filter_enabled = true;
|
bool postprocess_filter_enabled = true;
|
||||||
bool postprocess_filter_dealias = false;
|
bool postprocess_filter_dealias = false;
|
||||||
bool _visual_debug_enabled = false; // windows only feature
|
bool _visual_debug_enabled = false; // windows only feature
|
||||||
|
@ -71,7 +89,26 @@ void ReadSettings()
|
||||||
EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false );
|
EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false );
|
||||||
postprocess_filter_dealias = CfgReadBool( L"MIXING", L"DealiasFilter", false );
|
postprocess_filter_dealias = CfgReadBool( L"MIXING", L"DealiasFilter", false );
|
||||||
FinalVolume = ((float)CfgReadInt( L"MIXING", L"FinalVolume", 100 )) / 100;
|
FinalVolume = ((float)CfgReadInt( L"MIXING", L"FinalVolume", 100 )) / 100;
|
||||||
if ( FinalVolume > 1.0f) FinalVolume = 1.0f;
|
if ( FinalVolume > 1.0f) FinalVolume = 1.0f;
|
||||||
|
|
||||||
|
AdvancedVolumeControl = CfgReadBool(L"MIXING", L"AdvancedVolumeControl", false);
|
||||||
|
VolumeAdjustCdb = CfgReadFloat(L"MIXING", L"VolumeAdjustC(dB)", 0);
|
||||||
|
VolumeAdjustFLdb = CfgReadFloat(L"MIXING", L"VolumeAdjustFL(dB)", 0);
|
||||||
|
VolumeAdjustFRdb = CfgReadFloat(L"MIXING", L"VolumeAdjustFR(dB)", 0);
|
||||||
|
VolumeAdjustBLdb = CfgReadFloat(L"MIXING", L"VolumeAdjustBL(dB)", 0);
|
||||||
|
VolumeAdjustBRdb = CfgReadFloat(L"MIXING", L"VolumeAdjustBR(dB)", 0);
|
||||||
|
VolumeAdjustSLdb = CfgReadFloat(L"MIXING", L"VolumeAdjustSL(dB)", 0);
|
||||||
|
VolumeAdjustSRdb = CfgReadFloat(L"MIXING", L"VolumeAdjustSR(dB)", 0);
|
||||||
|
VolumeAdjustLFEdb = CfgReadFloat(L"MIXING", L"VolumeAdjustLFE(dB)", 0);
|
||||||
|
VolumeAdjustC = powf(10, VolumeAdjustCdb / 10);
|
||||||
|
VolumeAdjustFL = powf(10, VolumeAdjustFLdb / 10);
|
||||||
|
VolumeAdjustFR = powf(10, VolumeAdjustFRdb / 10);
|
||||||
|
VolumeAdjustBL = powf(10, VolumeAdjustBLdb / 10);
|
||||||
|
VolumeAdjustBR = powf(10, VolumeAdjustBRdb / 10);
|
||||||
|
VolumeAdjustSL = powf(10, VolumeAdjustSLdb / 10);
|
||||||
|
VolumeAdjustSR = powf(10, VolumeAdjustSRdb / 10);
|
||||||
|
VolumeAdjustLFE = powf(10, VolumeAdjustLFEdb / 10);
|
||||||
|
|
||||||
|
|
||||||
wxString temp;
|
wxString temp;
|
||||||
CfgReadStr( L"OUTPUT", L"Output_Module", temp, PortaudioOut->GetIdent() );
|
CfgReadStr( L"OUTPUT", L"Output_Module", temp, PortaudioOut->GetIdent() );
|
||||||
|
@ -109,12 +146,22 @@ void WriteSettings()
|
||||||
FileLog("Write called without the path set.\n");
|
FileLog("Write called without the path set.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CfgWriteInt(L"MIXING",L"Interpolation",Interpolation);
|
CfgWriteInt(L"MIXING",L"Interpolation",Interpolation);
|
||||||
CfgWriteBool(L"MIXING",L"Disable_Effects",EffectsDisabled);
|
CfgWriteBool(L"MIXING",L"Disable_Effects",EffectsDisabled);
|
||||||
CfgWriteBool(L"MIXING",L"DealiasFilter",postprocess_filter_dealias);
|
CfgWriteBool(L"MIXING",L"DealiasFilter",postprocess_filter_dealias);
|
||||||
CfgWriteInt(L"MIXING",L"FinalVolume",(int)(FinalVolume * 100 +0.5f));
|
CfgWriteInt(L"MIXING",L"FinalVolume",(int)(FinalVolume * 100 +0.5f));
|
||||||
|
|
||||||
|
CfgWriteBool(L"MIXING", L"AdvancedVolumeControl", AdvancedVolumeControl);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustC(dB)", VolumeAdjustCdb);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustFL(dB)", VolumeAdjustFLdb);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustFR(dB)", VolumeAdjustFRdb);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustBL(dB)", VolumeAdjustBLdb);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustBR(dB)", VolumeAdjustBRdb);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustSL(dB)", VolumeAdjustSLdb);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustSR(dB)", VolumeAdjustSRdb);
|
||||||
|
CfgWriteFloat(L"MIXING", L"VolumeAdjustLFE(dB)", VolumeAdjustLFEdb);
|
||||||
|
|
||||||
CfgWriteStr(L"OUTPUT",L"Output_Module", mods[OutputModule]->GetIdent() );
|
CfgWriteStr(L"OUTPUT",L"Output_Module", mods[OutputModule]->GetIdent() );
|
||||||
CfgWriteInt(L"OUTPUT",L"Latency", SndOutLatencyMS);
|
CfgWriteInt(L"OUTPUT",L"Latency", SndOutLatencyMS);
|
||||||
CfgWriteInt(L"OUTPUT",L"Synch_Mode", SynchMode);
|
CfgWriteInt(L"OUTPUT",L"Synch_Mode", SynchMode);
|
||||||
|
|
|
@ -33,11 +33,13 @@ extern void CfgSetLogDir(const char* dir);
|
||||||
|
|
||||||
extern void CfgWriteBool(const wchar_t* Section, const wchar_t* Name, bool Value);
|
extern void CfgWriteBool(const wchar_t* Section, const wchar_t* Name, bool Value);
|
||||||
extern void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value);
|
extern void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value);
|
||||||
|
extern void CfgWriteFloat(const wchar_t* Section, const wchar_t* Name, float Value);
|
||||||
extern void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wxString& Data);
|
extern void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wxString& Data);
|
||||||
|
|
||||||
extern bool CfgReadBool(const wchar_t *Section,const wchar_t* Name, bool Default);
|
extern bool CfgReadBool(const wchar_t *Section,const wchar_t* Name, bool Default);
|
||||||
extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wxString& Data, const wchar_t* Default);
|
extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wxString& Data, const wchar_t* Default);
|
||||||
//extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default);
|
//extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default);
|
||||||
extern int CfgReadInt(const wchar_t* Section, const wchar_t* Name,int Default);
|
extern int CfgReadInt(const wchar_t* Section, const wchar_t* Name,int Default) ;
|
||||||
|
extern float CfgReadFloat(const wchar_t* Section, const wchar_t* Name, float Default);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -140,7 +140,7 @@ int CfgReadInt(const TCHAR* Section, const TCHAR* Name,int Default)
|
||||||
return _wtoi(Data);
|
return _wtoi(Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CfgReadFloat(const TCHAR* Section, const TCHAR* Name, float Default)
|
float CfgReadFloat(const TCHAR* Section, const TCHAR* Name, float Default)
|
||||||
{
|
{
|
||||||
TCHAR Data[255] = { 0 };
|
TCHAR Data[255] = { 0 };
|
||||||
GetPrivateProfileString(Section, Name, L"", Data, 255, CfgFile);
|
GetPrivateProfileString(Section, Name, L"", Data, 255, CfgFile);
|
||||||
|
|
|
@ -61,7 +61,7 @@ extern bool CfgReadBool(const TCHAR *Section,const TCHAR* Name, bool Default);
|
||||||
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, wxString& Data, const TCHAR* Default);
|
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, wxString& Data, const TCHAR* Default);
|
||||||
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, TCHAR* Data, int DataSize, const TCHAR* Default);
|
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, TCHAR* Data, int DataSize, const TCHAR* Default);
|
||||||
extern int CfgReadInt(const TCHAR* Section, const TCHAR* Name, int Default);
|
extern int CfgReadInt(const TCHAR* Section, const TCHAR* Name, int Default);
|
||||||
extern int CfgReadFloat(const TCHAR* Section, const TCHAR* Name, float Default);
|
extern float CfgReadFloat(const TCHAR* Section, const TCHAR* Name, float Default);
|
||||||
|
|
||||||
// Items Specific to DirectSound
|
// Items Specific to DirectSound
|
||||||
#define STRFY(x) #x
|
#define STRFY(x) #x
|
||||||
|
|
Loading…
Reference in New Issue