@ -104,6 +104,68 @@ bool CPerformanceConfig::Load (void)
return bResult ;
return bResult ;
}
}
bool CPerformanceConfig : : Save ( void )
{
m_Properties . RemoveAll ( ) ;
for ( unsigned nTG = 0 ; nTG < CConfig : : ToneGenerators ; nTG + + )
{
CString PropertyName ;
PropertyName . Format ( " BankNumber%u " , nTG + 1 ) ;
m_Properties . SetNumber ( PropertyName , m_nBankNumber [ nTG ] ) ;
PropertyName . Format ( " VoiceNumber%u " , nTG + 1 ) ;
m_Properties . SetNumber ( PropertyName , m_nVoiceNumber [ nTG ] + 1 ) ;
PropertyName . Format ( " MIDIChannel%u " , nTG + 1 ) ;
unsigned nMIDIChannel = m_nMIDIChannel [ nTG ] ;
if ( nMIDIChannel < CMIDIDevice : : Channels )
{
nMIDIChannel + + ;
}
else if ( nMIDIChannel = = CMIDIDevice : : OmniMode )
{
nMIDIChannel = 255 ;
}
else
{
nMIDIChannel = 0 ;
}
m_Properties . SetNumber ( PropertyName , nMIDIChannel ) ;
PropertyName . Format ( " Volume%u " , nTG + 1 ) ;
m_Properties . SetNumber ( PropertyName , m_nVolume [ nTG ] ) ;
PropertyName . Format ( " Pan%u " , nTG + 1 ) ;
m_Properties . SetNumber ( PropertyName , m_nPan [ nTG ] ) ;
PropertyName . Format ( " Detune%u " , nTG + 1 ) ;
m_Properties . SetSignedNumber ( PropertyName , m_nDetune [ nTG ] ) ;
PropertyName . Format ( " NoteLimitLow%u " , nTG + 1 ) ;
m_Properties . SetNumber ( PropertyName , m_nNoteLimitLow [ nTG ] ) ;
PropertyName . Format ( " NoteLimitHigh%u " , nTG + 1 ) ;
m_Properties . SetNumber ( PropertyName , m_nNoteLimitHigh [ nTG ] ) ;
PropertyName . Format ( " NoteShift%u " , nTG + 1 ) ;
m_Properties . SetSignedNumber ( PropertyName , m_nNoteShift [ nTG ] ) ;
}
m_Properties . SetNumber ( " CompressorEnable " , m_bCompressorEnable ? 1 : 0 ) ;
m_Properties . SetNumber ( " ReverbEnable " , m_bReverbEnable ? 1 : 0 ) ;
m_Properties . SetNumber ( " ReverbSize " , m_nReverbSize ) ;
m_Properties . SetNumber ( " ReverbHighDamp " , m_nReverbHighDamp ) ;
m_Properties . SetNumber ( " ReverbLowDamp " , m_nReverbLowDamp ) ;
m_Properties . SetNumber ( " ReverbLowPass " , m_nReverbLowPass ) ;
m_Properties . SetNumber ( " ReverbDiffusion " , m_nReverbDiffusion ) ;
m_Properties . SetNumber ( " ReverbSend " , m_nReverbSend ) ;
return m_Properties . Save ( ) ;
}
unsigned CPerformanceConfig : : GetBankNumber ( unsigned nTG ) const
unsigned CPerformanceConfig : : GetBankNumber ( unsigned nTG ) const
{
{
assert ( nTG < CConfig : : ToneGenerators ) ;
assert ( nTG < CConfig : : ToneGenerators ) ;
@ -158,6 +220,60 @@ int CPerformanceConfig::GetNoteShift (unsigned nTG) const
return m_nNoteShift [ nTG ] ;
return m_nNoteShift [ nTG ] ;
}
}
void CPerformanceConfig : : SetBankNumber ( unsigned nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nBankNumber [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetVoiceNumber ( unsigned nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nVoiceNumber [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetMIDIChannel ( unsigned nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nMIDIChannel [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetVolume ( unsigned nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nVolume [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetPan ( unsigned nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nPan [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetDetune ( int nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nDetune [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetNoteLimitLow ( unsigned nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nNoteLimitLow [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetNoteLimitHigh ( unsigned nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nNoteLimitHigh [ nTG ] = nValue ;
}
void CPerformanceConfig : : SetNoteShift ( int nValue , unsigned nTG )
{
assert ( nTG < CConfig : : ToneGenerators ) ;
m_nNoteShift [ nTG ] = nValue ;
}
bool CPerformanceConfig : : GetCompressorEnable ( void ) const
bool CPerformanceConfig : : GetCompressorEnable ( void ) const
{
{
return m_bCompressorEnable ;
return m_bCompressorEnable ;
@ -197,3 +313,43 @@ unsigned CPerformanceConfig::GetReverbSend (void) const
{
{
return m_nReverbSend ;
return m_nReverbSend ;
}
}
void CPerformanceConfig : : SetCompressorEnable ( bool bValue )
{
m_bCompressorEnable = bValue ;
}
void CPerformanceConfig : : SetReverbEnable ( bool bValue )
{
m_bReverbEnable = bValue ;
}
void CPerformanceConfig : : SetReverbSize ( unsigned nValue )
{
m_nReverbSize = nValue ;
}
void CPerformanceConfig : : SetReverbHighDamp ( unsigned nValue )
{
m_nReverbHighDamp = nValue ;
}
void CPerformanceConfig : : SetReverbLowDamp ( unsigned nValue )
{
m_nReverbLowDamp = nValue ;
}
void CPerformanceConfig : : SetReverbLowPass ( unsigned nValue )
{
m_nReverbLowPass = nValue ;
}
void CPerformanceConfig : : SetReverbDiffusion ( unsigned nValue )
{
m_nReverbDiffusion = nValue ;
}
void CPerformanceConfig : : SetReverbSend ( unsigned nValue )
{
m_nReverbSend = nValue ;
}