ZynAddSubFX: completely reinitialize config after changing working dir

Custom changes made to the config after first initialization got lost
after setting work directory. Therefore moved custom initialization into
a separate function which is called after setting work directory.
This commit is contained in:
Tobias Doerffel
2010-07-25 20:42:26 +02:00
parent 79abf9ca85
commit c6640ffd37
2 changed files with 16 additions and 4 deletions

View File

@@ -49,10 +49,9 @@ LocalZynAddSubFx::LocalZynAddSubFx()
pthread_win32_thread_attach_np();
#endif
config.init();
OSCIL_SIZE = config.cfg.OscilSize;
initConfig();
config.cfg.GzipCompression = 0;
OSCIL_SIZE = config.cfg.OscilSize;
srand( time( NULL ) );
denormalkillbuf = new REALTYPE[SOUND_BUFFER_SIZE];
@@ -83,6 +82,16 @@ LocalZynAddSubFx::~LocalZynAddSubFx()
void LocalZynAddSubFx::initConfig()
{
config.init();
config.cfg.GzipCompression = 0;
}
void LocalZynAddSubFx::setSampleRate( int _sampleRate )
{
SAMPLE_RATE = _sampleRate;
@@ -173,7 +182,8 @@ void LocalZynAddSubFx::setLmmsWorkingDir( const std::string & _dir )
free( config.workingDir );
}
config.workingDir = strdup( _dir.c_str() );
config.init();
initConfig();
}

View File

@@ -35,6 +35,8 @@ public:
LocalZynAddSubFx();
~LocalZynAddSubFx();
void initConfig();
void setSampleRate( int _sampleRate );
void setBufferSize( int _bufferSize );