X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=music_sampler.py;h=c17f7bff98d1764704ee542ef9a1004aa1151f8b;hb=425dd061bf64a8304ec96aec870b0e2e24fa44f4;hp=ff04fd1e42d2d1d62c559cbbd5a9929b353d381b;hpb=9de92b6dd2bd906f6a64fce7c90a6aff0dbb27a2;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/music_sampler.py b/music_sampler.py index ff04fd1..c17f7bf 100644 --- a/music_sampler.py +++ b/music_sampler.py @@ -47,7 +47,7 @@ while 1: if context == 'normal': if event.type == pygame.KEYDOWN: key = mapping.find_by_key_num(event.key) - if key is not None: + if key is not None and not key.disabled: threading.Thread(name = "MSKeyAction", target=key.do_actions).start() threading.Thread(name = "MSClic", target=key.list_actions, args = [screen]).start() elif event.type == pygame.MOUSEBUTTONUP: @@ -56,12 +56,8 @@ while 1: threading.Thread(name = "MSClic", target=key.list_actions, args = [screen]).start() draw_lock.acquire() - if getattr(sys, 'frozen', False): - icon_police = pygame.font.Font(sys._MEIPASS + "/Symbola.ttf", 19) - police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14) - else: - icon_police = pygame.font.Font("Symbola.ttf", 19) - police = pygame.font.Font("Ubuntu-Regular.ttf", 14) + police = helpers.font(14) + icon_police = helpers.font(14, font = "Symbola") surface = pygame.Surface((208, 250)).convert() surface.fill((250, 250, 250)) @@ -69,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))