diff --git a/photobooth_pygame.py b/photobooth_pygame.py index 72ff1ec..81fcd2c 100644 --- a/photobooth_pygame.py +++ b/photobooth_pygame.py @@ -713,9 +713,22 @@ class PB: # ── Thread caméra ──────────────────────────────────────────────────────── def _cam_loop(self): - if self.sim: return errs = 0 while True: + # En simulation : tentative de connexion automatique toutes les 8s + if self.sim: + time.sleep(8) + for _ in range(2): + try: + c = gp.Camera(); c.init() + if self.cam: + try: self.cam.exit() + except: pass + self.cam = c; self.sim = False; self.prev_actif = True + print("DSLR détecté automatiquement") + break + except: time.sleep(1) + continue if self.prev_actif: try: if self.cam is None: @@ -1245,7 +1258,7 @@ class PB: T = self.T if self._is_pell(): self._draw_pellicule(show_live=True) - self._overlay(90) + # Pas d'overlay global : le halo coloré suffit pour la lisibilité else: self._lv(); self._overlay(110) ch=str(self.chiffre) @@ -2056,7 +2069,6 @@ class PB: c[section][key]=max(mini,min(maxi,v+delta)); cfg_save(c); self.cfg=c def _reconnect_cam(self): - if self.sim: return self.prev_actif=False; time.sleep(0.5) try: if self.cam: self.cam.exit()