| @@ -1215,32 +1215,6 @@ class CarlaHostMeta(object): | |||||
| self.pathBinaries = "" | self.pathBinaries = "" | ||||
| self.pathResources = "" | self.pathResources = "" | ||||
| # use _putenv on windows | |||||
| if not WINDOWS: | |||||
| self.msvcrt = None | |||||
| return | |||||
| self.msvcrt = cdll.msvcrt | |||||
| self.msvcrt._putenv.argtypes = [c_char_p] | |||||
| self.msvcrt._putenv.restype = None | |||||
| # set environment variable | |||||
| def setenv(self, key, value): | |||||
| environ[key] = value | |||||
| if WINDOWS: | |||||
| keyvalue = "%s=%s" % (key, value) | |||||
| self.msvcrt._putenv(keyvalue.encode("utf-8")) | |||||
| # unset environment variable | |||||
| def unsetenv(self, key): | |||||
| if environ.get(key) is not None: | |||||
| environ.pop(key) | |||||
| if WINDOWS: | |||||
| keyrm = "%s=" % key | |||||
| self.msvcrt._putenv(keyrm.encode("utf-8")) | |||||
| # Get how many engine drivers are available. | # Get how many engine drivers are available. | ||||
| @abstractmethod | @abstractmethod | ||||
| def get_engine_driver_count(self): | def get_engine_driver_count(self): | ||||
| @@ -1038,9 +1038,9 @@ class PluginRefreshW(QDialog): | |||||
| self.ui.group_options.setEnabled(False) | self.ui.group_options.setEnabled(False) | ||||
| if self.ui.ch_do_checks.isChecked(): | if self.ui.ch_do_checks.isChecked(): | ||||
| self.host.unsetenv("CARLA_DISCOVERY_NO_PROCESSING_CHECKS") | |||||
| gCarla.utils.unsetenv("CARLA_DISCOVERY_NO_PROCESSING_CHECKS") | |||||
| else: | else: | ||||
| self.host.setenv("CARLA_DISCOVERY_NO_PROCESSING_CHECKS", "true") | |||||
| gCarla.utils.setenv("CARLA_DISCOVERY_NO_PROCESSING_CHECKS", "true") | |||||
| native, posix32, posix64, win32, win64 = (self.ui.ch_native.isChecked(), | native, posix32, posix64, win32, win64 = (self.ui.ch_native.isChecked(), | ||||
| self.ui.ch_posix32.isChecked(), self.ui.ch_posix64.isChecked(), | self.ui.ch_posix32.isChecked(), self.ui.ch_posix64.isChecked(), | ||||
| @@ -214,6 +214,34 @@ class CarlaUtils(object): | |||||
| self.lib.carla_pipe_client_destroy.argtypes = [CarlaPipeClientHandle] | self.lib.carla_pipe_client_destroy.argtypes = [CarlaPipeClientHandle] | ||||
| self.lib.carla_pipe_client_destroy.restype = None | self.lib.carla_pipe_client_destroy.restype = None | ||||
| # use _putenv on windows | |||||
| if not WINDOWS: | |||||
| self.msvcrt = None | |||||
| return | |||||
| self.msvcrt = cdll.msvcrt | |||||
| self.msvcrt._putenv.argtypes = [c_char_p] | |||||
| self.msvcrt._putenv.restype = None | |||||
| # -------------------------------------------------------------------------------------------------------- | |||||
| # set environment variable | |||||
| def setenv(self, key, value): | |||||
| environ[key] = value | |||||
| if WINDOWS: | |||||
| keyvalue = "%s=%s" % (key, value) | |||||
| self.msvcrt._putenv(keyvalue.encode("utf-8")) | |||||
| # unset environment variable | |||||
| def unsetenv(self, key): | |||||
| if environ.get(key) is not None: | |||||
| environ.pop(key) | |||||
| if WINDOWS: | |||||
| keyrm = "%s=" % key | |||||
| self.msvcrt._putenv(keyrm.encode("utf-8")) | |||||
| # -------------------------------------------------------------------------------------------------------- | # -------------------------------------------------------------------------------------------------------- | ||||
| # Get the complete license text of used third-party code and features. | # Get the complete license text of used third-party code and features. | ||||
| @@ -461,7 +461,7 @@ if __name__ == '__main__': | |||||
| except: | except: | ||||
| winId = 0 | winId = 0 | ||||
| host.setenv("CARLA_PLUGIN_EMBED_WINID", "0") | |||||
| gCarla.utils.setenv("CARLA_PLUGIN_EMBED_WINID", "0") | |||||
| if LINUX and winId != 0 and not config_UseQt5: | if LINUX and winId != 0 and not config_UseQt5: | ||||
| gui = CarlaEmbedW(host, winId) | gui = CarlaEmbedW(host, winId) | ||||