123456789101112131415161718192021222324252627282930313233343536 |
- #!./bin/python3
- import os
- import yaml
- import threading
- # Include pygame without support prompt
- # Typing only available from version >= 2.0
- os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
- import pygame # type: ignore
- from musikautomat import Musikautomat
- # Configuration
- config = yaml.safe_load(open("config.yml"))
- fbdev = config.get("fbdev", "/dev/fb1")
- dx = config.get("dimx", 128)
- dy = config.get("dimy", 160)
- # Initialise pygame
- os.environ["SDL_FBDEV"] = fbdev
- pygame.init()
- # Create the display
- pydsp = pygame.display.set_mode((dx, dy), 0, 32)
- pygame.display.set_caption("Musikautomat")
- pygame.mouse.set_visible(False)
- pygame.key.set_repeat(400, 100)
- ma = Musikautomat(pydsp, config)
- ma.runDisplay()
|