X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=music_sampler.py;h=42c01e3adfa629c789cfd6f2ff570cb6106e8613;hb=9d505ec9accd9a84bc6f22f4118bed9669c32fc8;hp=8ebfaa3e664f9c57eb951e57682dffd4e565eb74;hpb=956ce6fd3e47b2536f57f3359ebff26850f30aea;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/music_sampler.py b/music_sampler.py index 8ebfaa3..42c01e3 100644 --- a/music_sampler.py +++ b/music_sampler.py @@ -47,8 +47,8 @@ while 1: if context == 'normal': if event.type == pygame.KEYDOWN: key = mapping.find_by_key_num(event.key) - if key is not None: - threading.Thread(name = "MSKeyAction", target=key.do_actions).start() + if key is not None and not key.disabled: + threading.Thread(name = "MSKeyAction", target=key.do_actions, args = [screen]).start() threading.Thread(name = "MSClic", target=key.list_actions, args = [screen]).start() elif event.type == pygame.MOUSEBUTTONUP: key = mapping.find_by_collidepoint(pygame.mouse.get_pos()) @@ -65,10 +65,10 @@ while 1: for music_file in open_files.values(): police.set_bold(False) if music_file.is_playing(): - icon = icon_police.render("⏵", True, (0,0,0)) if music_file.is_paused(): icon = icon_police.render("⏸", True, (0,0,0)) else: + icon = icon_police.render("⏵", True, (0,0,0)) police.set_bold(True) text = police.render(music_file.name, True, (0,0,0)) surface.blit(icon, (0, offset)) @@ -78,9 +78,3 @@ while 1: pygame.display.flip() draw_lock.release() - -#### In Ipython #### -# for thread in threading.enumerate(): -# if thread.getName()[0:2] != "MS": -# continue -# thread.join()