default="config.yml",
required=False,
help="Config file to load")
+ parser.add_argument("-m", "--no-mixing",
+ action="store_true",
+ help="Don't make the mixing of sounds manually and let the sound system do it")
parser.add_argument("-l", "--latency",
default="high",
required=False,
Config.frame_rate = args.frame_rate
Config.channels = args.channels
Config.sample_width = args.sample_width
+ Config.no_mixing = args.no_mixing
class SelectDeviceAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
ready_color = ListProperty([1, 165/255, 0, 1])
def __init__(self, **kwargs):
- self.mixer = Mixer()
+ if Config.no_mixing:
+ self.mixer = None
+ else:
+ self.mixer = Mixer()
self.key_config, self.open_files = self.parse_config()
super(Mapping, self).__init__(**kwargs)
self._keyboard = Window.request_keyboard(self._keyboard_closed, self)
from .lock import Lock
from . import Config, gain
+from .mixer import Mixer
file_lock = Lock("file")
Machine.__init__(self, states=states, transitions=transitions, initial='initial')
+ self.mixer = mapping.mixer or Mixer()
self.volume = 100
self.mapping = mapping
self.filename = filename
self.start_playing()
def on_enter_loaded_playing(self):
- self.mapping.mixer.add_file(self)
+ self.mixer.add_file(self)
def finished_callback(self):
if self.is_loaded_playing():
self.stopped()
def trigger_stopped_events(self):
- self.mapping.mixer.remove_file(self)
+ self.mixer.remove_file(self)
self.wait_event.set()
def play_callback(self, out_data_length, frame_count):