mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-10 18:19:42 -04:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ public:
|
||||
LocalZynAddSubFx();
|
||||
~LocalZynAddSubFx();
|
||||
|
||||
void initConfig();
|
||||
|
||||
void setSampleRate( int _sampleRate );
|
||||
void setBufferSize( int _bufferSize );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user