]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - music_sampler.py
Move classes to separate file
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler.py
index 6cc49dff4884a7f0391f796ddd097321afe146b0..9f14d561fe127c419f4b0955f5f05ad78ee1b1ca 100644 (file)
@@ -10,7 +10,7 @@ size = width, height = 1024, 600
 
 helpers.draw_lock.acquire()
 screen = pygame.display.set_mode(size)
-mapping = helpers.Mapping(screen)
+mapping = helpers.Mapping(screen, helpers.draw_lock)
 
 action_surface = pygame.Surface((600, 250)).convert()
 action_surface.fill((0,0,0))
@@ -38,6 +38,11 @@ while 1:
             event.type == pygame.KEYDOWN and 
             event.mod  == 4160 and
             event.key  == pygame.K_c):
+        for thread in threading.enumerate():
+            if thread is threading.current_thread():
+                continue
+            thread.join()
+
         pygame.quit()
         sys.exit()