File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 22- Fixes bug where audio files could not be loaded because mixer.init was not
33 allowing the data to be modified to suit the hardware needs
44- 1, 2, and 4 channel wave files now supported
5+ - Fixes bug where keyboard files were read as ascii instead of unicode
6+ - Fixes bug where blocked audio device events were showing up in the queues
57
68## 2.0.0
79- Add qwerty keyboard layout and defaults to using it
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ testpypi:
2222 then \
2323 echo " \nNot publishing" ; exit 1; \
2424 fi
25- make dist
2625 python -m twine upload --repository testpypi dist/*
2726
2827pypi :
3130 then \
3231 echo " \nNot publishing" ; exit 1; \
3332 fi
34- make dist
3533 twine upload dist/*
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22
33import argparse
4+ import codecs
45import pygame
56import warnings
67import librosa
@@ -136,7 +137,7 @@ def __get_black_key_indices(key_name: str) -> set:
136137 return black_key_indices
137138
138139def get_keyboard_info (keyboard_file : str ):
139- with open (keyboard_file , 'r ' ) as k_file :
140+ with codecs . open (keyboard_file , encoding = 'utf-8 ' ) as k_file :
140141 lines = k_file .readlines ()
141142 keys = []
142143 anchor_index = - 1
@@ -206,6 +207,10 @@ def configure_pygame_audio_and_set_ui(
206207 pygame .display .init ()
207208 pygame .display .set_caption ('pianoputer' )
208209
210+ # block events that we don't want, this must be after display.init
211+ pygame .event .set_blocked (None )
212+ pygame .event .set_allowed (list (ALLOWED_EVENTS ))
213+
209214 # fonts
210215 pygame .font .init ()
211216
@@ -216,10 +221,6 @@ def configure_pygame_audio_and_set_ui(
216221 allowedchanges = AUDIO_ALLOWED_CHANGES_HARDWARE_DETERMINED
217222 )
218223
219- # block events that we don't want
220- pygame .event .set_blocked (None )
221- pygame .event .set_allowed (list (ALLOWED_EVENTS ))
222-
223224 screen_width = 50
224225 screen_height = 50
225226 if 'qwerty' in keyboard_arg :
You can’t perform that action at this time.
0 commit comments