                       shutdown_event, patch_queue_in, samples, tk_vars)
          patch_queue_out = queue_manager.get_queue("preview_patch_out")
          while True:
              trigger = trigger_event.wait(1)
              if shutdown_event.is_set():
                  logger.debug("Shutdown received")
                  break
              if not trigger:
                  continue
              # Clear trigger so calling process can set it during this run
              trigger_event.clear()
              queue_manager.flush_queue("preview_patch_in")
 
</s> remove             # Clear trigger so calling process can set it during this run
            trigger_event.clear()
 </s> add             logger.debug("Patch Triggered") </s> remove         logger.debug("Launching patch process thread: (trigger_event: %s, shutdown_event: %s, "
                     "patch_queue_in: %s, samples: %s, tk_vars: %s)", trigger_event,
                     shutdown_event, patch_queue_in, samples, tk_vars)
 </s> add         logger.debug("Launching patch process thread: (patch_queue_in: %s, trigger_event: %s, "
                     "samples: %s)", patch_queue_in, trigger_event, samples) </s> remove             with self._lock:
 </s> add             with self._app.lock: </s> remove         tk_vars: dict
            Global tkinter variables. `Refresh` and `Busy` :class:`tkinter.BooleanVar`
 </s> add  </s> remove         self._display = display
        self._lock = lock
        self._trigger = trigger
        self.current_config = config_tools.config
 </s> add 
                       shutdown_event, patch_queue_in, samples, tk_vars)
          patch_queue_out = queue_manager.get_queue("preview_patch_out")
          while True:
              trigger = trigger_event.wait(1)



              if not trigger:
                  continue
              # Clear trigger so calling process can set it during this run
              trigger_event.clear()
              queue_manager.flush_queue("preview_patch_in")
keep keep keep keep replace replace replace keep keep keep keep keep
 bugfix:
    - preview tool - Prevent tkinter variables from exiting main thread
refactor:
    - preview tool - Split module to smaller sub-modules + docs, locales
Typing:
    - tools.preview.cli
Unit test:
    - tools.preview.viewer 
tools/preview/preview.py