initialize method
Initialise the library.
Implementation
void initialize({
final LogLevel? logLevel,
final LoggingBackend? loggingBackend,
final String? libsndfilePath,
}) {
final config = calloc<syz_LibraryConfig>();
synthizer.syz_libraryConfigSetDefaults(config);
if (logLevel != null) {
config.ref.log_level = logLevel.toInt();
}
if (loggingBackend != null) {
config.ref.logging_backend = loggingBackend.toInt();
}
Pointer<Char>? libSndFilePointer;
if (libsndfilePath != null) {
libSndFilePointer = libsndfilePath.toNativeUtf8().cast<Char>();
config.ref.libsndfile_path = libSndFilePointer;
}
check(synthizer.syz_initializeWithConfig(config));
if (libSndFilePointer != null) {
malloc.free(libSndFilePointer);
}
calloc.free(config);
_wasInit = true;
}